:root {
  --bg: #f4f6fa;
  --surface: #ffffff;
  --surface-2: #f0f3f8;
  --border: #dfe4ec;
  --text: #1b2330;
  /* 薄い字(説明・補足)も、ぱっと見で読める濃さに(白地でおよそ 6.5:1) */
  --muted: #525c6c;
  --primary: #002f7b;
  --brand: #002f7b;
  --primary-soft: #e9eef7;
  --red: #d92d20;
  --red-soft: #fdecea;
  --orange: #c4560a;
  --orange-soft: #fff1e5;
  --yellow: #8a6a00;
  --yellow-soft: #fff8db;
  --green: #067647;
  --green-soft: #e6f6ee;
  --gray-soft: #eef0f3;
  --purple: #6941c6;
  --purple-soft: #f2edff;
  --shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 1px 3px rgba(16, 24, 40, .08);
  --radius: 10px;
  --on-primary: #fff;  /* 紺の面の上の字。暗い表示では紺が明るい青になるので、字は濃い紺にする */
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f141b; --surface: #171d26; --surface-2: #1e2531; --border: #2a3342;
    --text: #e6eaf0; --muted: #98a2b3; --primary: #7aa2e3;
    --brand: #e6eaf0; --primary-soft: #1a2740;
    --red: #ff6b5e; --red-soft: #3a1d1b; --orange: #ff9f59; --orange-soft: #3a2614;
    --yellow: #f2c94c; --yellow-soft: #352d10; --green: #4fd18b; --green-soft: #12301f;
    --gray-soft: #232b37; --purple: #b69cff; --purple-soft: #2a2140;
    --shadow: 0 1px 3px rgba(0, 0, 0, .4);
    --on-primary: #0b1630;
    color-scheme: dark;
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; }
/* 文字の大きさ 小・標準・大・特大(自分の名前 ▾ →「文字の大きさ」。prefs.font_size)。字の大きさはすべて rem で書く(1rem = 16px のとき標準)。
   大・特大は html の大きさを変えるだけで、全画面の字がそろって大きくなる。新しく書く字も px ではなく rem で(tests/test_css.py)。
   まだ選んでいない人(とログイン画面)は「大」(Hiro 2026-10-26: 読みにくいという声が多く、はじめから大きめに) */
html { font-size: 112.5%; }
html[data-fs="s"] { font-size: 93.75%; }
html[data-fs="m"] { font-size: 100%; }
html[data-fs="xl"] { font-size: 125%; }
body {
  background: var(--bg); color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP", "Yu Gothic UI", Meiryo, sans-serif;
  font-size: .9375rem; line-height: 1.55;
  /* 日本語は語(文節)の区切りで折り返す(wrap.js が区切りに <wbr> を入れる) */
  line-break: strict; overflow-wrap: break-word;
}
html.wrap-wbr body { word-break: keep-all; }
input, textarea, select, code, pre { word-break: normal; }
h1, h2, h3, .modal-head, .page-head p, .story-headline, .tile .lbl, .kpi .lbl { text-wrap: balance; }
p, li, .muted, .small { text-wrap: pretty; }
[hidden] { display: none !important; }
button, input, select, textarea { font: inherit; color: inherit; }
input, select, textarea {
  width: 100%; padding: 9px 11px; border: 1px solid var(--border); border-radius: 8px;
  background: var(--surface); min-height: 42px;
}
/* 複数行の入力欄は、少なくとも4行ぶんの高さ。書くと内容に合わせて伸びる(app.js の autoGrow) */
textarea { min-height: 112px; line-height: 1.6; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--primary); outline-offset: -1px; border-color: transparent; }
label { display: block; font-size: .8125rem; font-weight: 600; color: var(--muted); margin-bottom: 12px; }
label > input, label > select, label > textarea { margin-top: 4px; color: var(--text); font-weight: 400; font-size: .9375rem; }
.muted { color: var(--muted); }
.small { font-size: .8125rem; }
.error { color: var(--red); font-size: .875rem; min-height: 1em; margin: 4px 0 10px; }

.btn {
  border: 1px solid var(--border); background: var(--surface); padding: 8px 14px; border-radius: 8px;
  cursor: pointer; font-weight: 600; min-height: 40px; white-space: nowrap;
}
.btn:hover { background: var(--surface-2); }
.btn.primary { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
.btn.primary:hover { filter: brightness(1.07); }
.btn.success { background: var(--green); border-color: var(--green); color: var(--on-primary); }
.btn.danger { color: var(--red); }
.btn.small { min-height: 32px; padding: 4px 10px; font-size: .8125rem; }
.btn.block { width: 100%; }
.btn-row { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; margin-top: 8px; }

/* ログイン */
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.login-card { width: 100%; max-width: 380px; background: var(--surface); padding: 28px 24px; border-radius: 14px; box-shadow: var(--shadow); }
/* メール認証(ログインの2段目) */
.login-card .mfa-title { font-size: 1.0625rem; margin: 14px 0 4px; }
.login-card .btn.block + .btn.block { margin-top: 8px; }
.login-card .mfa-back { display: block; margin: 12px auto 0; background: none; border: 0; color: var(--muted); font: inherit; font-size: .875rem; text-decoration: underline; cursor: pointer; min-height: 40px; }
.brand { display: flex; align-items: center; gap: 8px; font-weight: 800; font-size: 1.0625rem; white-space: nowrap; }
.brand.big { font-size: 1.375rem; margin-bottom: 4px; }
.brand { letter-spacing: .02em; color: var(--brand); }
/* オークネットのロゴ(クレーム管理システムと同じ表示) */
.brand .logo-full { height: 24px; width: auto; flex: none; display: block; }
.brand .logo-mark { display: none; width: 30px; height: 30px; flex: none; }
.brand .brand-name { padding-left: 14px; border-left: 1px solid var(--border); line-height: 24px; }
.brand.big { flex-direction: column; align-items: flex-start; gap: 10px; }
.brand.big .logo-full { height: 32px; }
.brand.big .brand-name { padding-left: 0; border-left: 0; }

/* 線画アイコン */
.i { width: 1.15em; height: 1.15em; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; vertical-align: -.2em; flex: none; }
.tabs button { display: inline-flex; align-items: center; line-height: 1.2; }
.tabs .ico { display: inline-flex; align-items: center; margin-right: 6px; }
.tabs .ico .i { width: 18px; height: 18px; display: block; }
.bottom-nav .ico .i { display: block; }
/* 文字の中に置くアイコンは、文字の高さの中央にそろえる */
.btn, .badge, .bill-alert, .lost-box, .link-box, .instruction, .note-box h3, .advice-box h3, .bill-box h3, .auto-next h3, .todo-section h2 { align-items: center; }
.btn .i, .instruction .i, .lost-box .i, .link-box .i, .bill-alert .i { vertical-align: -.16em; }
h2 .i, h3 .i { vertical-align: -.18em; }

/* ヘッダー */
.topbar {
  border-top: 3px solid var(--primary);
  position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 20px;
  padding: 10px 20px; background: var(--surface); border-bottom: 1px solid var(--border);
}
.tabs { display: flex; gap: 4px; flex: 1; }
.tabs button, .bottom-nav button {
  border: 0; background: none; padding: 8px 14px; border-radius: 8px; cursor: pointer; font-weight: 600; color: var(--muted);
}
.tabs button.active { background: var(--primary-soft); color: var(--primary); }
.tabs { gap: 2px; min-width: 0; }
.tabs button { white-space: nowrap; padding: 8px 11px; }
.user-chip { white-space: nowrap; }
.role-tag { margin-left: 6px; font-size: .7188rem; font-weight: 700; color: var(--muted); background: var(--surface-2); border-radius: 6px; padding: 1px 6px; }
@media (max-width: 1520px) and (min-width: 761px) {
  /* メニューが多いのでアイコンを省いて1行に収める */
  .tabs .ico { display: none; }
  .tabs button { padding: 8px 8px; }
  .topbar { gap: 12px; }
}
.tabs .count { display: inline-block; margin-left: 4px; background: var(--red); color: #fff; border-radius: 10px; padding: 0 7px; font-size: .75rem; }
.topbar-right { display: flex; align-items: center; gap: 10px; }
.user-chip { border: 1px solid var(--border); background: var(--surface); border-radius: 20px; padding: 6px 12px; cursor: pointer; font-weight: 600; }
.user-menu { position: fixed; right: 16px; top: 58px; z-index: 20; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; box-shadow: var(--shadow); padding: 6px; display: flex; flex-direction: column; min-width: 180px; }
.user-menu button { border: 0; background: none; text-align: left; padding: 10px 12px; border-radius: 6px; cursor: pointer; }
.user-menu button:hover { background: var(--surface-2); }
.bottom-nav, .fab { display: none; }

/* 本文の幅はモニターに合わせて広げる(2026-11-03 高山さん「左右の余白を減らして広く」)。
   以前は 1400px で止めていたので、大きいモニターでは左右が空いて週次MTGの「決めたこと」や売上が窮屈だった。
   読みにくくならないよう 2200px で止め、左右の余白は画面幅に合わせて 20〜40px。スマホ(760px 以下)は下の指定のまま */
main { padding: 20px clamp(20px, 2vw, 40px); max-width: 2200px; margin: 0 auto; }
main.wide { max-width: none; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.page-head h1 { margin: 0; font-size: 1.375rem; }
.page-head p { margin: 2px 0 0; }
/* 画面名は選択中のメニューで分かるので見出しは出さない(スマホの下部メニューにない画面だけ表示) */
.mobile-only { display: none; }
/* 上部バーのメニュー(「?」=ヘルプ・⚙=管理・名前=自分のこと)。スマホは名前のメニューに全部まとめ、見出しを付ける */
.user-menu { max-height: calc(100dvh - 80px); overflow-y: auto; z-index: 60; }  /* 更新情報のお知らせ(z-index 50)より上 */
#tabs > button.nav-ov { display: none !important; }
.tabs .nav-more .chev { width: 14px; height: 14px; margin-left: 2px; }
.user-menu.more-menu button { display: flex; align-items: center; gap: 10px; }
.user-menu.more-menu button.active { color: var(--primary); background: var(--primary-soft); font-weight: 700; }
.user-menu .menu-sep { height: 1px; background: var(--border); margin: 4px 6px; }
.nav-set { list-style: none; margin: 0 0 var(--sp-4); padding: 0; display: flex; flex-direction: column; gap: 6px; }
.nav-row { display: flex; align-items: center; gap: 10px; padding: 6px 10px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); }
.nav-row.dragging { opacity: .5; }
.nav-row label { flex: 1; display: flex; align-items: center; justify-content: flex-start; gap: 8px; margin: 0; cursor: pointer; font-size: .9375rem; color: var(--text); }
.nav-row label input[type=checkbox] { width: 18px; height: 18px; min-height: 0; flex: none; margin: 0; padding: 0; }
.nav-grip { cursor: grab; color: var(--muted); display: grid; place-items: center; }
.nav-mv { display: flex; gap: 4px; }
.user-menu .menu-sec { padding: 8px 12px 2px; font-size: .7188rem; font-weight: 700; color: var(--muted); letter-spacing: .04em; }
.user-menu .menu-sec:first-child { padding-top: 4px; }
@media (min-width: 761px) { .user-menu [data-sp] { display: none !important; } .user-chip.has-new::after { display: none; } }
.user-chip { display: inline-flex; align-items: center; gap: 6px; }
.user-chip .avatar { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--primary); color: var(--on-primary); font-size: 13px; font-weight: 800; flex: none; margin-left: -6px; }
.user-chip .uc-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.user-chip .chev { width: 16px; height: 16px; flex: none; color: var(--muted); margin-right: -4px; transition: transform .15s; }
.user-chip[aria-expanded="true"] .chev { transform: rotate(180deg); }
.help-btn[aria-expanded="true"], .user-chip[aria-expanded="true"] { border-color: var(--primary); color: var(--primary); }
@media (max-width: 760px) { .page-head h1.mobile-only { display: block; } }
.filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.filters select, .filters input { width: auto; min-width: 150px; }
/* 絞り込みは選んだ内容で幅が変わらず、いつも1行(収まらなければ横にスクロール)。説明文は残りの幅で2行まで */
.page-head:has(> .filters) > div:first-child { flex: 1 1 26em; min-width: 0; }
.page-head:has(> .filters) > div:first-child > p { margin: 0; line-height: 1.4; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; }
.page-head.stack > div:first-child { flex-basis: 100%; }
.page-head.stack > div:first-child > p { display: block; margin: 2px 0 0; line-height: inherit; }
.page-head > .filters { flex-wrap: nowrap; margin: -2px -2px -2px auto; padding: 2px; max-width: calc(100% + 4px); overflow-x: auto; scrollbar-width: thin; }
.page-head > .filters > * { flex: none; }
.filters .owner-sel, .org-filter select { width: 12em; min-width: 0; max-width: none; text-overflow: ellipsis; }
.page-head > .filters input[type="search"] { width: 15em; }

/* 「アクション」 */
.summary-strip { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 20px; }
.summary-strip .tile { background: var(--surface); border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow); border-left: 5px solid var(--border); cursor: pointer; }
/* スクロール時はヘッダーの直下に固定し、1行のコンパクト表示にする */
.summary-strip { position: sticky; top: var(--topbar-h, 64px); z-index: 5; }
.summary-strip.stuck { background: var(--bg); padding: 8px 0; margin-bottom: 12px; gap: 8px; box-shadow: 0 6px 8px -6px rgba(15, 23, 42, .18); }
.summary-strip .tile { transition: padding .15s; }
.no-anim, .no-anim * { transition: none !important; }
.summary-strip.stuck .tile { padding: 6px 12px; display: flex; align-items: baseline; gap: 8px; border-left-width: 4px; }
.summary-strip.stuck .tile .num { font-size: 1.125rem; }
.summary-strip .lbl .short { display: none; }
.todo-section { scroll-margin-top: calc(var(--topbar-h, 64px) + 64px); }
#strip-sentinel { height: 0; }
.tile .num { font-size: 1.75rem; font-weight: 800; line-height: 1.1; }
.tile .lbl { font-size: .8125rem; color: var(--muted); font-weight: 600; }
.tile.red { border-left-color: var(--red); } .tile.red .num { color: var(--red); }
.tile.orange { border-left-color: var(--orange); } .tile.orange .num { color: var(--orange); }
.tile.blue { border-left-color: var(--primary); } .tile.blue .num { color: var(--primary); }
.tile.gray { border-left-color: var(--muted); }

.todo-section { margin-bottom: 22px; }
.todo-section h2 { font-size: 1rem; margin: 0 0 8px; display: flex; align-items: center; gap: 8px; }
.todo-section h2 .dot { width: 10px; height: 10px; border-radius: 50%; }
.todo-list { display: grid; gap: 8px; }
.todo {
  display: grid; grid-template-columns: 110px 1fr auto; gap: 14px; align-items: center;
  background: var(--surface); border-radius: var(--radius); padding: 12px 14px; box-shadow: var(--shadow);
}
.todo .action { font-weight: 700; font-size: 1rem; }
.todo .meta { font-size: .8125rem; color: var(--muted); display: flex; gap: 6px 12px; flex-wrap: wrap; align-items: center; margin-top: 2px; }
.todo .meta a, .link { color: var(--primary); cursor: pointer; text-decoration: none; font-weight: 600; }
.todo-buttons { display: flex; gap: 6px; }
.empty { padding: 20px; text-align: center; color: var(--muted); background: var(--surface); border-radius: var(--radius); border: 1px dashed var(--border); }

/* バッジ */
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 9px; border-radius: 20px; font-size: .7812rem; font-weight: 700; white-space: nowrap; }
.due { justify-content: center; padding: 6px 8px; border-radius: 8px; font-size: .8125rem; text-align: center; flex-direction: column; gap: 0; line-height: 1.3; }
.due b { font-size: .9375rem; }
.b-red { background: var(--red-soft); color: var(--red); }
.b-orange { background: var(--orange-soft); color: var(--orange); }
.b-yellow { background: var(--yellow-soft); color: var(--yellow); }
.b-gray { background: var(--gray-soft); color: var(--muted); }
.b-green { background: var(--green-soft); color: var(--green); }
.b-blue { background: var(--primary-soft); color: var(--primary); }
.b-purple { background: var(--purple-soft); color: var(--purple); }
.instruction { background: var(--purple-soft); color: var(--purple); border-radius: 8px; padding: 6px 10px; font-size: .8125rem; font-weight: 600; margin-top: 6px; }
.instruction .i { margin-right: 4px; }

/* パイプライン */
/* 全ステージを横スクロールなしで1画面に収める(受注・失注は少し細く) */
.board { display: grid; grid-template-columns: repeat(var(--open, 5), minmax(0, 1fr)) repeat(2, minmax(0, .75fr)); gap: 8px; height: calc(100vh - 170px); min-height: 360px; }
.column { background: var(--surface-2); border-radius: var(--radius); padding: 8px; display: flex; flex-direction: column; min-width: 0; min-height: 0; }
/* 件数が多くても画面に収まるよう、列の中だけ縦スクロール */
.column-body { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 6px; padding: 2px; min-height: 0; }
.more-btn { margin-top: 4px; flex: none; }
.clamp1 { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.column.drag-over { outline: 2px dashed var(--primary); }
.column-head { padding: 2px 4px 6px; }
.column-head .name { font-weight: 800; display: flex; justify-content: space-between; }
.column-head .sum { font-size: .8125rem; color: var(--muted); }
.column.won .column-head .name { color: var(--green); }
.column.lost .column-head .name { color: var(--muted); }
.card { background: var(--surface); border-radius: 8px; padding: 8px 10px; min-width: 0; overflow-wrap: anywhere; box-shadow: var(--shadow); cursor: pointer; border-left: 4px solid transparent; }
.card[draggable="true"] { cursor: grab; }
.card.overdue { border-left-color: var(--red); }
.card.today { border-left-color: var(--orange); }
.card.noaction { border-left-color: var(--red); }
.card .title { font-weight: 700; }
.card .company { font-size: .8125rem; color: var(--muted); }
.card .row { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 2px 6px; margin-top: 4px; font-size: .8125rem; }
.card { flex: none; }
.card .next { margin-top: 6px; padding-top: 6px; line-height: 1.45; border-top: 1px solid var(--border); font-size: .8125rem; }
.card .next .label { color: var(--muted); font-size: .75rem; font-weight: 700; }
.card .next .what { font-weight: 600; }
.card .instruction { font-size: .75rem; padding: 4px 8px; }
.column.won .card, .column.lost .card { padding: 6px 10px; }
.column-head .name span:first-child { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.column-head .name { gap: 4px; font-size: .875rem; }
.card .status { font-size: .75rem; color: var(--primary); font-weight: 600; margin-top: 2px; }
.column.lost .card .status { color: var(--muted); }
/* サービス(AUC / i-Auc)の小さな目印 */
.svc { display: inline-block; font-size: .6562rem; font-weight: 800; padding: 0 5px; border-radius: 4px; margin-right: 5px; vertical-align: 1px; line-height: 1.5; }
.svc.auc { background: var(--primary); color: var(--on-primary); }
.svc.iauc { background: #e8f3ec; color: #0f7a3d; border: 1px solid #b9dcc6; }
.seg.compact { margin: 0; flex-wrap: nowrap; }
.seg.compact button { padding: 6px 12px; white-space: nowrap; }
.modal-sub { display: block; font-size: .7812rem; color: var(--muted); font-weight: 600; margin-top: 2px; }
.lost-box, .link-box { border-radius: 10px; padding: 8px 12px; margin-bottom: 12px; font-size: .8438rem; display: flex; gap: 6px 10px; align-items: center; flex-wrap: wrap; }
.lost-box { background: var(--surface-2); }
.link-box { background: var(--primary-soft); }
.auto-next { background: var(--green-soft); }
.auto-next h3 { color: var(--green); }
.funnel-bar.onb { background: var(--purple); }
table.report td, table.report th { padding: 8px 10px; }
table.report tfoot th { color: inherit; border-top: 2px solid var(--border); }
@media (max-width: 1180px) {
  /* 狭い画面では2段(進行中4列+残り)に折り返す */
  .board { grid-template-columns: repeat(4, minmax(0, 1fr)); height: auto; }
  .column { height: 46vh; min-height: 220px; }
}

/* チーム状況 */
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 20px; }
.kpi { background: var(--surface); border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow); }
.kpi .lbl { font-size: .8125rem; color: var(--muted); font-weight: 600; }
.kpi .num { font-size: 1.5rem; font-weight: 800; }
.panel { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; margin-bottom: 20px; }
.panel h2 { margin: 0 0 4px; font-size: 1rem; }
.panel > p { margin: 0 0 12px; }
.table-wrap { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-size: .875rem; }
th, td { padding: 10px 10px; text-align: left; border-bottom: 1px solid var(--border); white-space: nowrap; }
th { font-size: .7812rem; color: var(--muted); font-weight: 700; }
td.num, th.num { text-align: right; }
tr.clickable { cursor: pointer; }
tr.clickable:hover td { background: var(--surface-2); }
.zero { color: var(--muted); }
.alert-num { color: var(--red); font-weight: 800; }
.funnel { display: grid; gap: 6px; }
.funnel-row { display: grid; grid-template-columns: 160px 1fr 140px; gap: 10px; align-items: center; font-size: .875rem; }
.funnel-bar { height: 22px; background: var(--primary); border-radius: 4px; min-width: 2px; }

/* メンバーカード */
.member-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 12px; }
.member-card { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px 16px; cursor: pointer; display: grid; gap: 8px; }
.member-card:hover { outline: 2px solid var(--primary-soft); }
.mc-head { display: flex; justify-content: space-between; align-items: baseline; font-size: 1rem; }
.mc-nums { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.mc-nums div { display: flex; flex-direction: column; }
.mc-alerts { display: flex; gap: 4px; flex-wrap: wrap; }
.mc-last { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* 着地見込み */
.fc-top { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-bottom: 20px; }
.fc-card .num { font-size: 1.75rem; }
.fc-split { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: .8125rem; color: var(--muted); margin-top: 4px; }
.sw { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 4px; vertical-align: -1px; }
.sw.won, .fc-stack .won { background: var(--green); }
.sw.wt, .fc-stack .wt { background: var(--primary); }
.sw.pl, .fc-stack .pl { background: var(--primary-soft); }
.fc-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
.fc-legend { display: flex; gap: 12px; color: var(--muted); }
.fc-quarters { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; margin: 12px 0 16px; }
.fc-q { background: var(--surface-2); border-radius: 8px; padding: 10px 12px; }
.fc-q.fy { background: var(--primary); color: var(--on-primary); }
.fc-qnum { font-size: 1.25rem; font-weight: 800; }
.fc-bars { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 6px; align-items: end; }
.fc-col { display: flex; flex-direction: column; align-items: stretch; gap: 4px; min-width: 0; }
.fc-col.now .fc-m { color: var(--primary); }
.fc-col.past .fc-stack { opacity: .85; }
.fc-val { font-size: .7188rem; text-align: center; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-height: 16px; }
.fc-stack { height: 180px; display: flex; flex-direction: column; justify-content: flex-end; border-radius: 6px 6px 0 0; overflow: hidden; }
.fc-stack div { width: 100%; }
.fc-m { text-align: center; font-size: .7812rem; font-weight: 700; color: var(--muted); border-top: 1px solid var(--border); padding-top: 4px; line-height: 1.3; }
/* 「今月」は月の下の行に置く。どの月にもこの行の高さを取っておき、月の数字と棒の下端を全部そろえる */
.fc-now { display: block; min-height: 1.3em; }
.fc-grid { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); gap: 0 16px; }

/* 成功事例アドバイス */
.advice-box { background: var(--green-soft); border-radius: 10px; padding: 12px 14px; margin: 14px 0 4px; }
.advice-box h3 { margin: 0 0 6px; font-size: .875rem; color: var(--green); }
.advice-box ul { margin: 6px 0 0; padding: 0; list-style: none; display: grid; gap: 6px; }
.advice-box .tip li { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; background: var(--surface); border-radius: 8px; padding: 6px 10px; }
.advice-box .tip li > span:first-child { font-weight: 700; }
.advice-box .tip li .btn { margin-left: auto; }
.example { background: var(--surface); border-radius: 8px; padding: 6px 10px; margin-top: 6px; font-size: .8125rem; }
.example summary { cursor: pointer; }
.example .timeline { margin-top: 8px; }

/* 請求 */
.bill-alert { background: var(--red-soft); color: var(--red); border-radius: 10px; padding: 10px 14px; margin-bottom: 14px; cursor: pointer; font-size: .875rem; }
.bill-alert .link { color: var(--red); text-decoration: underline; }
.kpi-alert { box-shadow: inset 0 0 0 2px var(--red-soft), var(--shadow); }
.seg { display: flex; gap: 4px; flex-wrap: wrap; margin: 4px 0 12px; }
.seg button { border: 1px solid var(--border); background: var(--surface); border-radius: 20px; padding: 6px 14px; cursor: pointer; font-weight: 700; color: var(--muted); }
.seg button span { margin-left: 6px; font-size: .75rem; background: var(--surface-2); border-radius: 10px; padding: 0 7px; }
.seg button.active { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
.seg button.active span { background: rgba(255,255,255,.25); }
.inv-todo { grid-template-columns: 150px 1fr auto; }
.bill-box { background: var(--surface-2); border-radius: 10px; padding: 12px 14px; margin: 14px 0 4px; }
.bill-box h3 { margin: 0; font-size: .875rem; }
.inv-list { display: grid; gap: 6px; margin-top: 6px; }
.inv-row { display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; background: var(--surface); border-radius: 8px; padding: 8px 10px; font-size: .875rem; align-items: center; }
.inv-amt { text-align: right; font-weight: 800; }
.inv-act { grid-column: 1 / -1; display: flex; gap: 4px; flex-wrap: wrap; justify-content: flex-end; }
.bill-bars { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 6px; margin-top: 12px; }
.bb-col { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.bb-pair { height: 160px; display: flex; align-items: flex-end; justify-content: center; gap: 3px; }
.bb { width: 40%; border-radius: 4px 4px 0 0; min-height: 1px; }
.bb.wt { background: var(--primary); } .bb.won { background: var(--green); }
.bb-col.now .fc-m { color: var(--primary); }
.bb-v { font-size: .6875rem; text-align: center; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* 先頭へ戻る */
.totop { position: fixed; right: 24px; bottom: 24px; z-index: 30; width: 48px; height: 48px; border-radius: 50%; border: 0;
  background: var(--primary); color: var(--on-primary); display: grid; place-items: center; cursor: pointer;
  box-shadow: 0 6px 16px rgba(0, 47, 123, .35); transition: transform .15s, filter .15s; }
/* 広い画面では画面の端ではなく、本文の右端のすぐ外側に置く(本文の幅 1400px に合わせる) */
@media (min-width: 761px) { .totop:not(.wide) { right: max(24px, calc((100vw - 1400px) / 2 - 68px)); } }
.totop:hover { transform: translateY(-2px); filter: brightness(1.15); }

/* モーダル */
dialog { border: 0; border-radius: 14px; padding: 0; width: min(680px, calc(100vw - 24px)); max-height: calc(100vh - 32px); background: var(--surface); color: var(--text); box-shadow: 0 20px 50px rgba(0,0,0,.25); }
dialog::backdrop { background: rgba(15, 20, 30, .45); }
.modal-head { display: flex; justify-content: space-between; align-items: center; padding: 16px 20px; border-bottom: 1px solid var(--border); position: sticky; top: 0; background: var(--surface); z-index: 1; }
.modal-head h2 { margin: 0; font-size: 1.125rem; }
.close-x { border: 0; background: none; font-size: 1.5rem; cursor: pointer; color: var(--muted); line-height: 1; padding: 4px 8px; }
/* 重ねて開いた画面の「←」: 元の画面(案件など)にそのまま戻る */
.modal-head h2 { flex: 1; min-width: 0; }
.modal-back { border: 0; background: none; cursor: pointer; color: var(--muted); padding: 4px 8px; margin: 0 4px 0 -8px; display: inline-flex; align-items: center; border-radius: 8px; }
.modal-back:hover { background: var(--bg); color: var(--text); }
.modal-back .i { width: 20px; height: 20px; }
/* 入力途中で閉じるときの確認 */
dialog.confirm-dlg { width: min(400px, calc(100vw - 32px)); padding: 20px; }
.confirm-dlg .confirm-title { margin: 0 0 6px; font-weight: 700; font-size: 1rem; }
.confirm-dlg .btn-row { margin-top: 16px; }
.modal-content { padding: 16px 20px 20px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.next-box { background: var(--primary-soft); border-radius: 10px; padding: 12px 14px 2px; margin-bottom: 12px; }
.next-box h3 { margin: 0 0 8px; font-size: .875rem; color: var(--primary); }
.note-box { background: var(--purple-soft); border-radius: 10px; padding: 12px 14px; margin-bottom: 12px; }
.note-box h3 { margin: 0 0 6px; font-size: .875rem; color: var(--purple); }
.section-title { font-size: .9375rem; margin: 18px 0 8px; }
.timeline { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.timeline li { display: grid; grid-template-columns: 30px 1fr; gap: 8px; }
.timeline .ico { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-2); color: var(--muted); }
.timeline .ico .i { width: 16px; height: 16px; }
.timeline .ico.k-done { background: var(--green-soft); color: var(--green); }
.timeline .ico.k-flag { background: var(--purple-soft); color: var(--purple); }
.timeline .ico.k-stage, .timeline .ico.k-create { background: var(--primary-soft); color: var(--primary); }
.timeline .txt { white-space: pre-wrap; overflow-wrap: anywhere; }
.timeline .when { font-size: .75rem; color: var(--muted); }
.log-form { display: grid; grid-template-columns: 130px 1fr auto; gap: 8px; align-items: start; }
.stage-steps { display: flex; gap: 4px; flex-wrap: wrap; margin-bottom: 14px; }
.stage-steps button { border: 1px solid var(--border); background: var(--surface); border-radius: 20px; padding: 4px 12px; font-size: .8125rem; cursor: pointer; font-weight: 600; color: var(--muted); }
.stage-steps button.done { background: var(--primary-soft); color: var(--primary); border-color: transparent; }
.stage-steps button.current { background: var(--primary); color: var(--on-primary); border-color: var(--primary); }
.stage-steps button.won.current { background: var(--green); border-color: var(--green); }
.stage-steps button.lost.current { background: var(--muted); border-color: var(--muted); }
.stage-steps button:disabled { cursor: default; }

.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: #1b2330; color: #fff; padding: 10px 18px; border-radius: 10px; z-index: 100; font-weight: 600; box-shadow: var(--shadow); max-width: calc(100vw - 32px); }
.toast.err { background: var(--red); }

/* スマホ */
@media (max-width: 760px) {
  body { font-size: .9375rem; }
  .topbar { padding: 10px 16px; gap: 10px; }
  .tabs, #new-deal-btn { display: none; }
  .topbar-right { margin-left: auto; }
  main { padding: 14px 16px 96px; }
  .bottom-nav {
    display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 10; background: var(--surface);
    border-top: 1px solid var(--border); padding: 4px 4px calc(4px + env(safe-area-inset-bottom));
  }
  .bottom-nav { overflow-x: auto; overscroll-behavior-x: contain; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
  .bottom-nav::-webkit-scrollbar { display: none; }
  .bottom-nav button { flex: 1 0 auto; min-width: 52px; display: flex; flex-direction: column; align-items: center; font-size: .7188rem; padding: 6px 2px; gap: 1px; position: relative; }
  .bottom-nav button .ico { display: grid; place-items: center; width: 44px; height: 28px; border-radius: 14px; transition: background .15s; }
  .bottom-nav button .ico .i { width: 22px; height: 22px; stroke-width: 1.8; }
  .bottom-nav button.active .ico { background: var(--primary-soft); }
  .bottom-nav button.active .ico .i { stroke-width: 2.2; }
  .bottom-nav button.active { color: var(--primary); }
  .bottom-nav .count { position: absolute; top: 2px; right: calc(50% - 22px); background: var(--red); color: #fff; border-radius: 10px; padding: 0 6px; font-size: .6875rem; }
  .fab {
    display: grid; place-items: center; position: fixed; right: 16px; bottom: calc(76px + env(safe-area-inset-bottom)); z-index: 11;
    width: 56px; height: 56px; border-radius: 50%; border: 0; background: var(--primary); color: var(--on-primary); font-size: 30px; box-shadow: 0 6px 16px rgba(0,47,123,.35); cursor: pointer;
  }
  .summary-strip, .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .summary-strip.stuck { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px; padding: 6px 0; }
  .summary-strip.stuck .tile { padding: 4px 6px; gap: 4px; justify-content: center; }
  .summary-strip.stuck .tile .num { font-size: 1rem; }
  .summary-strip.stuck .lbl { font-size: .6875rem; white-space: nowrap; }
  .summary-strip.stuck .lbl .full { display: none; }
  .summary-strip.stuck .lbl .short { display: inline; }
  .todo { grid-template-columns: 1fr; gap: 8px; }
  .todo .due { flex-direction: row; gap: 6px; justify-self: start; }
  .todo-buttons .btn { flex: 1; }
  /* スマホはステージを縦に並べる */
  .board { grid-template-columns: 1fr; height: auto; }
  .column { height: auto; min-height: 0; }
  .column-body { overflow: visible; }
  .grid2 { grid-template-columns: 1fr; }
  .filters { width: 100%; }
  .filters select, .filters input { flex: 1; min-width: 0; }
  .page-head > .filters { width: auto; flex: 1 1 100%; justify-content: flex-start; }
  .page-head > .filters select, .page-head > .filters .owner-sel, .page-head > .filters .org-filter select { flex: none; width: 9.5em; }
  .page-head > .filters input[type="search"] { flex: none; width: 13em; }
  .page-head > .filters .seg.compact { width: auto; }
  .log-form { grid-template-columns: 1fr; }
  dialog { width: 100vw; max-width: 100vw; max-height: 100vh; height: 100%; border-radius: 0; margin: 0; }
  .funnel-row { grid-template-columns: 80px 1fr 100px; font-size: .8125rem; }
  .member-grid { grid-template-columns: 1fr; }
  .user-chip { white-space: nowrap; max-width: 46vw; overflow: hidden; text-overflow: ellipsis; padding: 6px 10px; font-size: .8125rem; }
  .bottom-nav button { white-space: nowrap; letter-spacing: -.02em; }
  .totop { right: 20px; bottom: calc(144px + env(safe-area-inset-bottom)); width: 44px; height: 44px; }
  .topbar .brand .logo-full { display: none; }
  .topbar .brand .logo-mark { display: block; }
  .topbar .brand .brand-name { padding-left: 0; border-left: 0; }
  .fc-top { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .fc-quarters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .fc-q.fy { grid-column: span 2; }
  .fc-bars { gap: 2px; }
  .fc-val { font-size: .5625rem; }
  .fc-stack { height: 130px; }
  .fc-m { font-size: .6562rem; }
  .fc-grid { grid-template-columns: minmax(0, 1fr); }
  .inv-todo { grid-template-columns: 1fr; }
  .bill-bars { gap: 2px; } .bb-pair { height: 110px; } .bb-v { font-size: 8.5px; }
  .bottom-nav button { font-size: .6562rem; }
  .seg.compact { width: 100%; } .seg.compact button { flex: 1; }
}
@media (prefers-color-scheme: dark) {
  /* 紺色のロゴが暗い背景に沈まないよう白地にのせる */
  .brand .logo-full, .brand .logo-mark { background: #fff; border-radius: 6px; padding: 3px 6px; box-sizing: content-box; }
}

/* 週次ミーティング */
/* 議題は1行に並べる。入りきらない幅では横にずらす(折り返さない) */
.seg.mtg-steps { flex-wrap: nowrap; overflow-x: auto; gap: 4px; scrollbar-width: thin; padding-bottom: 2px; }
.mtg-steps button { white-space: nowrap; flex: none; padding: 5px 10px 5px 5px; font-size: .875rem; }
.mtg-steps button[data-mtg-step="0"] { padding-left: 10px; }
.mtg-steps button span { margin: 0 4px 0 0; padding: 0 5px; }
.mtg-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.mtg-grid.five { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.mtg-big { font-size: 2.125rem; font-weight: 800; line-height: 1.2; }
.mtg-big small { font-size: .875rem; color: var(--muted); margin-left: 4px; font-weight: 700; }
.mtg-legend { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 6px; }
.mtg-no { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--primary); color: var(--on-primary); font-size: 14px; margin-right: 8px; }
.mtg-sec h2 { display: flex; align-items: center; font-size: 1.1875rem; margin-bottom: 12px; }
.mtg-nav { justify-content: space-between; }
.pbar { position: relative; height: 12px; background: var(--surface-2); border-radius: 6px; display: flex; overflow: visible; margin-top: 8px; }
.pbar .won { background: var(--green); border-radius: 6px 0 0 6px; }
.pbar .exp { background: var(--primary); opacity: .45; }
.pbar .tgt { position: absolute; top: -4px; bottom: -4px; width: 3px; background: var(--red); border-radius: 2px; }
.up { color: var(--green); font-weight: 700; } .down { color: var(--red); font-weight: 700; }
td.hot { color: var(--red); font-weight: 800; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.chip { background: var(--surface-2); border-radius: 14px; padding: 3px 10px; font-size: .7812rem; }
.chip b { margin-left: 6px; color: var(--green); }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 12px; }
/* 経営報告 */
.crumbs { margin: 0 0 12px; font-size: .875rem; }
.crumbs a { cursor: pointer; }
.ex-conclusion ul, .ex-list { margin: 6px 0 0; padding-left: 20px; line-height: 1.9; }
.ex-conclusion li { font-size: .9688rem; }
.ex-kpis { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; margin-bottom: 20px; }
.drill-card { cursor: pointer; transition: transform .1s; }
.drill-card:hover { transform: translateY(-2px); outline: 2px solid var(--primary-soft); }
.drill { cursor: pointer; color: var(--primary); text-decoration: underline; }
.ex-links { margin-top: 10px; font-weight: 700; }
.print-only { display: none; }
@media (max-width: 1100px) { .ex-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); } .mtg-grid.five { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 760px) {
  .mtg-grid, .mtg-grid.five, .ex-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .mtg-grid .mtg-card { grid-column: span 2; }
  .grid3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media print {
  .topbar, .bottom-nav, .fab, .totop, .no-print, .toast { display: none !important; }
  .print-only { display: block; }
  .print-head { font-size: 1rem; margin-bottom: 8px; }
  main { padding: 0; max-width: none; }
  body { background: #fff; }
  .panel, .kpi { box-shadow: none; border: 1px solid #ccc; break-inside: avoid; }
  .crumbs a { color: inherit; text-decoration: none; }
}
.todo.mtg-row { grid-template-columns: minmax(0, 1fr) auto; }
@media (max-width: 760px) { .todo.mtg-row { grid-template-columns: 1fr; } }
@media (max-width: 760px) {
  /* 文中のリンク(会社名・パンくず)も指で押しやすいよう、見た目を変えずに押せる範囲を上下に広げる */
  a.link, a[data-open], a[data-customer], .crumbs a { display: inline-block; padding: 12px 0; margin: -12px 0; }
  .crumbs { line-height: 2.2; }
  .user-menu button { padding: 12px 14px; }
}
/* ---------- 商談の録音・自動入力 ---------- */
.ai-entry { background: var(--surface-2); border-radius: 10px; padding: 12px 14px; margin-bottom: 10px; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.ai-entry > p { flex-basis: 100%; margin: 0; }
.ai-entry #rec-list { flex-basis: 100%; display: grid; gap: 6px; }
.ai-entry #rec-list:empty { display: none; }
.rec-item { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; background: var(--surface); border-radius: 8px; padding: 8px 10px; }
.rec-item-btns { margin-left: auto; display: flex; gap: 6px; }
.badge.rec-ready { background: var(--green-soft); color: var(--green); }
.badge.rec-failed { background: var(--red-soft); color: var(--red); }
.badge.rec-transcribing, .badge.rec-analyzing, .badge.rec-uploading { background: var(--primary-soft); color: var(--primary); }
.rec-panel { text-align: center; padding: 18px 8px 10px; background: var(--surface-2); border-radius: 12px; margin-bottom: 12px; }
.rec-time { font-size: 2.75rem; font-weight: 800; font-variant-numeric: tabular-nums; letter-spacing: .02em; }
.rec-time.small-time { font-size: 1.125rem; margin-bottom: 8px; }
.rec-dot { width: 14px; height: 14px; border-radius: 50%; background: var(--muted); margin: 0 auto 6px; }
.rec-dot.on { background: var(--red); animation: rec-blink 1.2s infinite; }
@keyframes rec-blink { 50% { opacity: .25; } }
.rec-level, .progress { height: 8px; background: var(--border); border-radius: 99px; overflow: hidden; max-width: 260px; margin: 8px auto; }
.rec-level span, .progress span { display: block; height: 100%; width: 0; background: var(--green); transition: width .15s; }
.progress span { background: var(--primary); }
.rec-steps { display: flex; justify-content: center; gap: 6px; flex-wrap: wrap; margin-top: 10px; }
.rec-steps span { font-size: .75rem; padding: 3px 10px; border-radius: 99px; background: var(--border); color: var(--muted); }
.rec-steps span.done { background: var(--primary); color: var(--on-primary); }
.spinner { width: 28px; height: 28px; border-radius: 50%; border: 3px solid var(--border); border-top-color: var(--primary); margin: 0 auto; animation: spin .9s linear infinite; }
.spinner.small { display: inline-block; width: 14px; height: 14px; border-width: 2px; vertical-align: -2px; margin: 0; }
@keyframes spin { to { transform: rotate(360deg); } }
.ai-note { background: var(--green-soft); color: var(--green); border-radius: 8px; padding: 8px 12px; font-size: .8125rem; display: flex; gap: 6px; align-items: center; }
.todo-edit { display: grid; grid-template-columns: auto 1fr 150px; gap: 6px; align-items: center; margin-bottom: 6px; }
.todo-edit input[data-text], .todo-edit input[data-due] { margin: 0; }
.todo-edit .chk input, .chk-line input, .next-pick input { width: auto; margin: 0; }
.next-pick { font-size: .75rem; display: flex; align-items: center; gap: 4px; white-space: nowrap; margin: 0; }
.chk-line { display: flex; align-items: center; gap: 6px; font-weight: 600; margin-bottom: 8px; }
.transcript { margin: 8px 0 4px; }
.transcript summary { cursor: pointer; color: var(--primary); font-weight: 600; font-size: .8125rem; }
.transcript pre { white-space: pre-wrap; font: inherit; font-size: .8125rem; background: var(--surface-2); border-radius: 8px; padding: 10px; max-height: 260px; overflow: auto; }
.transcript audio { width: 100%; margin-top: 8px; }
.ai-tag { font-size: .625rem; font-weight: 700; color: var(--purple); background: var(--purple-soft); border-radius: 4px; padding: 0 4px; margin-left: 6px; }
/* 次のアクション(複数・同列)。案件画面は「次のアクション → 活動を記録 → 活動履歴」を1本の流れで見せる */
.more-acts { list-style: none; margin: 4px 0 0; padding: 0; display: grid; gap: 2px; font-size: .8125rem; color: var(--muted); }
.more-acts li { display: flex; align-items: center; gap: 6px; min-width: 0; }
.more-acts li > span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.more-acts .badge { font-size: .6875rem; padding: 0 6px; flex: none; }
.more-n { font-size: .6875rem; color: var(--muted); background: var(--surface-2); border-radius: 10px; padding: 0 6px; margin-left: 6px; white-space: nowrap; }
.acts .section-title, .now-box .section-title, .done-flow .section-title { display: flex; align-items: center; gap: 6px; }
.acts .section-title .i, .now-box .section-title .i, .done-flow .section-title .i { width: 18px; height: 18px; color: var(--primary); }
.acts .section-title .muted, .done-flow .section-title .muted { font-weight: 400; margin-left: 2px; }
.acts .section-title:first-child, .acts { margin-top: 0; }
.timeline.upcoming li.act { grid-template-columns: 30px 1fr auto; align-items: center; background: var(--primary-soft); border-radius: 10px; padding: 8px 10px 8px 8px; }
.timeline.upcoming li.act.late { background: var(--red-soft, #fdecec); }
.timeline.upcoming li.act.late .when { color: var(--red); font-weight: 700; }
.timeline.upcoming li.act.none { grid-template-columns: 30px 1fr; background: var(--surface-2); }
.timeline .ico.k-next { background: var(--surface); border: 2px dashed var(--primary); width: 26px; height: 26px; margin: 2px; }
.timeline.upcoming li.act.late .ico.k-next { border-color: var(--red); }
.timeline.upcoming .txt { font-weight: 600; }
.timeline.upcoming .when { display: flex; align-items: center; gap: 6px; }
.act-btns { display: flex; gap: 4px; align-items: center; }
.act-btns .icon-only .i { width: 14px; height: 14px; }
.act-add { display: grid; grid-template-columns: 1fr 150px auto; gap: 6px; margin-top: 8px; align-items: center; }
.act-add input { margin: 0; }
.act-add .act-quick { grid-column: 1 / -1; }
.act-add .act-quick > div { margin: 0 !important; }
li.act.editing { grid-template-columns: 30px 1fr !important; }
li.act.editing .act-add { margin-top: 0; }
.act-edit-btns { display: flex; gap: 4px; }
.now-box { border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); margin: 16px 0 0; padding-bottom: 12px; }
.done-flow .timeline li.is-done .txt { color: var(--text); }
.tl-more { display: block !important; }
/* PC は「次のアクション・活動を記録」と「活動履歴」を左右に並べ、スクロールせずに両方が見えるようにする */
dialog.deal-modal { width: min(1120px, 96vw); }
@media (max-width: 760px) { dialog.wide-modal.deal-modal { width: 100vw; max-width: 100vw; } }
.act-add[hidden] { display: none; }
.act-add-open { margin-top: 8px; }
@media (min-width: 900px) {
  .deal-flow { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 0 24px; align-items: start; }
  .deal-flow .flow-side { border-left: 1px solid var(--border); padding-left: 24px; }
  .deal-flow .flow-side .section-title { margin-top: 0; }
  .deal-flow .now-box { border-bottom: 0; }
}
.deal-info { margin-top: 18px; border: 1px solid var(--border); border-radius: 10px; padding: 0 14px; }
.deal-info > summary { cursor: pointer; padding: 12px 0; font-weight: 700; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.deal-info > summary .i { width: 16px; height: 16px; color: var(--primary); }
.deal-info > summary .muted { font-weight: 400; }
.deal-info[open] > summary { border-bottom: 1px dashed var(--border); margin-bottom: 12px; }
.deal-info .link-box { margin-bottom: 10px; }
.na-head { display: grid; grid-template-columns: 1fr 150px 32px; gap: 6px; margin-bottom: 2px; }
.na-rows { display: grid; gap: 6px; }
.na-row { display: grid; grid-template-columns: 1fr 150px 32px; gap: 6px; align-items: center; }
.na-row input { margin: 0; }
.na-tools { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin: 8px 0 12px; }
.na-quick { display: flex; gap: 4px; flex-wrap: wrap; }
.done-pick { border: 1px solid var(--border); border-radius: 10px; padding: 8px 12px 2px; margin: 0 0 12px; }
.done-pick legend { font-size: .8125rem; font-weight: 700; padding: 0 4px; }
.done-pick .chk-line { font-weight: 400; color: var(--text); font-size: .875rem; margin: 0 0 6px; padding: 4px 0; }
.done-pick .chk-line input { width: 18px; height: 18px; min-height: 0; padding: 0; flex: none; }
.todo-edit .chk input { width: 18px; height: 18px; min-height: 0; padding: 0; }
.done-pick .chk-line .badge { margin-left: auto; flex: none; }
.ai-pending { font-size: .8125rem; color: var(--green); background: var(--green-soft); border-radius: 6px; padding: 3px 8px; margin-top: 4px; display: inline-flex; align-items: center; gap: 4px; cursor: pointer; font-weight: 600; }
.ai-pending .i { width: 14px; height: 14px; }
@media (max-width: 760px) {
  .todo-edit { grid-template-columns: auto 1fr; }
  .todo-edit input[data-due] { grid-column: 2; }
  .act-btns .btn { padding: 4px 8px; }
  .deal-modal .stage-steps { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .deal-modal .stage-steps button { flex: none; }
  .act-add { grid-template-columns: 1fr 1fr; }
  .act-add input:first-child { grid-column: 1 / -1; }
  .na-head { display: none; }
  .na-row { grid-template-columns: 1fr 32px; }
  .na-row input[data-na-text] { grid-column: 1 / -1; }
  .ai-entry .btn { flex: 1; }
  .ai-entry .rec-start { flex-basis: 100%; padding: 12px; font-size: 1rem; }
  .rec-item-btns { margin-left: 0; }
  .todo-buttons .rec-btn { flex: 0 0 auto; }
}

/* 検索(ヘッダーの横断検索・条件での絞り込み) */
.search-btn { display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--border); background: var(--surface-2); color: var(--muted); border-radius: 20px; padding: 7px 12px; cursor: pointer; font: inherit; font-weight: 600; white-space: nowrap; }
.search-btn:hover { color: var(--text); }
.search-btn kbd { font: .6875rem/1 inherit; border: 1px solid var(--border); border-radius: 5px; padding: 3px 5px; background: var(--surface); }
/* PC で検索の文字・Ctrl K を省くのは、上部バーに入りきらないときだけ(app.js の fitHeader) */
@media (max-width: 760px) { .search-btn { padding: 9px; border-radius: 50%; } .search-btn .i { width: 20px; height: 20px; } .search-btn span, .search-btn kbd { display: none; } }
/* スマホは利用者のボタンに名前だけを出す(役職タグは途中で切れるため) */
@media (max-width: 760px) { .user-chip .role-tag { display: none; } }
dialog.qs { margin-top: 8vh; max-height: 80vh; }
@media (max-width: 760px) { dialog.qs { margin: 0; max-height: 100vh; } }
#qs-input { width: 100%; font-size: 1.0625rem; padding: 12px 14px; margin-bottom: 4px; }
.sr-label { display: flex; align-items: center; gap: 8px; font-size: .7812rem; font-weight: 700; color: var(--muted); margin: 14px 0 6px; }
.sr-label span { font-weight: 600; }
.sr-label a { margin-left: auto; }
.qs-item { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; border: 0; background: none; color: inherit; font: inherit; padding: 9px 10px; border-radius: 10px; cursor: pointer; }
.qs-item:hover, .qs-item.sel { background: var(--surface-2); }
.qs-item > .i { color: var(--primary); width: 20px; height: 20px; }
.qs-item > .badge { flex: none; }
.qs-item > span:not(.badge) { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.qs-item b, .qs-item small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.qs-item b .role-tag { margin-left: 6px; }
.qs-item small { color: var(--muted); font-size: .7812rem; }
.sr-presets { display: flex; gap: 6px; flex-wrap: wrap; }
.chip-btn { display: inline-flex; align-items: center; gap: 5px; border: 1px solid var(--border); background: var(--surface); color: var(--text); border-radius: 18px; padding: 6px 12px; font: inherit; font-size: .8125rem; font-weight: 600; cursor: pointer; }
.chip-btn:hover { border-color: var(--primary); color: var(--primary); }
.chip-btn.saved .i { color: var(--purple); }
.chip-btn.active { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
.sr-bar { display: flex; gap: 8px; align-items: center; }
.sr-bar input { flex: 1; font-size: 1rem; padding: 11px 14px; }
.sr-toggle { display: none; }
.sr-toggle .count { margin-left: 6px; background: var(--primary); color: var(--on-primary); border-radius: 10px; padding: 0 7px; font-size: .75rem; }
.sr-panel { margin: 14px 0; }
.sr-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px 14px; }
.sr-grid label { font-size: .7812rem; font-weight: 700; color: var(--muted); display: flex; flex-direction: column; gap: 4px; margin: 0; }
.sr-grid select, .sr-grid input { width: 100%; color: var(--text); font-weight: 400; }
.sr-range { display: flex; align-items: center; gap: 6px; } .sr-range input { min-width: 0; }
.sr-flags { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 12px; }
.sr-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; margin: 8px 0; }
.sr-head .badge { margin-left: 8px; }
.sr-head .btn-row { margin: 0; }
.sr-list { display: grid; gap: 8px; }
.sr-row { display: grid; grid-template-columns: minmax(0, 1fr) 130px minmax(0, 300px); gap: 14px; align-items: center; background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 12px 14px; cursor: pointer; }
.sr-row:hover { outline: 2px solid var(--primary); outline-offset: -2px; }
.sr-title { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.sr-title b { font-size: .9688rem; }
.sr-row .meta { font-size: .8125rem; color: var(--muted); display: flex; gap: 6px 12px; flex-wrap: wrap; align-items: center; margin-top: 4px; }
.sr-amount { text-align: right; font-weight: 700; display: flex; flex-direction: column; }
.sr-amount small { color: var(--muted); font-weight: 400; font-size: .75rem; }
.sr-next { display: flex; gap: 6px; align-items: center; }
.ss-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
.ss-list li { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 8px 10px; background: var(--surface-2); border-radius: 10px; }
@media (max-width: 760px) {
  .sr-toggle { display: inline-flex; min-height: 44px; }
  .sr-panel { display: none; } .sr-panel.open { display: block; }
  .sr-grid { grid-template-columns: 1fr 1fr; }
  .sr-row { grid-template-columns: minmax(0, 1fr) auto; gap: 6px 10px; }
  .sr-next { grid-column: 1 / -1; }
  .sr-presets { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
  .chip-btn { white-space: nowrap; min-height: 38px; }
  .sr-head .btn-row { width: 100%; justify-content: flex-start; }
}

/* 表: 見出しの固定(縦に長い表は枠内でスクロール)・先頭列の固定・並べ替え */
.table-wrap { max-height: calc(100vh - var(--topbar-h, 64px) - 40px); max-height: calc(100dvh - var(--topbar-h, 64px) - 40px); overflow: auto; overscroll-behavior: auto; }
.table-wrap thead th { position: sticky; top: 0; z-index: 2; background: var(--surface); box-shadow: inset 0 -1px 0 var(--border); transform: translateY(var(--th-shift, 0)); }
/* ページごとスクロールして枠の上が隠れたら、見出しの行をヘッダーの下まで押し下げる(table.js の stickHeads) */
.table-wrap.th-pushed thead th { box-shadow: inset 0 -1px 0 var(--border), 0 6px 8px -6px rgba(15, 23, 42, .18); }
.table-wrap tfoot th { position: sticky; bottom: 0; z-index: 2; background: var(--surface); box-shadow: inset 0 1px 0 var(--border); }
.table-wrap th:first-child, .table-wrap td:first-child { position: sticky; left: 0; z-index: 1; background: var(--surface); }
.table-wrap thead th:first-child, .table-wrap tfoot th:first-child { z-index: 3; }
.table-wrap td:first-child { box-shadow: inset -1px 0 0 var(--border); }
tr.clickable:hover td:first-child { background: var(--surface-2); }
th.sortable { cursor: pointer; user-select: none; }
th.sortable::after { content: "↕"; margin-left: 4px; opacity: .35; font-size: .6875rem; }
th.sortable:hover { color: var(--primary); }
th.sortable:hover::after { opacity: .8; }
th.sortable[aria-sort="ascending"], th.sortable[aria-sort="descending"] { color: var(--primary); }
th.sortable[aria-sort="ascending"]::after { content: "▲"; opacity: 1; }
th.sortable[aria-sort="descending"]::after { content: "▼"; opacity: 1; }
th.sortable:focus-visible { outline: 2px solid var(--primary); outline-offset: -2px; }
/* 列ごとの絞り込み(table.js): 見出しの漏斗ボタン・いまの条件のチップ・条件の画面(PCは見出しの下、スマホは下からのシート) */
th[data-tf-n]::before { content: attr(data-tf-n); display: inline-block; min-width: 15px; height: 15px; margin-right: 3px; border-radius: 8px; background: var(--primary); color: var(--on-primary); font-size: 10px; line-height: 15px; text-align: center; vertical-align: 1px; }
.tf-btn { border: 0; background: none; padding: 2px; margin: -2px -2px -2px 2px; color: var(--muted); opacity: .45; cursor: pointer; vertical-align: middle; border-radius: 4px; line-height: 0; }
.tf-btn svg { width: 13px; height: 13px; }
th:hover .tf-btn, .tf-btn:focus-visible { opacity: 1; }
.tf-btn:hover { background: var(--primary-soft); color: var(--primary); }
th.tf-on .tf-btn { opacity: 1; color: var(--on-primary); background: var(--primary); }
th.tf-on { color: var(--primary); }
.tf-bar { display: none; flex-wrap: wrap; align-items: center; gap: var(--sp-2); margin-bottom: var(--sp-2); }
.tf-bar.on { display: flex; }
.tf-bar .tf-all svg { width: 14px; height: 14px; }
.tf-bar .count { margin-left: 4px; background: var(--primary); color: var(--on-primary); border-radius: 10px; padding: 0 7px; font-size: .75rem; }
.tf-count { font-size: .8125rem; color: var(--muted); }
.tf-count b { color: var(--text); }
.tf-chip { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--primary); background: var(--primary-soft); color: var(--primary); border-radius: 999px; padding: 3px 6px 3px 10px; font: inherit; font-size: .75rem; cursor: pointer; max-width: 100%; }
.tf-chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tf-chip.sort { border-color: var(--border); background: var(--surface-2); color: var(--text); }
.tf-chip b { font-weight: 400; opacity: .7; }
.tf-chip:hover b { opacity: 1; }
dialog.tf-pop { width: min(380px, calc(100vw - 16px)); max-height: min(560px, calc(100vh - 16px)); padding: 0; display: none; flex-direction: column; overflow: clip; }
dialog.tf-pop[open] { display: flex; }
dialog.tf-pop.tf-anchored { margin: 0; position: fixed; right: auto; bottom: auto; }
dialog.tf-pop:not(.tf-one) { width: min(520px, calc(100vw - 16px)); }
dialog.tf-pop::backdrop { background: rgba(15, 20, 30, .12); }
.tf-head { display: flex; align-items: center; gap: var(--sp-2); padding: var(--sp-3) var(--sp-4); border-bottom: 1px solid var(--border); }
.tf-head b { flex: 1; }
.tf-head .close-x { font-size: 1.25rem; }
.tf-body { overflow: auto; padding: var(--sp-2) var(--sp-4) var(--sp-3); flex: 1; min-height: 0; }
.tf-body h4 { margin: var(--sp-3) 0 var(--sp-1); font-size: .8125rem; color: var(--muted); }
.tf-body > p { margin: 0 0 var(--sp-2); }
.tf-sortbtns { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2); margin-bottom: var(--sp-2); }
.tf-vals { max-height: 240px; overflow: auto; border: 1px solid var(--border); border-radius: 8px; padding: var(--sp-1) 0; }
.tf-check { display: flex; align-items: center; gap: var(--sp-2); padding: 6px var(--sp-3); margin: 0; cursor: pointer; font-size: .875rem; font-weight: 400; color: var(--text); }
.tf-check:hover { background: var(--surface-2); }
.tf-check span:first-of-type { flex: 1; }
.tf-check input { width: auto; height: auto; min-height: 0; padding: 0; margin: 0; flex: none; }
.tf-sortbtns > span { flex-basis: 100%; }
.tf-check.all { border-bottom: 1px solid var(--border); font-weight: 600; }
.tf-find { margin-bottom: var(--sp-2); }
.tf-range { display: flex; align-items: center; gap: var(--sp-2); }
.tf-range input { flex: 1; min-width: 0; }
.tf-range + p { margin: var(--sp-1) 0 0; }
.tf-sortlist { list-style: none; padding: 0; margin: 0 0 var(--sp-2); display: grid; gap: var(--sp-2); }
.tf-sortlist li { display: flex; align-items: center; gap: var(--sp-2); }
.tf-sortlist li b { flex: 1; }
.tf-num { display: inline-block; width: 20px; height: 20px; border-radius: 10px; background: var(--primary); color: var(--on-primary); text-align: center; font-size: 12px; line-height: 20px; }
.tf-ico { min-width: 32px; padding: 4px 6px; }
details.tf-col { border-top: 1px solid var(--border); padding: var(--sp-2) 0; }
details.tf-col summary { cursor: pointer; font-weight: 600; display: flex; align-items: center; gap: var(--sp-2); }
details.tf-col summary .badge { font-weight: 400; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 60%; }
details.tf-col[open] summary { margin-bottom: var(--sp-2); }
.tf-foot { display: flex; justify-content: space-between; gap: var(--sp-2); padding: var(--sp-3) var(--sp-4); border-top: 1px solid var(--border); }
@media (max-width: 760px) {
  .tf-btn { display: none; }
  .tf-bar { display: flex; }
  dialog.tf-pop, dialog.tf-pop:not(.tf-one) { width: 100vw; max-width: 100vw; height: auto; max-height: 85vh; margin: auto 0 0; border-radius: 16px 16px 0 0; }
  dialog.tf-pop::backdrop { background: rgba(15, 20, 30, .45); }
  .tf-check { padding: 10px var(--sp-3); }
}
@media print { .tf-bar, .tf-btn { display: none !important; } th[data-tf-n]::before { content: none; } }
@media print { .table-wrap { max-height: none; overflow: visible; } .table-wrap th, .table-wrap td { position: static !important; transform: none !important; } th.sortable::after { content: none; } }

/* 押せる項目(ドリルダウン)を見た目で分かるようにする */
.drill-card { position: relative; border: 1px solid transparent; transition: transform .12s, box-shadow .12s, border-color .12s; }
.drill-card:hover, .drill-card:focus-visible { transform: translateY(-2px); border-color: var(--primary); box-shadow: 0 6px 18px rgba(0, 47, 123, .15); outline: none; }
.drill-card:active { transform: translateY(0); }
.drill-card .drill-foot { margin-top: 8px; padding-top: 8px; border-top: 1px dashed var(--border); color: var(--primary); font-size: .8125rem; font-weight: 700; }
a.drill { display: inline-flex; align-items: center; gap: 2px; text-decoration: none; font-weight: 700; color: var(--primary); background: var(--primary-soft, #eaf0fb); border-radius: 14px; padding: 1px 10px; margin: 0 2px; font-size: .92em; white-space: nowrap; }
a.drill:hover, a.drill:focus-visible { background: var(--primary); color: var(--on-primary); outline: none; }
.drill-row { cursor: pointer; border-radius: 8px; padding: 3px 6px; margin: 0 -6px; }
.drill-row:hover, .drill-row:focus-visible { background: var(--surface-2); outline: none; }
.drill-row .chev, tr.clickable td:first-child::after, .member-card .mc-head::after { color: var(--primary); font-weight: 800; }
.drill-row .chev { margin-left: 8px; }
tr.clickable td:first-child { color: var(--primary); }
tr.clickable td:first-child::after { content: " ›"; }
.member-card .mc-head::after { content: "›"; margin-left: 8px; font-size: 1.125rem; line-height: 1; }
.member-card:hover { outline: 2px solid var(--primary); }
@media print { a.drill { background: none; padding: 0; } .drill-row .chev, tr.clickable td:first-child::after { content: none; display: none; } }

/* 別の画面・内訳から来たときの「← 元の画面に戻る」 */
.backbar { display: flex; }
.back-btn { display: inline-flex; align-items: center; gap: 6px; color: var(--primary); font-weight: 700; }
.back-btn .i { width: 18px; height: 18px; }
#content > .backbar + * { margin-top: calc(var(--sp-3) - var(--sp-block)); }

/* 成功事例(事例ストーリー) */
.story-list { display: grid; gap: 10px; }
.story { background: var(--surface); border-radius: 12px; border: 1px solid var(--border); margin-top: 8px; color: var(--text); }
.story > summary { list-style: none; cursor: pointer; padding: 12px 14px; display: grid; gap: 6px; position: relative; }
.story > summary::-webkit-details-marker { display: none; }
.story > summary::after { content: "›"; position: absolute; right: 14px; top: 12px; font-size: 1.25rem; color: var(--primary); transition: transform .15s; }
.story[open] > summary::after { transform: rotate(90deg); }
.story[open] > summary { border-bottom: 1px dashed var(--border); }
.story > *:not(summary) { margin-left: 14px; margin-right: 14px; }
.story-head { display: grid; gap: 6px; padding-right: 24px; }
.story-title { display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: center; }
.story-title b { font-size: .9375rem; }
.story-headline { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; }
.story-headline .lbl { font-size: .7812rem; color: var(--muted); font-weight: 700; }
.story-headline b { font-size: 1.5rem; font-weight: 800; color: var(--green); line-height: 1.1; }
.story-headline .cmp { font-size: .8125rem; font-weight: 700; color: var(--green); background: var(--green-soft); border-radius: 12px; padding: 1px 9px; }
.story-key { display: flex; gap: 6px; align-items: center; font-size: .8438rem; }
.story-key .i { color: var(--green); }
.story-more { font-size: .7812rem; color: var(--primary); font-weight: 700; }
.story-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 4px 18px; }
.story-sec h4 { margin: 12px 0 6px; font-size: .7812rem; color: var(--muted); }
.story-sec p { margin: 0 0 6px; font-size: .8438rem; }
.story-facts { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; font-size: .8438rem; }
.story-facts li { display: flex; gap: 8px; align-items: center; padding: 3px 8px; border-radius: 8px; }
.story-facts li > span:first-child { color: var(--muted); min-width: 4em; font-size: .7812rem; }
.story-facts li.same { background: var(--green-soft); }
.same-mark { color: var(--green); font-weight: 800; font-size: .75rem; margin-left: auto; white-space: nowrap; }
p .same-mark { margin: 0; }
.story-tl { list-style: none; margin: 0; padding: 0 0 0 12px; border-left: 2px solid var(--border); display: grid; gap: 6px; font-size: .8438rem; }
.story-tl li { display: grid; grid-template-columns: 74px minmax(0, 1fr); gap: 8px; position: relative; }
.story-tl li::before { content: ""; position: absolute; left: -18px; top: 6px; width: 10px; height: 10px; border-radius: 50%; background: var(--surface); border: 2px solid var(--border); }
.story-tl li.k-stage::before, .story-tl li.k-create::before { border-color: var(--primary); }
.story-tl li.key { background: var(--green-soft); border-radius: 8px; padding: 6px 8px; margin-left: -4px; }
.story-tl li.key::before { background: var(--green); border-color: var(--green); left: -14px; }
.tl-date { color: var(--muted); font-size: .7812rem; padding-top: 1px; }
.story-note { margin: 12px 14px 0; padding: 10px 14px; border-left: 4px solid var(--green); background: var(--surface-2); border-radius: 0 10px 10px 0; font-size: .875rem; }
.story-note cite { display: block; margin-top: 4px; font-style: normal; font-size: .7812rem; color: var(--muted); }
.story-note.empty-note { border-left-color: var(--border); }
.story-actions { margin: 10px 14px 12px; justify-content: flex-start; }
.tip-list { margin-top: 10px; font-size: .8438rem; }
.tip-list summary { cursor: pointer; }
.tip-list ul li { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; background: var(--surface); border-radius: 8px; padding: 6px 10px; }
.tip-list ul li .btn { margin-left: auto; }
@media (max-width: 760px) {
  .story-grid { grid-template-columns: 1fr; }
  .story-tl li { grid-template-columns: 1fr; gap: 0; }
  .story-actions .btn { flex: 1 1 100%; }
}

/* ---------- 顧客カルテ ---------- */
.cu-tabs { margin-bottom: 12px; }
.cu-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.cu-name { font-size: 1.375rem; margin: 0 0 4px; }
.cu-head .meta { display: flex; gap: 6px 12px; flex-wrap: wrap; align-items: center; font-size: .8125rem; color: var(--muted); }
.cu-dates { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; margin-bottom: 12px; }
.cu-dates > div { background: var(--surface); border-radius: 8px; box-shadow: var(--shadow); padding: 6px 12px; display: grid; white-space: nowrap; font-size: .875rem; }
.cu-risk { background: var(--red-soft); color: var(--red); }
.cu-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 0 20px; align-items: start; }
.cu-side { display: grid; grid-template-columns: minmax(0, 1fr); }
.cu-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.cu-kpis .num { font-size: 1.25rem; }
.cu-cmp { margin: 10px 0 0; }
.radar { width: 100%; max-width: 420px; display: block; margin: 0 auto; overflow: visible; }
.radar .rd-ring { fill: none; stroke: var(--border); stroke-width: 1; }
.radar .rd-self { fill: rgba(0, 47, 123, .18); stroke: var(--primary); stroke-width: 2; }
.radar .rd-similar, .radar .rd-top, .radar .rd-past { fill: none; stroke-width: 2; stroke-dasharray: 5 4; }
.radar .rd-similar { stroke: var(--orange); } .radar .rd-top { stroke: var(--green); } .radar .rd-past { stroke: var(--muted); }
.radar .rd-dot { fill: var(--primary); }
.radar .rd-label { font-size: .6875rem; fill: var(--text); font-weight: 700; }
.radar .rd-val { font-size: .75rem; fill: var(--primary); font-weight: 800; }
.rd-legend { display: flex; gap: 6px 16px; flex-wrap: wrap; justify-content: center; font-size: .7812rem; color: var(--muted); margin: 4px 0 8px; }
.rd-key { display: inline-block; width: 18px; height: 0; border-top: 3px solid var(--primary); vertical-align: middle; margin-right: 5px; }
.rd-key.similar { border-top: 3px dashed var(--orange); } .rd-key.top { border-top: 3px dashed var(--green); } .rd-key.past { border-top: 3px dashed var(--muted); }
.cu-axes td .neg, .cu-axes td .pos { font-size: .7188rem; margin-left: 4px; font-weight: 700; }
.cu-axes .neg { color: var(--red); } .cu-axes .pos { color: var(--green); }
.cu-advice h3 { font-size: .875rem; margin: 12px 0 6px; }
.cu-adv { display: flex; justify-content: space-between; gap: 8px; align-items: center; flex-wrap: wrap; padding: 8px 0; border-top: 1px solid var(--border); }
.cu-adv > div { flex: 1 1 220px; }
.cu-todo { display: grid; grid-template-columns: auto 1fr auto; gap: 8px; align-items: start; padding: 8px 0; border-top: 1px solid var(--border); font-size: .875rem; }
.cu-todo:first-of-type { border-top: 0; }
.cu-deals { display: grid; gap: 6px; }
.cu-deal { padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px; cursor: pointer; font-size: .875rem; }
.cu-deal:hover { background: var(--surface-2); }
.cu-deal .meta { display: flex; gap: 4px 10px; flex-wrap: wrap; font-size: .7812rem; color: var(--muted); margin-top: 3px; align-items: center; }
.cu-usage { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 4px; height: 150px; align-items: end; margin-top: 8px; }
.cu-usage > div { display: grid; grid-template-rows: 1fr auto auto; height: 100%; text-align: center; font-size: .6875rem; color: var(--muted); }
.cu-usage .bar { align-self: end; background: var(--primary); border-radius: 4px 4px 0 0; width: 100%; }
.cu-usage .v { color: var(--text); font-weight: 700; }
.cu-info { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; margin: 8px 0 12px; font-size: .875rem; }
.cu-info dt { color: var(--muted); }
.cu-info dd { margin: 0; overflow-wrap: anywhere; }
.cu-contacts { display: grid; gap: 8px; }
.cu-contact { display: flex; gap: 4px 8px; flex-wrap: wrap; align-items: center; padding-top: 8px; border-top: 1px solid var(--border); }
.cu-contact > div { flex-basis: 100%; }
.cu-contact-edit { border: 1px solid var(--border); border-radius: 8px; padding: 10px; margin-bottom: 8px; }
.cu-contact-edit .check { display: flex; gap: 6px; align-items: center; }
.cu-contact-edit .check input { width: auto; }
.cu-rec { padding: 8px 0; border-top: 1px solid var(--border); font-size: .875rem; }
.cu-rec:first-of-type { border-top: 0; }
.cu-link { margin-bottom: 8px; }
.score-pill { display: inline-grid; place-items: center; min-width: 34px; min-height: 24px; padding: 0 6px; border-radius: 12px; font-weight: 800; font-size: .8125rem; margin-right: 6px; }
.score-pill.s-high { background: var(--green-soft); color: var(--green); }
.score-pill.s-mid { background: var(--yellow-soft); color: var(--yellow); }
.score-pill.s-low { background: var(--red-soft); color: var(--red); }
.score-pill.s-none { background: var(--surface-2); color: var(--muted); }
.cu-row, .cu-risk-row { cursor: pointer; }
.cu-risk-row .score-pill { align-self: center; }
@media (max-width: 1000px) {
  .cu-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 760px) {
  .cu-name { font-size: 1.1875rem; }
  .cu-head .btn-row { width: 100%; }
  .cu-head .btn-row .btn { flex: 1 1 auto; }
  .cu-todo { grid-template-columns: auto 1fr; }
  .cu-todo .todo-buttons { grid-column: 1 / -1; justify-content: flex-end; }
}
@media (prefers-color-scheme: dark) {
  .radar .rd-self { fill: rgba(122, 162, 227, .22); }
}
.cu-head a.btn { text-decoration: none; color: inherit; display: inline-flex; align-items: center; justify-content: center; gap: 4px; }
.cu-risk-row .score-pill { justify-self: start; }
.cu-claims { display: grid; }
.cu-claim { display: grid; grid-template-columns: auto 1fr; gap: 4px 10px; align-items: start; padding: 10px 0; border-top: 1px solid var(--border); cursor: pointer; font-size: .875rem; }
.cu-claim:first-child { border-top: 0; }
.cu-claim:hover b { color: var(--primary); }
.cu-claim.done { opacity: .7; }
.cl-badges { display: flex; flex-direction: column; gap: 3px; align-items: flex-start; min-width: 74px; }
.cl-status { margin-bottom: 12px; }
@media (max-width: 760px) {
  .cu-claim { grid-template-columns: 1fr; }
  .cl-badges { flex-direction: row; }
}
/* 顧客カルテの見出しは上に固定。固定中は会社名・状態・担当を1行に */
.cu-head { position: sticky; top: var(--topbar-h, 64px); z-index: 6; background: var(--bg); margin: 0 -8px 10px; padding: 6px 8px; }
.cu-head.stuck { box-shadow: 0 6px 10px -8px rgba(16, 24, 40, .35); flex-wrap: nowrap; align-items: center; padding: 8px; }
.cu-head.stuck .cu-title { display: flex; align-items: center; gap: 10px; min-width: 0; flex: 1; }
.cu-head.stuck .cu-name { font-size: 1rem; margin: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex-shrink: 1; min-width: 0; }
.cu-head.stuck .meta { flex-wrap: nowrap; white-space: nowrap; overflow: hidden; flex-shrink: 0; max-width: 60%; }
.cu-head.stuck .btn-row .btn { min-height: 0; padding: 4px 8px; }
.cu-head.stuck .btn-row .btn:not(:first-child) { display: none; }
@media (max-width: 760px) {
  .cu-head.stuck .btn-row { width: auto; flex-shrink: 0; }
  .cu-head.stuck .meta { max-width: none; }
  .cu-head.stuck .meta > span:not(.badge):not(.svc):not(.cu-biz) { display: none; }
}
/* 375px 前後の狭いスマホでヘッダーが横にはみ出さないようにする */
@media (max-width: 400px) {
  .topbar .brand { min-width: 0; flex-shrink: 1; }
  .topbar .brand .brand-name { font-size: .9375rem; white-space: nowrap; }
  .topbar-right { min-width: 0; gap: 6px; }
  .user-chip { max-width: 34vw; }
  .user-chip .role-tag { display: none; }
}

/* データ出力・表ごとのCSV */
.export-list { display: grid; gap: 6px; margin-top: 8px; }
.export-list .btn { justify-content: flex-start; text-align: left; }
.panel > .fc-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
.panel > .fc-head h2 { margin: 0; }

/* スマホ: 浮いているボタンは置かない(内容に重なるため)。新しい案件・さくらは上部バーのアイコン、
   先頭へ戻るのは下部メニューの今のタブをもう一度押す */
.top-icon { display: none; }
@media (max-width: 760px) {
  main { padding-bottom: calc(88px + env(safe-area-inset-bottom)); }
  .fab, .totop, .butler-fab { display: none !important; }
  .top-icon { display: grid; place-items: center; width: 44px; height: 44px; padding: 0; border-radius: 50%; border: 1px solid var(--border); background: var(--surface-2); color: var(--text); cursor: pointer; flex: none; }
  .top-icon .i { width: 22px; height: 22px; }
  .top-icon.primary { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
  .top-icon.butler { border: 0; background: none; overflow: hidden; }
  .top-icon.butler .butler-svg { display: block; width: 40px; height: 40px; border-radius: 50%; }
  .topbar-right { gap: 6px; }
  .topbar .brand .brand-name { display: none; }  /* 画面名はページの見出しに出るので、上部バーはロゴだけにしてアイコンを並べる */
  .search-btn { width: 44px; height: 44px; padding: 0; display: grid; place-items: center; }
  .user-chip { max-width: 34vw; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .user-chip * { white-space: nowrap; }
  /* アクションの集計カード(固定表示): 4枚を画面幅に等分し、件数の上・項目名の下の2段にして、どの件数でもはみ出さない */
  .summary-strip.stuck { margin-left: 0; margin-right: 0; padding: 6px 0; gap: 4px; grid-template-columns: repeat(4, minmax(0, 1fr));
    box-shadow: -16px 0 0 var(--bg), 16px 0 0 var(--bg), 0 6px 8px -6px rgba(15, 23, 42, .18); }
  .summary-strip.stuck .tile { min-width: 0; overflow: hidden; display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 0; padding: 3px 2px; border-left-width: 4px; line-height: 1.15; text-align: center; }
  .summary-strip.stuck .tile .num { font-size: 1.0625rem; letter-spacing: -.02em; }
  .summary-strip.stuck .lbl { max-width: 100%; font-size: .6875rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .user-chip { min-height: 44px; }
  .seg button { min-height: 44px; }
  a.drill { min-height: 40px; padding: 0 14px; margin: 2px 2px; }
  /* 押しやすさ: 閉じる・進捗の段階・絞り込み・ファネルの行 */
  .close-x { min-width: 44px; min-height: 44px; margin: -6px -10px -6px 0; }
  .stage-steps { gap: 6px; }
  .stage-steps button { min-height: 40px; padding: 4px 12px; }
  .chip-btn { min-height: 44px; }
  .drill-row { min-height: 44px; }
}

/* ---------- アニメーション(短く控えめに。transform と opacity だけを動かす) ---------- */
@keyframes fade-up { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes grow-x { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes grow-y { from { transform: scaleY(0); } to { transform: scaleY(1); } }
@keyframes pop-in { from { opacity: 0; transform: scale(.6); } 60% { transform: scale(1.08); } to { opacity: 1; transform: none; } }
@keyframes sheet-up { from { opacity: 0; transform: translateY(24px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, 16px); } to { opacity: 1; transform: translate(-50%, 0); } }
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
@keyframes draw { from { stroke-dashoffset: 24; } to { stroke-dashoffset: 0; } }
@keyframes radar-in { from { opacity: 0; transform: scale(.2); } to { opacity: 1; transform: none; } }

/* 画面を切り替えたときだけ、画面の大きなまとまりを上から順に1回だけ表示する。
   入れ子の要素まで動かすと、外側と内側で2回ちらつくので、#content の直下だけを動かす */
#content.view-enter > * { animation: fade-up .26s cubic-bezier(.2, .7, .3, 1) both; }
#content.view-enter > :nth-child(2) { animation-delay: 40ms; }
#content.view-enter > :nth-child(3) { animation-delay: 80ms; }
#content.view-enter > :nth-child(4) { animation-delay: 120ms; }
#content.view-enter > :nth-child(n+5) { animation-delay: 160ms; }
/* 棒グラフ・進み具合のバーは伸びるように */
#content.view-enter .funnel-bar, #content.view-enter .pbar > div:not(.tgt) { transform-origin: left center; animation: grow-x .5s cubic-bezier(.2, .7, .3, 1) .1s both; }
#content.view-enter .fc-stack, #content.view-enter .cu-usage .bar { transform-origin: bottom center; animation: grow-y .5s cubic-bezier(.2, .7, .3, 1) .1s both; }
#content.view-enter .rd-val { transform-box: fill-box; transform-origin: center; animation: radar-in .5s cubic-bezier(.2, .7, .3, 1) .1s both; }

/* 押したとき・指を置いたときの反応 */
.btn, .chip-btn, .seg button, .tabs button, .bottom-nav button, .search-btn, .user-chip, .qs-item, .fab, .totop { transition: transform .12s ease, background-color .15s ease, color .15s ease, border-color .15s ease, box-shadow .15s ease; }
.btn:active, .chip-btn:active, .seg button:active, .search-btn:active, .user-chip:active, .qs-item:active { transform: scale(.97); }
.fab:active, .totop:active { transform: scale(.92); }
.bottom-nav button:active .ico { transform: scale(.9); }
.bottom-nav button .ico { transition: background .15s ease, transform .12s ease; }
@media (hover: hover) {
  .todo, .card, .sr-row, .member-card, .story, .kpi.drill-card { transition: transform .15s ease, box-shadow .15s ease; }
  .todo:hover, .sr-row:hover, .member-card:hover { transform: translateY(-1px); box-shadow: 0 6px 16px rgba(16, 24, 40, .10); }
}
.card:active, .sr-row:active, .member-card:active, .todo:active { transform: scale(.99); }

/* ヘッダー: スクロールしたら影を付ける */
.topbar { transition: box-shadow .2s ease; }
body.scrolled .topbar { box-shadow: 0 4px 14px rgba(16, 24, 40, .10); }

/* ウィンドウ・通知 */
dialog[open] { animation: sheet-up .22s cubic-bezier(.2, .8, .3, 1); }
dialog[open]::backdrop { animation: fade-in .2s ease; }
.user-menu:not([hidden]) { animation: fade-up .16s ease-out; }
.toast:not([hidden]) { animation: toast-in .22s cubic-bezier(.2, .8, .3, 1); }
.toast .ok-mark { display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; background: var(--green); margin-right: 8px; vertical-align: -5px; animation: pop-in .35s ease-out both; }
.toast .ok-mark svg { width: 13px; height: 13px; fill: none; stroke: #fff; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 24; animation: draw .3s ease-out .15s both; }
.qs-group { animation: fade-in .18s ease-out; }
details.story[open] > :not(summary) { animation: fade-up .22s ease-out both; }

/* 読み込み中 */
.loading { display: inline-block; color: transparent !important; border-radius: 6px; min-width: 9em; min-height: 1em;
  background: linear-gradient(90deg, var(--surface-2) 25%, var(--border) 50%, var(--surface-2) 75%); background-size: 200% 100%; animation: shimmer 1.2s linear infinite; }
li.loading { display: block; height: 3.2em; margin: 4px 0; list-style: none; }

/* 動きを減らす設定の端末では動かさない */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 1ms !important; animation-delay: 0ms !important; animation-iteration-count: 1 !important; transition-duration: 1ms !important; }
  .loading { animation: none; }
}

/* ---------- ヘルプ: マニュアルボタン・さくら ---------- */
.help-btn { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--border); background: var(--surface-2); color: var(--muted);
  border-radius: 20px; padding: 7px 12px; cursor: pointer; font: inherit; font-weight: 600; white-space: nowrap; }
.help-btn:hover { color: var(--text); }
@media (max-width: 1280px) { .help-btn span { display: none; } .help-btn { padding: 8px; } }
/* スマホでも「?」を上部バーに出す(Hiro 2026-10-25「携帯は「?」のメニューがないの?」)。形は末尾のスマホの上部バー */
@media (max-width: 760px) { .help-btn.admin-btn { display: none !important; } }  /* ⚙(管理)はスマホでは名前のメニューの「管理」から */

/* さくらのボタン: 左下(＋ と ↑ は右下なので重ならない) */
.butler-fab { position: fixed; left: 24px; bottom: 24px; z-index: 31; width: 60px; height: 60px; padding: 0; border-radius: 50%;
  border: 3px solid #fff; background: #e9eef7; cursor: pointer; box-shadow: 0 6px 18px rgba(0, 47, 123, .35);
  transition: transform .15s, opacity .2s; }
.butler-fab .butler-svg { display: block; width: 100%; height: 100%; border-radius: 50%; }
.butler-fab:hover { transform: translateY(-2px) rotate(-4deg); }
.butler-fab.active { outline: 3px solid var(--primary); outline-offset: 2px; }
.butler-tip { position: absolute; left: 66px; top: 50%; transform: translateY(-50%); background: var(--primary); color: var(--on-primary); font-size: .7812rem; font-weight: 700;
  padding: 4px 10px; border-radius: 12px; white-space: nowrap; pointer-events: none; opacity: 0; transition: opacity .15s; }
.butler-fab:hover .butler-tip { opacity: 1; }
.butler-fab.active .butler-tip { display: none; }
@media (min-width: 761px) { .butler-fab { left: max(24px, calc((100vw - 1400px) / 2 - 76px)); } }

.butler-panel { position: fixed; right: 24px; top: 76px; z-index: 32; width: var(--bw, min(460px, calc(100vw - 48px))); height: var(--bh, min(720px, calc(100vh - 100px)));
  display: flex; flex-direction: column; background: var(--surface); color: var(--text); border: 1px solid var(--border); border-radius: 16px;
  box-shadow: 0 18px 48px rgba(16, 24, 40, .25); overflow: hidden; }
.butler-panel[hidden] { display: none; }
/* 最大化: 画面いっぱい(読みやすい幅まで) */
.butler-panel.large { width: min(960px, calc(100vw - 48px)); height: auto; top: 24px; bottom: 24px; }
/* PC も浮いたボタンは置かず(カードに重なるため)、上部バーのさくら(#butler-top)から開く */
.butler-fab { display: none !important; }
/* 「さくらに聞く」: 吹き出しの形(左下だけ角を立てる)と青の地で、利用者のアイコンと見分けがつくようにする */
#butler-top.butler-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; box-sizing: border-box; height: 40px; padding: 0 11px 0 4px;
  border: 1.5px solid var(--primary); border-radius: 20px 20px 20px 5px; background: var(--primary-soft); color: var(--primary);
  font: inherit; font-size: .875rem; font-weight: 700; line-height: 1; white-space: nowrap; cursor: pointer; flex: none; }
#butler-top .butler-svg { display: block; width: 28px; height: 28px; border-radius: 50%; flex: none; }
#butler-top.butler-btn { position: relative; }
#butler-top .ai-tag { position: absolute; right: -5px; top: -6px; font-size: .5625rem; font-weight: 800; letter-spacing: .04em; padding: 1px 3px; border-radius: 4px; background: var(--primary); color: var(--on-primary); line-height: 1.2; }
#butler-top:hover { filter: brightness(.97); box-shadow: 0 0 0 2px var(--primary-soft); }
#butler-top.active { background: var(--primary); color: var(--on-primary); }
#butler-top.active .ai-tag { background: #fff; color: var(--primary); }
@media (prefers-color-scheme: dark) { #butler-top.active .ai-tag { color: #10244a; } }
/* メニューが入りきらないとき(help.js が .butler-compact を付ける)と狭い画面では、文字を省いて吹き出しの中にさくらだけを出す */
#butler-top.butler-btn.butler-compact { width: 44px; padding: 0; gap: 0; }
/* 「さくらに聞く」はアイコンだけ(吹き出しの形と AI の印で見分ける。文字はマウスを乗せると出る)。高さ・幅はほかの丸いボタンと同じ 40px(Hiro 2026-10-24) */
@media (min-width: 761px) {
  #butler-top.butler-btn { width: 40px; padding: 0; gap: 0; }
  #butler-top .butler-svg { width: 30px; height: 30px; }
  #butler-top .butler-label { display: none; }
}
#butler-top.butler-compact .butler-svg { width: 32px; height: 32px; }
#butler-top.butler-compact .butler-label { display: none; }
@media (max-width: 1100px) {
  #butler-top.butler-btn { width: 40px; padding: 0; gap: 0; }
  #butler-top .butler-svg { width: 30px; height: 30px; }
  #butler-top .butler-label { display: none; }
}
/* 動かした後(help.js が .placed と --bx/--by を付ける): 覚えた場所に置く */
.butler-panel.placed { left: var(--bx); top: var(--by); right: auto; bottom: auto; }
.butler-panel.large .butler-grip { display: none; }
.butler-panel.resizing, .butler-panel.moving { user-select: none; }
.butler-panel.moving { box-shadow: 0 24px 64px rgba(16, 24, 40, .32); }
/* 見出しをつかんで移動(ボタンと顔は除く) */
.butler-head { cursor: grab; touch-action: none; }
.butler-panel.moving .butler-head { cursor: grabbing; }
.butler-head button { cursor: pointer; }
/* 四辺と四隅: 見えない 6px の帯と 18px の角(角は丸いので、内側まで広めに取る) */
.butler-grip { position: absolute; z-index: 2; touch-action: none; }
.butler-grip.g-n { left: 18px; right: 18px; top: 0; height: 6px; cursor: ns-resize; }
.butler-grip.g-s { left: 18px; right: 18px; bottom: 0; height: 6px; cursor: ns-resize; }
.butler-grip.g-e { top: 18px; bottom: 18px; right: 0; width: 6px; cursor: ew-resize; }
.butler-grip.g-w { top: 18px; bottom: 18px; left: 0; width: 6px; cursor: ew-resize; }
.butler-grip.g-ne { top: 0; right: 0; width: 18px; height: 18px; cursor: nesw-resize; }
.butler-grip.g-sw { bottom: 0; left: 0; width: 18px; height: 18px; cursor: nesw-resize; }
.butler-grip.g-nw { top: 0; left: 0; width: 18px; height: 18px; cursor: nwse-resize; }
.butler-grip.g-se { bottom: 0; right: 0; width: 18px; height: 18px; cursor: nwse-resize; }
#butler-size .shrink, #butler-size[aria-pressed="true"] .grow { display: none; }
#butler-size[aria-pressed="true"] .shrink { display: inline; }
.butler-head { display: flex; align-items: center; gap: 10px; padding: 10px 10px 10px 14px; background: var(--primary); color: var(--on-primary); }
@media (prefers-color-scheme: dark) { .butler-head { background: #10244a; } }
.butler-avatar { width: 40px; height: 40px; flex: none; border-radius: 50%; border: 2px solid #fff; overflow: hidden; }
.butler-avatar .butler-svg { display: block; width: 100%; height: 100%; }
.butler-title { display: grid; line-height: 1.3; margin-right: auto; min-width: 0; }
.butler-title b { font-size: .9375rem; }
.butler-title span { font-size: .75rem; opacity: .85; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.butler-icon-btn { width: 36px; height: 36px; flex: none; display: grid; place-items: center; border: 0; border-radius: 50%; background: transparent; color: #fff; cursor: pointer; }
.butler-icon-btn:hover { background: rgba(255, 255, 255, .16); }
.butler-icon-btn .i { width: 20px; height: 20px; }
.butler-log { flex: 1; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 10px; background: var(--bg); overscroll-behavior: contain; }
.b-msg { display: flex; }
.b-msg.me { justify-content: flex-end; }
/* さくらの答え: 左上に小さなアイコン(だれの答えかわかるように) */
.b-msg.bot { gap: 8px; align-items: flex-start; }
.b-ava { flex: none; width: 28px; height: 28px; margin-top: 2px; }
.b-ava .butler-svg { display: block; width: 100%; height: 100%; border-radius: 50%; }
.b-msg.bot .b-bubble { min-width: 0; }
@media (max-width: 760px) { .b-msg.bot { gap: 6px; } .b-ava { width: 24px; height: 24px; } }
.b-bubble { max-width: 88%; padding: 9px 13px; border-radius: 14px; font-size: .875rem; line-height: 1.65; overflow-wrap: anywhere; }
.b-msg.bot .b-bubble { background: var(--surface); border: 1px solid var(--border); border-top-left-radius: 4px; }
.b-msg.me .b-bubble { background: var(--primary); color: var(--on-primary); border-top-right-radius: 4px; }
@media (prefers-color-scheme: dark) { .b-msg.me .b-bubble { background: #24447e; } }
.b-msg.err .b-bubble { background: var(--red-soft); color: var(--red); border-color: transparent; }
.butler-links { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.butler-link { display: inline-flex; align-items: center; min-height: 32px; padding: 4px 10px; border-radius: 16px; border: 1px solid var(--border);
  background: var(--primary-soft); color: var(--primary); font: inherit; font-size: .8125rem; font-weight: 600; text-decoration: none; cursor: pointer; }
.butler-link:hover { border-color: var(--primary); }
.butler-inline { display: inline; padding: 0 2px; margin: 0 1px; border: 0; background: none; color: var(--primary); font: inherit; font-weight: 700;
  text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.butler-chips { display: flex; flex-wrap: wrap; gap: 6px; padding-left: 4px; }
.butler-chips button { border: 1px solid var(--primary); background: var(--surface); color: var(--primary); border-radius: 16px; padding: 6px 12px;
  font: inherit; font-size: .8125rem; cursor: pointer; min-height: 36px; }
.butler-chips button:hover { background: var(--primary-soft); }
.b-bubble.typing { display: flex; align-items: center; gap: 4px; color: var(--muted); }
.b-bubble.typing span { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); animation: butler-dot 1.2s infinite ease-in-out; }
.b-bubble.typing span:nth-child(2) { animation-delay: .15s; }
.b-bubble.typing span:nth-child(3) { animation-delay: .3s; }
.b-bubble.typing em { font-style: normal; font-size: .8125rem; margin-left: 6px; }
@keyframes butler-dot { 0%, 80%, 100% { opacity: .25; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }
@media (prefers-reduced-motion: reduce) { .b-bubble.typing span { animation: none; } }
.butler-form { display: flex; gap: 8px; align-items: flex-end; padding: 10px 12px 4px; border-top: 1px solid var(--border); background: var(--surface); }
.butler-form textarea { flex: 1; resize: none; min-height: 42px; max-height: 120px; font: inherit; font-size: .9375rem; line-height: 1.5; padding: 9px 12px;
  border: 1px solid var(--border); border-radius: 12px; background: var(--surface); color: var(--text); }
.butler-form .btn { width: 44px; height: 42px; padding: 0; display: grid; place-items: center; border-radius: 12px; flex: none; }
.butler-form .btn .i { width: 20px; height: 20px; }
.butler-note { margin: 0; padding: 2px 12px 10px; font-size: .6875rem; color: var(--muted); background: var(--surface); }

@media (max-width: 760px) {
  /* スマホ: 浮いたボタンは出さず、上部バーのアイコン(#butler-top)から開く */
  .butler-tip { display: none; }
  #butler-top.butler-btn { width: 44px; height: 44px; border-radius: 22px 22px 22px 6px; overflow: visible; }
  #butler-top .butler-svg { width: 34px; height: 34px; }
  .butler-panel, .butler-panel.large, .butler-panel.placed { inset: 0; width: auto; height: auto; border-radius: 0; border: 0; z-index: 40;
    padding-top: env(safe-area-inset-top); padding-bottom: env(safe-area-inset-bottom); }
  body.butler-open { overflow: hidden; }
  .butler-head { cursor: default; touch-action: auto; }
  .butler-grip, #butler-size { display: none; }  /* スマホは常に全画面 */
  body.butler-open .butler-fab { display: none; }
  .butler-form textarea { font-size: 1rem; } /* iOS で入力時に拡大されないように */
}
@media print { .butler-fab, .butler-panel, .help-btn { display: none !important; } }

/* PC: 上部バーのボタン(検索・マニュアル・新しい案件・利用者)は高さ・角丸・余白をそろえる */
@media (min-width: 761px) {
  .topbar-right { gap: 8px; }
  .topbar-right > .search-btn, .topbar-right > .help-btn, .topbar-right > #new-deal-btn, .topbar-right > #log-btn, .topbar-right > .user-chip {
    box-sizing: border-box; height: 40px; min-height: 40px; padding: 0 14px; border-radius: 20px;
    display: inline-flex; align-items: center; justify-content: center; gap: 6px; font-size: .875rem; font-weight: 600; line-height: 1; white-space: nowrap;
  }
  .topbar-right > .search-btn .i, .topbar-right > .help-btn .i { width: 18px; height: 18px; flex: none; }
  /* メニューの項目(選んでいる画面の背景)も右のボタンと同じ高さ・丸みにそろえる(Hiro 2026-10-24) */
  .tabs button { box-sizing: border-box; height: 40px; padding-top: 0; padding-bottom: 0; border-radius: 20px; }
  .search-btn kbd { font: 600 11px/1 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; height: 20px; box-sizing: border-box; display: inline-flex; align-items: center; padding: 0 6px; margin-right: -6px; color: var(--muted); }
}

/* 新しい版・更新情報のお知らせ(上部バーのメニューに重ならないよう、バーのすぐ下に出す) */
.update-bar { position: fixed; left: 50%; top: calc(var(--topbar-h, 64px) + 8px); transform: translateX(-50%); z-index: 50; display: flex; align-items: center; gap: 8px;
  width: max-content; max-width: calc(100vw - 24px); padding: 8px 8px 8px 16px; border-radius: 12px; background: var(--primary); color: var(--on-primary);
  box-shadow: 0 8px 24px rgba(16, 24, 40, .25); }
.update-bar .update-text { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.update-bar .btn { background: #fff; color: var(--primary); border-color: #fff; flex: none; }
.update-close { flex: none; width: 32px; height: 32px; border: 0; border-radius: 50%; background: transparent; color: #fff; font-size: 20px; cursor: pointer; }
.update-close:hover { background: rgba(255, 255, 255, .16); }
@media (prefers-color-scheme: dark) { .update-bar { background: #24447e; color: #fff; } .update-bar .btn { color: #24447e; } }
@media (max-width: 760px) {
  .update-bar { top: auto; bottom: calc(76px + env(safe-area-inset-bottom)); flex-wrap: wrap; width: calc(100vw - 24px); }
  .update-bar .update-text { flex-basis: calc(100% - 40px); white-space: normal; }
  .update-bar .btn { flex: 1; }
}
@media print { .update-bar { display: none !important; } }
/* 更新情報 */
.menu-new { margin-left: 8px; padding: 1px 6px; border-radius: 8px; background: var(--red); color: #fff; font-size: .6875rem; font-weight: 700; vertical-align: 1px; }
.user-chip { position: relative; }
.user-chip.has-new::after { content: ""; position: absolute; top: 5px; right: 7px; width: 8px; height: 8px; border-radius: 50%; background: var(--red); }
.up-list { display: grid; gap: 12px; }
.up-day { margin: 12px 0 0; font-size: .8125rem; color: var(--muted); font-weight: 700; }
.up-item { border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 16px; background: var(--surface); }
.up-item.fresh { border-color: var(--primary); box-shadow: inset 4px 0 0 var(--primary); }
.up-item h4 { margin: 0 0 6px; font-size: .9688rem; line-height: 1.5; }
.up-item ul { margin: 0; padding-left: 1.2em; display: grid; gap: 4px; line-height: 1.7; }
.up-links { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 8px; }
.up-links a { color: var(--primary); font-size: .8438rem; font-weight: 600; text-decoration: none; }
.up-links a:hover { text-decoration: underline; }
.up-new { display: inline-block; margin-right: 8px; padding: 0 7px; border-radius: 8px; background: var(--red); color: #fff; font-size: .7188rem; vertical-align: 2px; }
/* スマホ: 狭い画面(320px)でもカードが横にはみ出さない */
@media (max-width: 760px) {
  .todo, .todo.mtg-row { grid-template-columns: minmax(0, 1fr); min-width: 0; }
  .todo > * { min-width: 0; }
  .todo-buttons { flex-wrap: wrap; }
  .todo-buttons .btn { flex: 1 1 auto; min-width: 0; }
}
/* 長いラベル(段階・状況)は、収まらないときだけ語の区切りで折り返す */
.badge { white-space: normal; max-width: 100%; }
@media (max-width: 360px) {
  .bottom-nav button { font-size: .6562rem; letter-spacing: -.04em; padding-left: 0; padding-right: 0; }
  .bottom-nav button .ico { width: 40px; }
}

/* ---------- 余白(ホワイトスペース)の段階: 4 / 8 / 12 / 16 / 24 / 32px ----------
   画面の大きなまとまりの間は 24px(スマホ 16px)、同じまとまりの中の要素は 12px、カード同士は 12px、
   カードの内側は 16〜20px。見出しと本文の間は 12px。個々の margin ではなく、並べる側の gap でそろえる */
:root { --sp-1: 4px; --sp-2: 8px; --sp-3: 12px; --sp-4: 16px; --sp-5: 24px; --sp-6: 32px; --sp-block: var(--sp-5); }
@media (max-width: 760px) { :root { --sp-block: var(--sp-4); } }
main { padding-top: var(--sp-5); }
#content { display: flex; flex-direction: column; gap: var(--sp-block); }
#content > * { margin-top: 0; margin-bottom: 0; }
/* 検索欄の下の絞り込み・見出しは同じまとまりなので詰める */
#content > :is(.cu-tabs, .sr-bar, .sr-presets, .seg) + :is(.sr-bar, .seg, .sr-label, .sr-head) { margin-top: calc(var(--sp-3) - var(--sp-block)); }
#content > .sr-label + .sr-presets { margin-top: calc(var(--sp-2) - var(--sp-block)); }
#content > .crumbs + * { margin-top: calc(var(--sp-3) - var(--sp-block)); }
.panel { padding: 20px; margin-bottom: var(--sp-block); }
.panel:last-child, .cu-grid > .panel, .cu-side > .panel, .fc-grid > .panel { margin-bottom: 0; }
.panel h2 { margin-bottom: var(--sp-3); }
.panel h2 + p.muted, .panel h2 + .muted { margin-top: calc(var(--sp-1) - var(--sp-3)); margin-bottom: var(--sp-3); }
.panel > .fc-head { margin-bottom: var(--sp-3); }
.section-title { margin: var(--sp-5) 0 var(--sp-3); }
#content > .section-title { margin: 0 0 calc(var(--sp-3) - var(--sp-block)); }
.todo-section h2 { margin-bottom: var(--sp-3); }
.todo-list, .sr-list { gap: var(--sp-3); }
.todo-buttons { gap: var(--sp-2); }
.member-grid, .kpis, .ex-kpis, .fc-top, .summary-strip:not(.stuck), .cu-side { gap: var(--sp-4); }
.board { gap: var(--sp-3); }
.cu-grid, .fc-grid { gap: var(--sp-block); }
.cu-dates { gap: var(--sp-2); }
.seg { margin: 0; gap: var(--sp-2); }
.panel .seg { margin: var(--sp-2) 0 var(--sp-3); }
.sr-presets { gap: var(--sp-2); }
.sr-head { margin: 0; }
.page-head { gap: var(--sp-3); }
.btn-row { gap: var(--sp-2); }
@media (max-width: 760px) {
  main { padding-top: var(--sp-4); }
  .panel { padding: var(--sp-4); }
  .todo-list, .sr-list { gap: var(--sp-3); }
  .member-grid, .kpis, .ex-kpis, .fc-top, .summary-strip:not(.stuck), .cu-side { gap: var(--sp-3); }
}

/* パイプラインの列見出し: マニュアルの業務フローと同じ矢羽根(新規獲得=青、参加開始・担当引継=緑、オンボーディング=橙、失注・脱会は矢羽根にしない) */
.board .column-head { position: relative; margin: -8px -8px var(--sp-2); padding: 8px calc(var(--chev) + 10px) 8px calc(var(--chev) + 12px);
  background: var(--primary-soft); color: var(--primary);
  clip-path: polygon(0 0, calc(100% - var(--chev)) 0, 100% 50%, calc(100% - var(--chev)) 100%, 0 100%, var(--chev) 50%);
  border-radius: var(--radius) var(--radius) 0 0; }
.board .column:first-child .column-head { padding-left: 12px; clip-path: polygon(0 0, calc(100% - var(--chev)) 0, 100% 50%, calc(100% - var(--chev)) 100%, 0 100%); }
.board .column-head .name { color: inherit; font-size: .875rem; }
.board .column-head .name span:last-child { font-variant-numeric: tabular-nums; }
.board .column-head .sum { color: var(--muted); font-size: .75rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.board-onb .column-head { background: var(--orange-soft); color: var(--orange); }
.board .column.won .column-head { background: var(--green-soft); color: var(--green); }
/* 失注・対象外/脱会: フローの外なので、矢羽根ではなく落ち着いた見出し */
.board .column.lost .column-head { clip-path: none; padding: 8px 12px; background: var(--gray-soft); color: var(--muted); }
@media (max-width: 760px) {
  .board .column:not(:first-child) .column-head { padding-left: calc(var(--chev) + 12px); }
}
/* 見出しは省略せず語の区切りで折り返し、全列の見出しの高さをそろえる(subgrid) */
.board .column-head .name span:first-child { white-space: normal; overflow: visible; }
.board .column-head .sum { white-space: normal; }
@media (min-width: 761px) {
  /* 列はすべて同じ幅で画面いっぱいに並べ、収まらない幅では横にスクロール */
  .board { grid-template-rows: auto minmax(0, 1fr); grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: minmax(160px, 1fr); overflow-x: auto; }
  .board .column { display: grid; grid-row: span 2; grid-template-rows: subgrid; row-gap: 0; }
  .board .column-head { display: flex; flex-direction: column; justify-content: center; }
}

/* PC: 上部バーはメニュー(タブ)が切れないよう、入りきらないときだけ段階的に省略する。
   app.js の fitHeader() が、入りきるまで .hc1 → .hc12 を順に付ける(ボタンが増えても幅を決め打ちしない)
   1: メニューのアイコンと Ctrl K / 2: (なし。チュートリアルは「?」のメニューに入れた) / 3: マニュアル→アイコン / 4: 検索→アイコン / 5: 「営業管理システム」の文字
   6: 役職タグ / 7: さくらに聞く→アイコン / 8: 新しい案件→＋(一番大事なので最後まで文字を残す) / 9: ロゴはマークだけ
   10: メニューを短い名前に(パイプライン→案件 など) / 11: 区切り線を外す / 12: それでも入らなければメニューを横スクロール */
@media (min-width: 761px) {
  /* メニューは必要な幅だけ取り、「新しい案件」をそのすぐ右に置く。検索などの道具と利用者は右端へ寄せる */
  .tabs { overflow: hidden; flex: 0 1 auto; min-width: 0; }
  /* ロゴは縮めない(縮むと左端で切れてもはみ出しとして見つからず、省略の段階が進まなかった) */
  .topbar > .brand { flex-shrink: 0; }
  .topbar-right { flex: 1 0 auto; }
  .topbar.hc1 .tabs .ico { display: none; }
  .topbar.hc1 .tabs button { padding: 8px 9px; }
  .topbar.hc1 .search-btn kbd { display: none; }
  .topbar.hc3 .topbar-right > #help-btn span, .topbar.hc3 .topbar-right > #admin-btn span { display: none; }
  .topbar.hc3 .topbar-right > #help-btn, .topbar.hc3 .topbar-right > #admin-btn { width: 40px; padding: 0; }
  .topbar.hc4 .topbar-right > .search-btn span { display: none; }
  .topbar.hc4 .topbar-right > .search-btn { width: 40px; padding: 0; }
  .topbar.hc5 .brand .brand-name { display: none; }
  .topbar.hc6 .user-chip .role-tag { display: none; }
  .topbar.hc6 .tabs button { padding: 8px 7px; }
  .topbar.hc6 { gap: 8px; }
  .topbar.hc6 .user-chip { max-width: 170px; }
  .topbar.hc7 .user-chip .avatar { display: none; }
  .topbar.hc8 .topbar-right > #new-deal-btn { display: none; }
  .topbar.hc8 .top-icon#new-deal-top { display: grid; place-items: center; width: 40px; height: 40px; padding: 0; border-radius: 50%; border: 0; background: var(--primary); color: var(--on-primary); cursor: pointer; }
  .topbar.hc8 .top-icon#new-deal-top .i { width: 20px; height: 20px; }
  .topbar.hc9 .brand .logo-full { display: none; }
  .topbar.hc9 .brand .logo-mark { display: block; }
  .topbar.hc9 .tabs button { padding: 8px 5px; font-size: .875rem; }
  .tabs .lbl-short { display: none; }
  .topbar.hc10 .tabs .lbl-full { display: none; }
  .topbar.hc10 .tabs .lbl-short { display: inline; }
  .topbar.hc11 .topbar-right > .tb-sep { display: none; }
  .topbar.hc11 .topbar-right > .user-chip { margin-left: 0; }
  /* 事業の切り替え(AM / MC)も詰める */
  .topbar.hc6 .biz-seg button { padding: 3px 8px; }
  .topbar.hc11 .biz-seg { padding: 2px; }
  .topbar.hc11 .biz-seg button { padding: 3px 6px; }
  .topbar.hc11 .user-chip { max-width: 120px; }
  /* それでも入りきらないときは、メニューを横スクロールにして重ならないようにする(右端は薄くして続きがあることを示す) */
  .topbar.hc12 .tabs { overflow-x: auto; scrollbar-width: none; -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 24px), transparent); mask-image: linear-gradient(90deg, #000 calc(100% - 24px), transparent); }
  .topbar.hc12 .tabs::-webkit-scrollbar { display: none; }
  /* 右側のまとまり: [新しい案件] | [検索・さくらに聞く・「?」・ベル・⚙(小さな間隔)] [利用者] */
  .topbar-right > .tb-sep { width: 1px; height: 24px; background: var(--border); margin: 0 auto 0 4px; flex: none; }
  .topbar-right > .help-btn + .help-btn { margin-left: -4px; }
  .topbar-right > .user-chip { margin-left: 4px; }
  /* 2本指で拡大しているときは、見えている範囲に中身を寄せる(app.js syncVisibleBar) */
  .topbar { padding-left: calc(20px + var(--vv-l, 0px)); padding-right: calc(20px + var(--vv-r, 0px)); top: var(--vv-t, 0px); }
}
@media (max-width: 760px) { .topbar-right > .tb-sep { display: none; } }

/* 件数パネル・件数のセル: 押すと明細の一覧を開く(0件は押せない) */
[data-kpi-list] { cursor: pointer; }
/* パネル全体が押せる。「一覧 ›」は行を増やさず右上に置く */
.kpi[data-kpi-list] { position: relative; }
.kpi[data-kpi-list]::after { content: "一覧 ›"; position: absolute; top: var(--sp-3); right: var(--sp-4); font-size: .75rem; font-weight: 700; color: var(--primary); }
.kpi[data-kpi-list] > .lbl { padding-right: 3.5em; }
.kpi[data-kpi-list]:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
td[data-kpi-list] { color: var(--primary); text-decoration: underline; text-decoration-color: rgba(0, 47, 123, .35); text-underline-offset: 3px; }
@media (hover: hover) {
  .kpi[data-kpi-list] { transition: transform .15s ease, box-shadow .15s ease; }
  .kpi[data-kpi-list]:hover { transform: translateY(-1px); box-shadow: 0 6px 16px rgba(16, 24, 40, .10); }
  td[data-kpi-list]:hover { background: var(--primary-soft); }
}
dialog.wide-modal { width: min(1080px, 96vw); max-width: 96vw; }
.kpi-list td { vertical-align: middle; }

/* 集計パネル(.kpis): 項目名の下に「件数 + 補足」を横に並べた2段にして、高さを抑える */
.kpis > .kpi { display: flex; flex-wrap: wrap; align-items: baseline; align-content: flex-start; column-gap: var(--sp-2); padding: var(--sp-3) var(--sp-4); }
.kpis > .kpi > .lbl { flex: 1 0 100%; line-height: 1.4; }
.kpis > .kpi > .num { font-size: 1.375rem; line-height: 1.25; letter-spacing: -.01em; }
.kpis > .kpi > .small { min-width: 0; line-height: 1.35; }
.kpi .lbl .short { display: none; }

/* 画面上部(絞り込み + 集計パネル)をスクロールしてもヘッダーの直下に固定する。固定中は1行ずつに縮める */
.sticky-top { position: sticky; top: var(--topbar-h, 64px); z-index: 5; background: var(--bg); display: flex; flex-direction: column; gap: var(--sp-4); }
.sticky-top > * { margin: 0; }
.sticky-top.stuck { gap: var(--sp-2); padding: var(--sp-2) 0; box-shadow: -24px 0 0 var(--bg), 24px 0 0 var(--bg), 0 6px 8px -6px rgba(15, 23, 42, .18); clip-path: inset(0 -24px -16px -24px); }
.sticky-top.stuck .page-head p { display: none; }
.sticky-top.stuck .page-head { justify-content: flex-end; }
.sticky-top.stuck .page-head > div:first-child { display: none; }
.sticky-top.stuck .filters select, .sticky-top.stuck .filters .btn { min-height: 0; padding-top: 4px; padding-bottom: 4px; font-size: .8125rem; }
.sticky-top.stuck .kpis { gap: var(--sp-2); }
.sticky-top.stuck .kpis > .kpi { flex-wrap: nowrap; align-items: center; padding: 6px 12px; box-shadow: none; border: 1px solid var(--border); }
.sticky-top.stuck .kpis > .kpi > .lbl { flex: 1 1 auto; min-width: 0; padding-right: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sticky-top.stuck .kpis > .kpi > .num { font-size: 1.125rem; order: 2; }
.sticky-top.stuck .kpis > .kpi > .small, .sticky-top.stuck .kpi[data-kpi-list]::after { display: none; }
.sticky-top.stuck .kpi .lbl .full { display: none; }
.sticky-top.stuck .kpi .lbl .short { display: inline; }
@media (max-width: 760px) {
  .kpis > .kpi { padding: var(--sp-2) var(--sp-3); }
  .kpis > .kpi > .num { font-size: 1.25rem; }
  .kpis > .kpi > .lbl { font-size: .75rem; }
  .kpi[data-kpi-list]::after { content: "›"; top: var(--sp-2); right: var(--sp-3); font-size: 1rem; line-height: 1; }
  .kpi[data-kpi-list] > .lbl { padding-right: 1.2em; }
  /* スマホの固定中は絞り込みを隠し、4枚を等分して「件数 / 項目名」の2段にする */
  .sticky-top.stuck { padding: 6px 0; box-shadow: -16px 0 0 var(--bg), 16px 0 0 var(--bg), 0 6px 8px -6px rgba(15, 23, 42, .18); clip-path: inset(0 -16px -16px -16px); }
  .sticky-top.stuck .page-head { display: none; }
  .sticky-top.stuck .kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px; }
  .sticky-top.stuck .kpis > .kpi { flex-direction: column; align-items: center; justify-content: center; padding: 3px 2px; line-height: 1.15; text-align: center; min-width: 0; }
  .sticky-top.stuck .kpis > .kpi > .num { font-size: 1.0625rem; order: 0; line-height: 1.15; }
  .sticky-top.stuck .kpis > .kpi > .lbl { order: 1; flex: 0 0 auto; max-width: 100%; font-size: .6875rem; }
}
.kpi-list td:last-child { min-width: 14em; }

/* ---------- 売上(金額)の目標・実績・着地見込み ---------- */
.rev-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.rev-row.one { grid-template-columns: minmax(0, 1fr); max-width: 560px; }
.rev-card .rev-main { display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; }
.rev-card .rev-main small { font-size: .8125rem; color: var(--muted); font-weight: 700; }
.rev-rate { margin-left: auto; font-size: .8125rem; font-weight: 700; }
.rev-gap { margin-top: 8px; }
.rev-pace { margin-top: 6px; color: var(--muted); }
.rev-pace b { color: var(--text); }
.rev-pace b.down { color: var(--red); }
.rev-pace b.up { color: var(--green); }
.sw.tg { background: var(--red); width: 3px; border-radius: 1px; }
.section-title.first { margin-top: 0; }
.fc-target { margin-top: 4px; }
.rt-annual { display: flex; align-items: flex-end; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.rt-annual label { flex: 1; min-width: 160px; }
.rt-annual .btn { margin-bottom: 14px; }
.rt-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 12px; }
.rt-q { border: 1px solid var(--border); border-radius: 8px; padding: 4px 10px 0; margin: 0; min-width: 0; }
.rt-q legend { font-weight: 700; font-size: .8125rem; padding: 0 4px; }
.rt-in { display: flex; align-items: center; gap: 6px; }
.rt-in input { flex: 1; min-width: 0; }
@media (max-width: 1100px) { .rev-row { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 760px) {
  .rev-row { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .rt-grid { grid-template-columns: minmax(0, 1fr); }
}
.rt-q label { display: grid; grid-template-columns: 2.6em minmax(0, 1fr); align-items: center; gap: 6px; margin: 0 0 6px; }
.rt-q label input { margin: 0; }
.fc-q.fy .up, .fc-q.fy .down { color: var(--on-primary); }
/* 関係者の履歴 */
.ph-axis, .ph-row { display: grid; grid-template-columns: minmax(0, 300px) minmax(0, 1fr); gap: 4px 16px; align-items: center; }
.ph-ticks { position: relative; height: 16px; }
.ph-tick { position: absolute; transform: translateX(-50%); font-size: .6875rem; color: var(--muted); }
.ph-tick.first { left: 0; transform: none; }
.ph-side { font-size: .8125rem; margin: 16px 0 4px; color: var(--muted); }
.ph-row { padding: 8px 0; border-top: 1px solid var(--border); }
.ph-who { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; min-width: 0; }
.ph-who > div { flex-basis: 100%; }
.ph-row.past .ph-who b { color: var(--muted); }
.ph-track { position: relative; height: 12px; border-radius: 6px; background: var(--bg); }
.ph-grid { position: absolute; top: -4px; bottom: -4px; border-left: 1px dashed var(--border); }
.ph-bar { position: absolute; top: 0; bottom: 0; border-radius: 6px; background: #9fb3d1; }
.ph-bar.ours.now { background: var(--primary, #0b3a7e); }
.ph-bar.theirs { background: #c8b28a; }
.ph-bar.theirs.now { background: #b07d2b; }
.ph-bar.approx { opacity: .5; }
.ph-touched { display: flex; flex-wrap: wrap; gap: 8px; }
.ph-chip { font-size: .75rem; padding: 4px 8px; border: 1px solid var(--border); border-radius: 999px; }
@media (max-width: 700px) {
  .ph-axis { display: none; }
  .ph-row { grid-template-columns: minmax(0, 1fr); }
}

/* 顧客ニュース(カルテ・アクション・週次MTG) */
.news-list { display: grid; gap: 12px; }
.news-card { border: 1px solid var(--border); border-left: 4px solid var(--border); border-radius: var(--radius); padding: 12px 16px; background: var(--surface); display: grid; gap: 8px; }
.news-card.use-chance { border-left-color: var(--green); }
.news-card.use-caution { border-left-color: var(--red); }
.news-card.use-talk { border-left-color: var(--primary); }
.news-card.dismissed { opacity: .7; }
.news-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.news-title { font-weight: 700; font-size: .9375rem; line-height: 1.5; }
.news-why { display: flex; gap: 8px; align-items: flex-start; background: var(--surface-2); border-radius: 8px; padding: 8px 12px; font-size: .875rem; }
.news-why .i { flex: none; margin-top: 2px; color: var(--green); }
.news-script summary { cursor: pointer; font-size: .8125rem; color: var(--primary); font-weight: 700; }
.news-script p { margin: 8px 0 0; padding: 8px 12px; border-radius: 8px; background: var(--primary-soft); font-size: .875rem; }
.news-actions { display: grid; gap: 8px; }
.news-act { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding-top: 8px; border-top: 1px dashed var(--border); font-size: .875rem; }
.news-act .txt { flex: 1 1 200px; }
.news-act .txt .muted { margin-left: 4px; }
.news-foot { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
.news-hidden { margin-top: 12px; }
.news-hidden summary { cursor: pointer; }
.news-hidden .news-list { margin-top: 8px; }
#sec-news .news-list { margin-top: 4px; }
.mtg-sec .mtg-grid + .todo-list { margin-top: 16px; }

/* 経営報告: 担当別 ⇔ 顧客別 */
#content > .xc-toggle + * { margin-top: calc(var(--sp-3) - var(--sp-block)); }
.xc-toggle { align-self: flex-start; }
.xc-search { max-width: 360px; margin-bottom: var(--sp-3); }
.xc-table td:first-child { white-space: normal; min-width: 12em; }

/* 画面は丸ごと描き直すので、ブラウザのスクロール位置の自動補正は使わない(「戻る」で元の位置に戻すため) */
#content { overflow-anchor: none; }

/* ---------- はじめてのチュートリアル・この画面でできること(tour.js) ---------- */
.tour-layer { position: fixed; inset: 0; z-index: 1000; pointer-events: none; }
/* 照らす場所以外を暗くする。押す操作はそのまま下の画面に届く */
.tour-hole { position: fixed; border-radius: 12px; box-shadow: 0 0 0 200vmax rgba(10, 15, 25, .5); outline: 3px solid #fff; outline-offset: 0;
  transition: left .2s ease, top .2s ease, width .2s ease, height .2s ease; animation: tour-ring 1.6s ease-out infinite; }
@keyframes tour-ring { 0% { outline-color: rgba(255,255,255,1); outline-offset: 0; } 70% { outline-color: rgba(255,255,255,0); outline-offset: 10px; } 100% { outline-color: rgba(255,255,255,0); outline-offset: 10px; } }
.tour-tip { position: fixed; pointer-events: auto; background: var(--surface); color: var(--text); border-radius: 14px; padding: var(--sp-4);
  box-shadow: 0 12px 36px rgba(16, 24, 40, .3); display: flex; flex-direction: column; gap: var(--sp-2); transition: left .2s ease, top .2s ease; }
.tour-tip p { margin: 0; line-height: 1.6; }
.tour-tip-head { display: flex; align-items: center; gap: var(--sp-2); }
.tour-title { font-size: 1rem; }
.tour-dots { display: inline-flex; gap: 4px; }
.tour-dots i { width: 18px; height: 4px; border-radius: 2px; background: var(--border); }
.tour-dots i.done { background: var(--green); }
.tour-dots i.cur { background: var(--primary); }
.tour-x { margin-left: auto; border: 0; background: none; color: var(--muted); font-size: 1.25rem; line-height: 1; cursor: pointer; padding: 2px 6px; }
.tour-tip-btns { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-2); margin-top: var(--sp-1); }
.tour-wait { display: inline-flex; align-items: center; gap: 4px; color: var(--primary); font-weight: 600; font-size: .8125rem; }
.tour-wait .i { width: 16px; height: 16px; }
.link-btn { border: 0; background: none; color: var(--muted); font: inherit; font-size: .8125rem; cursor: pointer; padding: 4px 0; text-decoration: underline; text-underline-offset: 3px; }
.link-btn:hover { color: var(--text); }
.tour-intro p { margin: 0 0 var(--sp-3); line-height: 1.7; }
.tour-outline { margin: 0 0 var(--sp-3); padding-left: 1.4em; display: grid; gap: var(--sp-1); font-weight: 600; }
.tour-intro .btn-row { flex-wrap: wrap; }
.tour-recap { display: grid; gap: var(--sp-3); margin-bottom: var(--sp-4); }
.tour-recap-row { display: grid; grid-template-columns: 40px 5.5em 1fr; align-items: center; gap: var(--sp-3); padding: var(--sp-3); border-radius: var(--radius); background: var(--surface-2); }
.tour-recap-row .ico { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: var(--primary-soft); color: var(--primary); }
.tour-recap-row b { font-size: 1rem; }
@media (max-width: 480px) { .tour-recap-row { grid-template-columns: 40px 1fr; } .tour-recap-row > span:last-child { grid-column: 2; } }
.tips-list { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--sp-2); }
.tips-row { display: flex; align-items: center; gap: var(--sp-3); padding: var(--sp-3); border: 1px solid var(--border); border-radius: var(--radius); }
.tips-row > div { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.tips-row .btn { flex: none; }
.tips-foot { display: flex; justify-content: space-between; align-items: center; gap: var(--sp-3); flex-wrap: wrap; margin-top: var(--sp-4); }
.tour-recap-row.simple { grid-template-columns: 40px 1fr; }
/* チュートリアルの一覧: 進み具合・次のおすすめ・目的別の編 */
.tc-progress { height: 6px; border-radius: 3px; background: var(--surface-2); overflow: hidden; margin: 0 0 var(--sp-3); }
.tc-progress i { display: block; height: 100%; background: var(--green); border-radius: 3px; transition: width .3s; }
.tc-next { display: flex; align-items: center; gap: var(--sp-3); padding: var(--sp-3); border-radius: var(--radius); background: var(--primary-soft); margin-bottom: var(--sp-3); }
.tc-next > div { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.tc-next b { font-size: 1rem; }
.tc-next.all { flex-direction: column; align-items: flex-start; gap: 2px; }
.tc-group { font-size: .8125rem; color: var(--muted); margin: var(--sp-4) 0 var(--sp-2); }
.tc-list { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--sp-2); }
/* いまの画面のチュートリアル(一覧のいちばん上。次のおすすめはその下) */
.tc-group.tc-here-h { margin-top: 0; color: var(--primary); font-weight: 700; }
.tc-here { margin-bottom: var(--sp-4); }
.tc-here .tc-row:not(.tc-tips) { border-color: var(--primary); }
.tips-tours .tips-row { padding: var(--sp-2) var(--sp-3); }
.tips-tours .tips-row { }
.tc-row { width: 100%; display: flex; align-items: center; gap: var(--sp-3); padding: var(--sp-2) var(--sp-3); border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); color: inherit; font: inherit; text-align: left; cursor: pointer; }
.tc-row:hover { border-color: var(--primary); }
.tc-row:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.tc-check { flex: none; display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--border); color: #fff; }
.tc-check .i { width: 16px; height: 16px; }
.tc-row.done .tc-check { background: var(--green); border-color: var(--green); }
.tc-tips .tc-check { border: 0; background: var(--primary-soft); color: var(--primary); }
.tc-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.tc-meta { flex: none; display: flex; flex-direction: column; align-items: flex-end; gap: 2px; }
.tc-go { font-size: .8125rem; font-weight: 600; color: var(--primary); }
.tc-foot { margin-top: var(--sp-4); }
/* 成果の型: 目的のタブ・役割といつやるかの札・なぜ効くか・自分の案件で1つ */
.tc-group.tc-goal-h { margin-top: 0; color: var(--primary); font-weight: 700; }
.tc-goals { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--sp-2); margin-bottom: var(--sp-3); }
.tc-goals button { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: var(--sp-2) var(--sp-3); border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); color: inherit; font: inherit; text-align: left; cursor: pointer; }
.tc-goals button[aria-selected="true"] { border-color: var(--primary); background: var(--primary-soft); color: var(--primary); }
.tc-goal { margin-bottom: var(--sp-4); }
.tc-goal > p { margin: 0 0 var(--sp-2); }
.tc-tags { display: flex; flex-wrap: wrap; gap: 4px; }
.tc-tag { font-size: .75rem; padding: 1px 8px; border-radius: 6px; background: var(--surface-2); color: var(--muted); }
.tc-tag.goal { background: var(--primary-soft); color: var(--primary); font-weight: 600; }
.tc-row.practiced .tc-check { background: var(--primary-soft); border-color: var(--primary); color: var(--primary); }
.tc-ops { margin-top: var(--sp-4); border-top: 1px solid var(--border); padding-top: var(--sp-3); }
.tc-ops summary { cursor: pointer; font-weight: 700; display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--sp-2); }
.tour-intro .tc-tags { margin-bottom: var(--sp-3); }
.tour-outline .why { display: block; font-weight: 400; font-size: .8125rem; color: var(--muted); }
.tour-mission-note { display: flex; gap: var(--sp-2); align-items: flex-start; padding: var(--sp-2) var(--sp-3); border-radius: var(--radius); background: var(--green-soft); }
.tour-mission-note .i { flex: none; color: var(--green); margin-top: 3px; }
.tour-why { margin-top: var(--sp-2) !important; padding: var(--sp-2) var(--sp-3); border-radius: 8px; background: var(--green-soft); font-size: .8125rem; }
.tour-why b { color: var(--green); margin-right: var(--sp-2); }
.tour-recap-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.tour-mission-box { display: flex; flex-direction: column; gap: 4px; padding: var(--sp-3) var(--sp-4); border: 2px solid var(--green); border-radius: var(--radius); margin-bottom: var(--sp-3); }
.tour-mission-box b { font-size: 1rem; }
.tour-mission { position: fixed; right: var(--sp-4); bottom: var(--sp-4); z-index: 900; width: min(460px, calc(100vw - 2 * var(--sp-4))); display: flex; flex-wrap: wrap; align-items: flex-start; gap: var(--sp-2) var(--sp-3);
  padding: var(--sp-3); border-radius: 14px; background: var(--surface); border: 2px solid var(--green); box-shadow: 0 8px 24px rgba(10, 15, 25, .18); }
.tour-mission .ico { flex: none; color: var(--green); }
.tour-mission .tm-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.tour-mission .tm-text b { font-size: .875rem; line-height: 1.5; }
.tour-mission .tm-btns { flex: 1 0 100%; display: flex; justify-content: flex-end; align-items: center; gap: var(--sp-3); }
@media (max-width: 760px) {
  .tc-goals { gap: 4px; }
  .tc-goals button { padding: var(--sp-2); font-size: .8125rem; }
  .tc-goals button .small { display: none; }
  .tc-row .tc-meta > .muted { display: none; }
  .tc-row .tc-meta { max-width: 5.5em; }
  .tc-row .tc-go { text-align: right; }
  .tour-mission { left: var(--sp-3); right: var(--sp-3); width: auto; bottom: calc(72px + env(safe-area-inset-bottom)); }
}
@media print { .tour-mission { display: none !important; } }
/* 上部バーの「?」: はじめて開いた画面では控えめに光る(中にチュートリアルと、この画面でできること)・更新情報(未読の点) */
#help-btn.pulse { animation: tips-pulse 2s ease-in-out 3; color: var(--primary); border-color: var(--primary); }
@keyframes tips-pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(0, 47, 123, .35); } 50% { box-shadow: 0 0 0 6px rgba(0, 47, 123, 0); } }
/* 「?」(ヘルプ): 新しい更新情報があるときの赤い点 */
#help-btn { position: relative; }
#help-btn .new-dot { display: none; position: absolute; top: 4px; right: 4px; width: 8px; height: 8px; border-radius: 50%; background: var(--red); }
#help-btn.has-new .new-dot { display: block; }
@media print { .tour-layer, .notif-btn, .nt-panel { display: none !important; } }

/* 顧客一覧: 最近のニュースの行 */
.cu-news-line { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; margin-top: 8px; padding: 4px 8px; border-radius: 8px; background: var(--surface-2); font-size: .8125rem; min-width: 0; }
.cu-news-line .badge .i { width: 14px; height: 14px; }
.cu-news-line .t { flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.cu-news-line.open .t { font-weight: 700; }
@media (max-width: 760px) { .cu-news-line .t { white-space: normal; flex-basis: 100%; order: 3; } }
/* 今週の成果(事実だけ)・メンバーカード・声をかけるポイント(部長のみ) */
td.warm { color: var(--orange); font-weight: 700; }
.mc-good div[data-kpi-list] { cursor: pointer; }
.mc-follow { display: flex; flex-direction: column; gap: 2px; background: var(--gray-soft); border-radius: 8px; padding: var(--sp-2) var(--sp-3); font-size: .8125rem; }
.mc-follow[data-kpi-list] { cursor: pointer; }
.mc-follow[data-kpi-list]:hover { outline: 2px solid var(--primary-soft); }
.talk { display: flex; gap: var(--sp-2); align-items: flex-start; font-size: .8125rem; color: var(--muted); border-top: 1px dashed var(--border); padding-top: var(--sp-2); }
.talk .i { flex: none; margin-top: 2px; }
.talk ul { margin: 0; padding-left: 1.1em; }
.talk-list { display: grid; gap: var(--sp-2); }
.talk-list .talk { border-top: 0; padding-top: 0; }
.ex-good li::marker { color: var(--green); }
/* 与信 */
.cu-util { display: inline-flex; align-items: center; gap: 6px; }
.util-bar { display: inline-block; width: 56px; height: 6px; border-radius: 3px; background: var(--border); overflow: hidden; }
.util-bar b, .cr-bar b { display: block; height: 100%; background: var(--primary); border-radius: inherit; }
.util-bar b.hi, .cr-bar b.hi { background: var(--orange, #d97706); }
.cr-nums { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-bottom: 8px; }
.cr-nums > div { display: flex; flex-direction: column; }
.cr-nums b { font-size: 1.125rem; }
.cr-nums b.neg { color: var(--orange, #d97706); }
.cr-bar { position: relative; height: 10px; border-radius: 5px; background: var(--border); margin-bottom: 4px; }
.cr-bar i { position: absolute; top: -3px; bottom: -3px; border-left: 2px dashed var(--muted); }
.cr-sig { margin-top: 8px; }
.cr-h { font-size: .8125rem; margin: 12px 0 4px; color: var(--muted); }
.cr-chart { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 4px; height: 110px; margin-top: 16px; align-items: end; padding-bottom: 16px; position: relative; }
.cr-chart > div { position: relative; height: 100%; display: flex; align-items: flex-end; justify-content: center; }
.cr-chart .bar { width: 70%; background: var(--primary); border-radius: 3px 3px 0 0; }
.cr-chart .lim { position: absolute; left: 0; right: 0; border-top: 2px dashed var(--orange, #d97706); }
.cr-chart .m { position: absolute; bottom: -16px; font-size: .625rem; color: var(--muted); }
.cr-key { display: inline-block; width: 14px; height: 0; margin-right: 4px; vertical-align: middle; }
.cr-key.bar { height: 8px; background: var(--primary); }
.cr-key.lim { border-top: 2px dashed var(--orange, #d97706); }
.cr-row { cursor: pointer; }
.cr-badges { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; }



/* ---------- パイプライン: 矢羽根を1本の帯につなげ、左から右へ濃くなる色で流れを見せる ----------
   --stc: そのフェーズの色(見出しの塗り)。列の背景はその色をうすく敷き、カードがどの矢羽根の下にあるかわかるようにする */
/* 矢羽根の先と切り欠きは同じ深さ。継ぎ目は「>」の形の白い隙間にして、1つずつが矢印に見えるようにする */
.board { --chev: 22px; --seam: 6px; }
.board-acq .column:nth-child(1) { --stc: #dbe6f6; --stt: var(--primary); }
.board-acq .column:nth-child(2) { --stc: #b3c9ec; --stt: var(--primary); }
.board-acq .column:nth-child(3) { --stc: #6f97d6; --stt: #fff; }
.board-acq .column:nth-child(4) { --stc: #3566b5; --stt: #fff; }
.board-acq .column:nth-child(5) { --stc: #0b3d8f; --stt: #fff; }
.board-onb .column:nth-child(1) { --stc: #fde6cc; --stt: #8a3c00; }
.board-onb .column:nth-child(2) { --stc: #fbcf9e; --stt: #8a3c00; }
.board-onb .column:nth-child(3) { --stc: #f5ac62; --stt: #5c2800; }
.board-onb .column:nth-child(4) { --stc: #e8892f; --stt: #fff; }
.board-onb .column:nth-child(5) { --stc: #cf6a12; --stt: #fff; }
.board-onb .column:nth-child(6) { --stc: #a8520a; --stt: #fff; }
.board .column.won { --stc: #0a7a4b; --stt: #fff; }
.board .column { position: relative; background: color-mix(in srgb, var(--stc, var(--surface-2)) 14%, var(--surface)); }
.board .column-head, .board-onb .column-head, .board .column.won .column-head { background: var(--stc); color: var(--stt); }
.board .column-head .sum { color: inherit; opacity: .85; }
/* 隣の列の切り欠きに食い込ませて、1本の帯に見せる(継ぎ目は細い白線) */
@media (min-width: 761px) {
  .board .column:not(.lost) .column-head { margin-right: calc(-8px - var(--sp-3) - var(--chev) + var(--seam)); padding-right: calc(var(--chev) * 2 + 8px); }
  .board .column.won .column-head { margin-right: -8px; padding-right: calc(var(--chev) + 10px); }
  /* 失注・対象外/脱会は流れの外: 間をあけ、灰色の枠だけにする */
  .board .column.lost { margin-left: var(--sp-5); }
}
.board .column.lost { background: transparent; border: 1px dashed var(--border); }
.board .column.lost .column-head { background: transparent; color: var(--muted); clip-path: none; border-bottom: 1px dashed var(--border); border-radius: var(--radius) var(--radius) 0 0; }
.board .column.lost .card { opacity: .85; }
/* 見出しと移行率をまとめる枠(見出しは矢羽根の形に切り抜くので、移行率はその外に重ねる) */
.board .column-top { position: relative; display: flex; flex-direction: column; margin: -8px 0 var(--sp-3); }
/* 矢羽根の先は右の列の切り欠きに入るので、右の列の背景より上に描く(下に描くと先が隠れて矢印に見えない) */
.board .column:not(.lost) .column-top { z-index: 1; }
.board .column .column-head .name, .board .column .column-head .sum { color: var(--stt, inherit); }
.board .column.lost .column-head .name, .board .column.lost .column-head .sum { color: var(--muted); }
.board .column-top > .column-head { flex: 1; margin-top: 0; margin-bottom: 0; display: flex; flex-direction: column; justify-content: center; }
/* スマホ(フェーズを縦に並べる): スクロール中も今どのフェーズのカードかわかるよう、矢羽根を上部バーの下に止める。
   止まるのは自分の列の中だけなので、次のフェーズの矢羽根が来ると押し上げられて入れ替わる。
   矢羽根の切り欠きからカードが透けないよう、列と同じ色で下地を敷く */
@media (max-width: 760px) {
  .board .column-top { position: sticky; top: var(--topbar-h, 64px); z-index: 4; background: color-mix(in srgb, var(--stc, var(--surface-2)) 14%, var(--surface)); }
  .board .column.lost .column-top { background: var(--bg); }
}
/* 列ごとのスクロールバーは、マウスを載せたときだけ細く出す */
.board .column-body { scrollbar-width: thin; scrollbar-color: transparent transparent; }
.board .column-body:hover, .board .column-body:focus-within { scrollbar-color: color-mix(in srgb, var(--muted) 50%, transparent) transparent; }
.board .column-body::-webkit-scrollbar { width: 6px; }
.board .column-body::-webkit-scrollbar-thumb { background: transparent; border-radius: 3px; }
.board .column-body:hover::-webkit-scrollbar-thumb { background: color-mix(in srgb, var(--muted) 50%, transparent); }
/* 画面(dialog)を開いている間は「先頭へ」を出さない(画面の外のボタンが重なって見えるため) */
body:has(#modal[open]) .totop { display: none; }

/* ---------- 対応策 ---------- */
.plan-sum { margin: 4px 0 10px; }
.plan-tabs { margin: 6px 0 4px; }
.plan-table td { vertical-align: top; }
.plan-table .plan-no { width: 2em; color: var(--muted); }
.plan-issue { color: var(--primary); margin-top: 2px; }
.plan-dropped td { color: var(--muted); }
.plan-dropped b { text-decoration: line-through; }
.plan-status { padding: 4px 6px; font-size: .8125rem; width: auto; }
.plan-btns { justify-content: flex-start; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.plan-edit { border: 1px solid var(--border); border-radius: 8px; padding: 6px 12px 10px; margin: 0 0 12px; min-width: 0; }
.plan-edit legend { font-weight: 700; padding: 0 4px; }
.plan-edit label { margin-bottom: 8px; }
.plan-grid4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.plan-move { display: flex; gap: 6px; flex-wrap: wrap; }
.danger-text { color: var(--red); }
.panel .plan-panel { box-shadow: none; padding: 0; margin-top: 16px; }
@media (max-width: 760px) { .plan-grid4 { grid-template-columns: 1fr 1fr; } }
.plan-hist td { white-space: normal; }

/* ---------- 営業組織(部・グループ・エリアの絞り込み、メンバー管理) ---------- */
.org-filter { display: inline-flex; gap: var(--sp-2); flex-wrap: nowrap; flex: none; }
.org-block { display: flex; flex-direction: column; gap: var(--sp-3); }
.org-sub { font-size: .875rem; margin: 0; display: flex; gap: var(--sp-2); align-items: baseline; }
.users-table .org-row th { background: var(--bg); text-align: left; font-size: .8125rem; padding-top: var(--sp-3); }
.users-table tr.muted td { opacity: .6; }
.org-fields { border: 1px solid var(--border); border-radius: 10px; padding: var(--sp-3); margin: 0 0 var(--sp-3); }
.org-fields legend { font-size: .8125rem; font-weight: 600; padding: 0 var(--sp-1); }
.org-fields details { margin-top: var(--sp-2); }
.org-fields .check-label span { display: flex; gap: var(--sp-2); align-items: center; }
.org-fields .check-label input { width: auto; min-height: auto; }
@media (max-width: 760px) {
}

/* ---------- 担当配置の見直し ---------- */
.asg-table { table-layout: fixed; width: 100%; min-width: 108em; }
.asg-table th, .asg-table td { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.asg-table td:first-child { white-space: normal; }
/* 名前の列は全体の決まり(.table-wrap の1列目を固定)で左に固定。2段目の見出しの先頭(商談)は固定しない */
.table-wrap .asg-table thead tr + tr th:first-child { left: auto; z-index: 2; }
.asg-table thead th { white-space: normal; }
.asg-table .asg-angles th { text-align: center; font-size: .75rem; border-bottom: 2px solid var(--border); }
.asg-table .asg-angles th + th { border-left: 1px solid var(--border); }
.asg-n { cursor: pointer; text-decoration: underline dotted; text-underline-offset: 3px; }
.asg-load { display: inline-flex; align-items: center; gap: var(--sp-2); min-width: 7.5em; }
.asg-load i { display: block; height: 6px; border-radius: 3px; background: var(--primary); flex: 0 0 auto; max-width: 4em; min-width: 2px; }
.asg-load.hi i { background: var(--orange); }
.asg-load.lo i { background: color-mix(in srgb, var(--muted) 60%, transparent); }
.asg-load b { font-weight: 600; font-size: .8125rem; }
.asg-legend { margin: var(--sp-2) 0 var(--sp-4); }
.asg-sugg { display: grid; grid-template-columns: auto 1fr auto; gap: var(--sp-3); align-items: start; padding: var(--sp-3) 0; border-top: 1px solid var(--border); }
.asg-sugg:first-of-type { border-top: 0; }
.asg-sugg.off { opacity: .55; }
.asg-sugg input[type=checkbox] { width: auto; min-height: auto; margin-top: 4px; }
.asg-item { display: flex; flex-wrap: wrap; gap: var(--sp-2); align-items: center; }
.asg-move { display: flex; flex-wrap: wrap; gap: var(--sp-2); align-items: center; margin: var(--sp-1) 0; }
.asg-move select { width: auto; min-height: 32px; padding: 2px 8px; }
.asg-effect { text-align: right; display: flex; flex-direction: column; gap: var(--sp-2); align-items: flex-end; }
.asg-effect .up, .asg-total .up { color: var(--green); }
.asg-actions { margin-top: var(--sp-3); }
.asg-total { margin: var(--sp-3) 0; }
.asg-confirm { margin: 0 0 var(--sp-3); padding-left: 1.2em; max-height: 40vh; overflow: auto; }
.asg-hist { padding: var(--sp-2) 0; border-top: 1px solid var(--border); }
.asg-hist:first-child { border-top: 0; }
.asg-hist ul { margin: var(--sp-2) 0 0; padding-left: 1.2em; }
@media (max-width: 760px) {
  .asg-sugg { grid-template-columns: auto 1fr; }
  .asg-effect { grid-column: 2; text-align: left; align-items: flex-start; }
}
.asg-panel h2 .muted { margin-left: var(--sp-2); font-weight: 400; }
.asg-stuck { margin: 0 0 var(--sp-3); padding: var(--sp-2) var(--sp-3); border-radius: 8px; background: var(--orange-soft); }
.asg-effect .down { color: var(--orange); }
.pipe-cust { margin: 4px 0 0; color: var(--muted); }
.pipe-cust a.link { font-weight: 700; }

/* 取引額 */
.cu-bands { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; margin: 4px 0 8px; }
.cu-bands .seg.compact { flex-wrap: wrap; min-width: 0; max-width: 100%; }  /* 帯が多いので折り返す(スマホで横にはみ出さない) */
@media (max-width: 760px) { .cu-bands .seg.compact button { flex: 0 1 auto; padding: 6px 10px; } }
.sr-amount small + small { margin-top: 0; }
.sr-amount .pos { color: var(--green); }
.sr-amount .neg, .cu-amt-sum .neg, .kpi .neg { color: var(--red); }
.cu-amt-sum .pos, .kpi .pos { color: var(--green); }
.cu-amt-sum { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 8px 16px; margin-top: 10px; }
.cu-amt-sum > div { display: flex; flex-direction: column; }
.cu-amt-sum b { font-size: 1rem; }

/* ---------- 営業部の全体像(whole.js) ---------- */
.wh-me { display: flex; flex-wrap: wrap; gap: var(--sp-3) var(--sp-5); padding: var(--sp-3) var(--sp-4); }
.wh-me > div { display: flex; flex-direction: column; gap: 2px; }
.wh-scroll { overflow-x: auto; padding-bottom: var(--sp-1); }
.wh-grid { display: grid; grid-template-columns: 112px repeat(var(--wh-cols), minmax(150px, 1fr)); grid-template-rows: auto auto repeat(5, auto); gap: 0 var(--sp-2); min-width: 1240px; }
.wh-phase { grid-row: 1; display: flex; align-items: baseline; gap: var(--sp-2); padding: var(--sp-2) var(--sp-3); border-radius: var(--radius) var(--radius) 0 0; font-size: .875rem; }
.wh-phase span { font-size: .75rem; color: var(--muted); }
.wh-ph-acq.wh-phase { background: var(--primary-soft); color: var(--primary); }
.wh-ph-onb.wh-phase { background: var(--purple-soft); color: var(--purple); }
.wh-ph-member.wh-phase { background: var(--green-soft); color: var(--green); }
.wh-lanes, .wh-col { grid-row: 2 / span 6; display: grid; grid-template-rows: subgrid; }
.wh-col { background: var(--surface); border: 1px solid var(--border); border-top: 0; border-radius: 0 0 var(--radius) var(--radius); box-shadow: var(--shadow); }
.wh-col.mine { border: 2px solid var(--primary); border-top: 0; }
.wh-cell { padding: var(--sp-2) var(--sp-3); border-top: 1px solid var(--border); font-size: .8125rem; line-height: 1.55; display: flex; flex-direction: column; gap: var(--sp-1); }
.wh-cell p { margin: 0; }
.wh-cell:first-child { border-top: 0; }
.wh-stage { background: var(--surface-2); }
.wh-stage-name { display: flex; align-items: flex-start; gap: var(--sp-2); font-size: .875rem; }
.wh-stage-name b { padding-top: 1px; }
.wh-stage-tags { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-1) var(--sp-2); margin-top: auto; }
.wh-stage-tags:empty { display: none; }
#wh-boss h2 .muted { margin-left: var(--sp-2); font-weight: 500; }
.wh-step { flex: none; width: 22px; height: 22px; border-radius: 50%; background: var(--primary); color: var(--on-primary); font-size: 12px; font-weight: 700; display: grid; place-items: center; }
.wh-ph-onb .wh-step { background: var(--purple); }
.wh-ph-member .wh-step { background: var(--green); }
.wh-count { font-size: .75rem; font-weight: 700; color: var(--primary); cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.wh-lane-head { justify-content: center; font-weight: 700; font-size: .7812rem; color: var(--muted); border-top: 1px solid var(--border); background: none; }
.wh-lanes .wh-stage { border-top: 0; background: none; }
.wh-lane-head.wh-rep { color: var(--primary); }
.wh-lane-head.wh-link { color: var(--orange); }
.wh-lane-tag { display: none; font-size: .7188rem; font-weight: 700; color: var(--muted); }
.wh-owner b { font-size: .7812rem; }
.wh-rep { background: color-mix(in srgb, var(--primary-soft) 55%, transparent); }
.wh-link { flex-direction: row; gap: var(--sp-2); font-size: .7812rem; color: var(--orange); background: var(--orange-soft); }
.wh-arrow { font-weight: 700; flex: none; }
.wh-links { display: flex; flex-wrap: wrap; gap: var(--sp-1) var(--sp-3); margin-top: auto; padding-top: var(--sp-1); }
.wh-links .link-btn { color: var(--primary); font-weight: 600; text-decoration: none; padding: 0; font-size: .7812rem; }
.wh-links .link { font-size: .7812rem; }
.wh-boss-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: var(--sp-4); }
.wh-boss-card { border: 1px solid var(--border); border-radius: var(--radius); padding: var(--sp-3) var(--sp-4); display: flex; flex-direction: column; gap: var(--sp-2); }
.wh-boss-card h3 { margin: 0; font-size: .9062rem; display: flex; align-items: center; gap: var(--sp-2); }
.wh-boss-card h3 .i { color: var(--primary); }
.wh-boss-card p { margin: 0; font-size: .8438rem; line-height: 1.65; }
.wh-rhythm-table th[scope="row"] { white-space: nowrap; }
.wh-rhythm-table td { min-width: 180px; }
@media (max-width: 760px) {
  .wh-scroll { overflow: visible; }
  .wh-grid { display: flex; flex-direction: column; gap: var(--sp-3); min-width: 0; }
  .wh-phase, .wh-lanes { display: none; }
  .wh-col { display: block; border-top: 1px solid var(--border); border-radius: var(--radius); }
  .wh-col.mine { border-top: 2px solid var(--primary); }
  .wh-ph-acq.wh-col { border-left: 4px solid var(--primary); }
  .wh-ph-onb.wh-col { border-left: 4px solid var(--purple); }
  .wh-ph-member.wh-col { border-left: 4px solid var(--green); }
  .wh-stage { border-radius: var(--radius) var(--radius) 0 0; }
  .wh-lane-tag { display: block; }
}
/* ---------- どこからでも録音(上部バー)・録音の受け皿 ---------- */
.topbar-right > .rec-top { color: var(--red); }
.topbar-right > .rec-top:hover { color: var(--red); background: var(--surface); }
@media (max-width: 1280px) and (min-width: 761px) { .topbar-right > .rec-top span { display: inline; } .topbar-right > .rec-top { padding: 0 14px; } }
@media (min-width: 761px) {
  .topbar.hc3 .topbar-right > .rec-top span { display: none; }
  .topbar.hc3 .topbar-right > .rec-top { width: 40px; padding: 0; }
}
@media (max-width: 760px) {
  .topbar-right > .rec-top { display: grid; place-items: center; width: 44px; height: 44px; padding: 0; border-radius: 50%; flex: none; }
  .topbar-right > .rec-top span { display: none; }
  .topbar-right > .rec-top .i { width: 22px; height: 22px; }
}
/* ---------- 名刺の読み取り(スマホの上部バー、録音の横。bizcard.js) ---------- */
.topbar-right > .card-top { display: none; }
@media (max-width: 760px) {
  .topbar-right > .card-top:not([hidden]) { display: grid; place-items: center; width: 44px; height: 44px; padding: 0; border-radius: 50%; flex: none; color: var(--primary); background: var(--primary-soft); border-color: transparent; }
  .topbar-right > .card-top span { display: none; }
  .topbar-right > .card-top .i { width: 22px; height: 22px; }
}
.bc-cam { position: relative; background: #000; border-radius: 12px; overflow: hidden; aspect-ratio: 4 / 3; margin-bottom: var(--sp-2); }
.bc-cam video { width: 100%; height: 100%; object-fit: cover; display: block; }
/* 名刺の形(91:55)の枠。枠の中だけを切り出して送る(bcShoot) */
.bc-guide { position: absolute; left: 9%; width: 82%; top: calc(50% + 22px); transform: translateY(-50%); aspect-ratio: 91 / 55; border: 3px solid #fff; border-radius: 10px; box-shadow: 0 0 0 999px rgba(0,0,0,.45); pointer-events: none; }
.bc-cam.tall { aspect-ratio: 3 / 4; }
.bc-cam.tall .bc-guide { left: 50%; top: calc(50% + 24px); width: auto; height: 78%; transform: translate(-50%, -50%); aspect-ratio: 55 / 91; }
.bc-orient { position: absolute; top: 8px; left: 50%; transform: translateX(-50%); display: flex; padding: 3px; gap: 2px; border-radius: 999px; background: rgba(0,0,0,.6); }
.bc-orient button { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 16px; border: 0; border-radius: 999px; background: transparent; color: #fff; font-size: .9375rem; font-weight: 700; cursor: pointer; }
.bc-orient button[aria-pressed="true"] { background: #fff; color: #111; }
.bc-ico { display: inline-block; width: 18px; height: 12px; border: 2px solid currentColor; border-radius: 3px; }
.bc-ico.tall { width: 12px; height: 18px; }
.bc-flash { position: absolute; inset: 0; background: #fff; opacity: 0; pointer-events: none; }
.bc-cam.flash .bc-flash { animation: bc-flash .25s ease-out; }
@keyframes bc-flash { from { opacity: .8; } to { opacity: 0; } }
.bc-cam-msg { position: absolute; inset: auto 0 12px; text-align: center; color: #fff; font-size: .8125rem; margin: 0; }
.bc-shoot-row { display: flex; align-items: center; gap: var(--sp-3); flex-wrap: wrap; margin: var(--sp-2) 0; }
.bc-pick { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
.bc-shutter { width: 68px; height: 68px; border-radius: 50%; border: 4px solid var(--primary); background: var(--surface); padding: 5px; cursor: pointer; flex: none; margin: 0 auto; }
.bc-shutter span { display: block; width: 100%; height: 100%; border-radius: 50%; background: var(--primary); }
.bc-shutter:active span { transform: scale(.9); }
.bc-count { flex: 1 0 100%; font-size: .8125rem; color: var(--muted); text-align: center; }
.bc-shots { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: var(--sp-2); margin-bottom: var(--sp-3); }
.bc-shot { position: relative; border: 1px solid var(--border); border-radius: 8px; padding: 4px; display: grid; gap: 4px; background: var(--surface); min-width: 0; }
.bc-shot img, .bc-ph { width: 100%; aspect-ratio: 91 / 55; object-fit: contain; border-radius: 6px; background: var(--surface-2); display: grid; place-items: center; color: var(--muted); }
.bc-st { display: flex; align-items: center; gap: 4px; font-size: .6875rem; line-height: 1.3; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bc-st .i { width: 14px; height: 14px; flex: none; }
.bc-shot.done .bc-st { color: var(--green); }
.bc-shot.error { border-color: var(--red-soft); }
.bc-shot.error .bc-st { color: var(--red); white-space: normal; }
.bc-st .spinner { width: 12px; height: 12px; border-width: 2px; margin: 0; flex: none; }
.bc-del { position: absolute; top: 2px; right: 2px; width: 28px; height: 28px; border-radius: 50%; border: 0; background: rgba(0,0,0,.55); color: #fff; font-size: 1rem; line-height: 1; cursor: pointer; }
.bc-list { display: grid; gap: var(--sp-3); margin-bottom: var(--sp-3); }
.bc-item { border: 1px solid var(--border); border-radius: 10px; padding: var(--sp-3); background: var(--surface); }
.bc-item.off { opacity: .55; }
.bc-item.off .bc-fields, .bc-item.off .bc-more { display: none; }
.bc-item-head { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-2); }
.bc-on { display: flex; align-items: center; gap: 8px; font-weight: 700; min-height: 44px; }
.bc-on input { width: 22px; height: 22px; margin: 0; }
.bc-photo { display: block; width: 100%; max-height: 240px; object-fit: contain; border-radius: 8px; border: 1px solid var(--border); background: var(--surface-2); margin: var(--sp-1) 0; }
.bc-match { display: flex; flex-wrap: wrap; gap: 4px 6px; margin: var(--sp-1) 0 var(--sp-2); }
.bc-badge { display: inline-block; font-size: .75rem; font-weight: 700; padding: 2px 8px; border-radius: 10px; background: var(--surface-2); color: var(--text); }
.bc-badge.new { background: var(--primary-soft); color: var(--primary); }
.bc-badge.add { background: var(--green-soft, var(--surface-2)); color: var(--green); }
.bc-badge.err { background: var(--red-soft); color: var(--red); }
.bc-badge.known { color: var(--muted); }
.bc-other { font-size: .75rem; color: var(--muted); align-self: center; }
/* スマホでも短い項目は2列にして、名刺1枚ぶんを1画面に近づける */
.bc-item .bc-fields { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-2) var(--sp-3); }
.bc-item .bc-fields label { margin: 0; min-width: 0; }
.bc-item .bc-fields label:has([data-k=company]), .bc-item .bc-fields label:has([data-k=email]), .bc-item .bc-fields label:has([data-k=address]),
.bc-item .bc-fields label:has([data-k=url]) { grid-column: 1 / -1; }
.bc-more summary { cursor: pointer; color: var(--primary); font-weight: 600; font-size: .8125rem; padding: 6px 0; }
.bc-opts { display: grid; gap: var(--sp-2); padding: var(--sp-3); border-radius: 10px; background: var(--surface-2); margin-bottom: var(--sp-2); }
.inbox-summary { background: var(--surface-2); border-radius: 8px; padding: var(--sp-3); margin-bottom: var(--sp-3); display: grid; gap: var(--sp-2); }
.inbox-summary pre { white-space: pre-wrap; font: inherit; font-size: .875rem; margin: 0; }
.pick-list { display: grid; gap: var(--sp-2); margin: var(--sp-2) 0 var(--sp-3); max-height: 46vh; overflow: auto; }
.pick-deal { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; text-align: left; border: 1px solid var(--border); background: var(--surface); border-radius: 8px; padding: 10px 12px; min-height: 44px; cursor: pointer; font: inherit; color: inherit; }
.pick-deal:hover { border-color: var(--primary); }
.lib-list { display: grid; gap: var(--sp-2); margin-top: var(--sp-3); }
.lib-list .rec-item { border: 1px solid var(--border); }
/* 録音の中身(話題ごとの要約・全文)を開閉して確かめる */
.lib-more { flex: 1 0 100%; display: grid; gap: var(--sp-1); }
.lib-more summary { cursor: pointer; color: var(--primary); font-weight: 600; font-size: .8125rem; padding: 4px 0; }
.lib-more-body { margin: var(--sp-1) 0 var(--sp-2); }
.lib-more-body pre { white-space: pre-wrap; font: inherit; font-size: .8125rem; background: var(--surface-2); border-radius: 8px; padding: 10px; margin: 0; max-height: 40vh; overflow: auto; }
.lib-topics { margin: 0; padding-left: 1.4em; display: grid; gap: var(--sp-2); font-size: .8125rem; }
.lib-topics li b { display: block; }
.lib-draft { margin-top: var(--sp-3); display: grid; gap: var(--sp-1); }

/* ---------- 入力欄の「AI」ボタンとAIの案(差分) ---------- */
.ai-wrap { display: block; position: relative; }
label > .ai-wrap { margin-top: 4px; }
.ai-wrap > input, .ai-wrap > textarea { color: var(--text); font-weight: 400; font-size: .9375rem; }
.ai-wrap > textarea { padding-right: 52px; }
.ai-wrap.line > input { padding-right: 52px; }
.ai-btn { position: absolute; top: 6px; right: 6px; display: inline-flex; align-items: center; gap: 2px; height: 28px; padding: 0 7px; border: 1px solid var(--purple-soft); border-radius: 14px;
  background: var(--purple-soft); color: var(--purple); font: inherit; font-size: .6875rem; font-weight: 800; cursor: pointer; opacity: .85; }
.ai-wrap.line > .ai-btn { top: 50%; transform: translateY(-50%); }
.ai-btn .i { width: 14px; height: 14px; }
.ai-btn:hover, .ai-wrap:focus-within > .ai-btn { opacity: 1; border-color: var(--purple); }
@media (max-width: 760px) { .ai-btn { height: 32px; padding: 0 9px; } .ai-wrap > textarea, .ai-wrap.line > input { padding-right: 60px; } }
.ai-actions { display: flex; flex-wrap: wrap; gap: var(--sp-2); }
.ai-custom { display: flex; gap: var(--sp-2); margin-top: var(--sp-2); }
.ai-custom input { flex: 1; min-width: 0; }
/* 案件が決まっていない録音: 上部バーのマイクの件数と、「アクション」の先頭のお知らせ */
.rec-top { position: relative; }
.recbox-note { display: flex; align-items: center; gap: var(--sp-2); width: 100%; margin-bottom: var(--sp-4); padding: var(--sp-3) var(--sp-4); border: 1px solid var(--red-soft); border-radius: var(--radius); background: var(--red-soft); color: var(--text); font: inherit; font-size: .875rem; text-align: left; cursor: pointer; min-height: 44px; }
.recbox-note .i { color: var(--red); flex: none; }
.recbox-note .go { margin-left: auto; color: var(--red); font-weight: 700; white-space: nowrap; }

/* 自動入力の確認: 顧客カルテにも入れる(入力先ごとに短く。チェック済み・その場で直せる) */
.karte-box { background: var(--purple-soft); border-radius: 10px; padding: var(--sp-3) var(--sp-4) var(--sp-1); margin-bottom: var(--sp-3); }
.karte-box h3 { margin: 0 0 var(--sp-2); font-size: .875rem; color: var(--purple); display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.karte-box h3 .muted { font-weight: 600; }
.karte-group { margin-bottom: var(--sp-3); }
.karte-group h4 { margin: 0 0 var(--sp-1); font-size: .7812rem; color: var(--muted); }
.karte-row { display: flex; align-items: flex-start; gap: var(--sp-2); margin-bottom: var(--sp-2); }
.karte-row > input[type=checkbox] { width: 20px; height: 20px; min-height: 0; margin: 11px 0 0; flex: none; accent-color: var(--purple); }
.karte-row .kf { flex: 1; min-width: 0; display: grid; gap: var(--sp-1); }
.karte-row .kf2 { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-1); }
.karte-row input[data-f] { min-height: 38px; padding: 7px 10px; font-size: .875rem; }
.karte-row:has(> input[type=checkbox]:not(:checked)) .kf { opacity: .45; }
.karte-row .ktag { justify-self: start; font-size: .6875rem; font-weight: 700; color: var(--purple); background: var(--surface); border-radius: 4px; padding: 1px 6px; }
.karte-row .ktag.red { color: var(--red); }
.karte-box .transcript { margin-top: 0; }
.wh-clickable { cursor: pointer; transition: background-color .15s; }
.wh-clickable:hover, .wh-clickable:focus-visible { background: var(--surface-2); outline: none; }
.wh-rep.wh-clickable:hover, .wh-rep.wh-clickable:focus-visible { background: var(--primary-soft); }
.wh-links .wh-how-btn { flex-basis: 100%; }
.wh-how { display: flex; flex-direction: column; gap: var(--sp-3); }
.wh-how-lead { margin: 0; font-weight: 600; }
.wh-how-fig { margin: 0; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; background: var(--surface-2); }
.wh-how-fig img { display: block; width: 100%; max-height: 280px; object-fit: contain; object-position: top center; background: #fff; }
.wh-how-fig figcaption { padding: var(--sp-1) var(--sp-3); }
.wh-how h3 { margin: 0; font-size: .875rem; }
.wh-how-steps { margin: 0; padding-left: 1.4em; display: flex; flex-direction: column; gap: var(--sp-1); line-height: 1.6; }
.wh-how .btn-row { flex-wrap: wrap; justify-content: flex-end; }
.wh-how .small { margin: 0; }
.wh-links .wh-how-btn { text-align: left; }

/* 入力欄の「AI」: 録音・メモを選び、話題ごとの要約をチェックして入れる */
.ai-panel { display: grid; gap: var(--sp-3); }
.ai-rec-pick { margin: 0; }
.ai-topics { display: grid; gap: var(--sp-2); }
.ai-topic { display: flex; align-items: flex-start; gap: var(--sp-2); margin: 0; padding: var(--sp-2) var(--sp-3); border: 1px solid var(--border); border-radius: 8px; background: var(--surface); color: var(--text); font-weight: 400; font-size: .875rem; line-height: 1.6; cursor: pointer; }
.ai-topic:has(input:checked) { border-color: var(--primary); background: var(--primary-soft); }
.ai-topic input { width: 20px; height: 20px; min-height: 0; margin: 2px 0 0; flex: none; }
.ai-topic b { display: block; font-size: .8125rem; }
.ai-insert { display: flex; flex-wrap: wrap; gap: var(--sp-2); margin-top: var(--sp-3); }
.ai-insert .btn { flex: 1 1 auto; }
.ai-panel .transcript pre { max-height: 40vh; }
.ai-panel .transcript .btn { margin-top: var(--sp-2); }
.ai-mode { display: flex; align-items: center; gap: var(--sp-3); flex-wrap: wrap; font-size: .8125rem; font-weight: 600; color: var(--muted); }
.ai-mode label { display: inline-flex; align-items: center; gap: 4px; margin: 0; color: var(--text); font-size: .875rem; }
.ai-mode input { width: 18px; height: 18px; min-height: 0; margin: 0; }
.ai-fix summary { cursor: pointer; color: var(--primary); font-weight: 600; font-size: .8125rem; }
.ai-fix .ai-actions { margin-top: var(--sp-2); }
.ai-fix #ai-result { margin-top: var(--sp-2); }
.ai-insert .btn:disabled { opacity: .45; cursor: default; }

/* ---------- 全体像: 法人営業のPDCA ---------- */
.wh-pdca { --pd-plan: var(--green); --pd-do: var(--primary); --pd-check: var(--purple); --pd-act: var(--orange);
  --pd-plan-soft: var(--green-soft); --pd-do-soft: var(--primary-soft); --pd-check-soft: var(--purple-soft); --pd-act-soft: var(--orange-soft); }
.wh-pdca h2 .muted { margin-left: var(--sp-2); font-weight: 500; }
/* 円を真ん中に、4つの段を左右に2段ずつ。PC(1440×900・1920×1080)で円と4段が1画面に収まる高さにする */
.wh-pdca-layout { display: grid; grid-template-columns: 1fr minmax(220px, 260px) 1fr; grid-template-areas: "plan ring do" "act ring check"; gap: var(--sp-3) var(--sp-4); align-items: stretch; max-width: 1500px; margin: 0 auto; }
.wh-pdca-card.pd-plan { grid-area: plan; } .wh-pdca-card.pd-do { grid-area: do; } .wh-pdca-card.pd-check { grid-area: check; } .wh-pdca-card.pd-act { grid-area: act; }
.wh-pdca-ring { grid-area: ring; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--sp-3); }
.wh-pdca-svg { width: 100%; max-width: 260px; height: auto; overflow: visible; }
.wh-pdca-arc { cursor: pointer; outline: none; }
.wh-pdca-arc path { transition: stroke-width .15s; }
.wh-pdca-arc:hover path, .wh-pdca-arc:focus-visible path { stroke-width: 52px; }
.wh-pdca-arc.pd-plan path { stroke: var(--pd-plan); } .wh-pdca-arc.pd-plan polygon { fill: var(--pd-plan); } .wh-pdca-arc.pd-plan .wh-pdca-ico { stroke: var(--pd-plan); }
.wh-pdca-arc.pd-do path { stroke: var(--pd-do); } .wh-pdca-arc.pd-do polygon { fill: var(--pd-do); } .wh-pdca-arc.pd-do .wh-pdca-ico { stroke: var(--pd-do); }
.wh-pdca-arc.pd-check path { stroke: var(--pd-check); } .wh-pdca-arc.pd-check polygon { fill: var(--pd-check); } .wh-pdca-arc.pd-check .wh-pdca-ico { stroke: var(--pd-check); }
.wh-pdca-arc.pd-act path { stroke: var(--pd-act); } .wh-pdca-arc.pd-act polygon { fill: var(--pd-act); } .wh-pdca-arc.pd-act .wh-pdca-ico { stroke: var(--pd-act); }
.wh-pdca-letter { fill: #fff; font-size: 1.25rem; font-weight: 800; text-anchor: middle; dominant-baseline: middle; pointer-events: none; }
.wh-pdca-jp { fill: #fff; font-size: .6875rem; font-weight: 700; text-anchor: middle; dominant-baseline: middle; pointer-events: none; }
.wh-pdca-ico { fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; pointer-events: none; }
.wh-pdca-ico.core { stroke: var(--primary); }
.wh-pdca-core { fill: var(--primary-soft); }
.wh-pdca-core-t { fill: var(--text); font-size: .9375rem; font-weight: 800; text-anchor: middle; }
.wh-pdca-core-s { fill: var(--muted); font-size: .5938rem; text-anchor: middle; }
.wh-pdca-rhythm { display: flex; gap: var(--sp-2); justify-content: center; flex-wrap: wrap; }
.wh-rh { width: 68px; height: 68px; border-radius: 50%; border: 2px dashed var(--border); background: var(--surface); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; cursor: pointer; font: inherit; color: var(--text); padding: 4px; }
.wh-rh:hover { border-color: var(--primary); }
.wh-rh b { font-size: .875rem; }
.wh-rh span { font-size: .6562rem; color: var(--muted); line-height: 1.3; text-align: center; }
.wh-pdca-card { border: 1px solid var(--border); border-left: 4px solid var(--pd-c); border-radius: var(--radius); display: grid; grid-template-columns: minmax(120px, 30%) 1fr; background: var(--surface); }
.wh-pdca-body { padding: var(--sp-3); display: flex; flex-direction: column; gap: var(--sp-2); min-width: 0; }
.wh-pdca-card.pd-plan { --pd-c: var(--pd-plan); --pd-s: var(--pd-plan-soft); } .wh-pdca-card.pd-do { --pd-c: var(--pd-do); --pd-s: var(--pd-do-soft); }
.wh-pdca-card.pd-check { --pd-c: var(--pd-check); --pd-s: var(--pd-check-soft); } .wh-pdca-card.pd-act { --pd-c: var(--pd-act); --pd-s: var(--pd-act-soft); }
.wh-pdca-card header { display: flex; align-items: center; gap: var(--sp-3); }
.wh-pdca-card header > div { display: flex; flex-direction: column; gap: 2px; }
.wh-pdca-card header b { font-size: 1rem; }
.wh-pdca-card header small { margin-left: 6px; font-size: .75rem; color: var(--muted); font-weight: 600; }
.wh-pdca-badge { flex: none; width: 34px; height: 34px; border-radius: 50%; background: var(--pd-c); color: #fff; font-weight: 800; font-size: 20px; display: grid; place-items: center; }
.wh-pdca-card p { margin: 0; font-size: .8125rem; line-height: 1.6; }
.wh-pdca-who { display: flex; flex-wrap: wrap; gap: 4px; }
.wh-who { font-size: .7188rem; font-weight: 700; padding: 1px 8px; border-radius: 10px; }
.wh-who-rep { background: var(--primary-soft); color: var(--primary); }
.wh-who-mgr { background: var(--purple-soft); color: var(--purple); }
.wh-who-gm { background: var(--green-soft); color: var(--green); }
.wh-who.me { box-shadow: inset 0 0 0 1.5px currentColor; }
.wh-pdca-facts { display: flex; flex-wrap: wrap; gap: 6px; }
.wh-pdca-fact { background: var(--pd-s); color: var(--text); border-radius: 8px; padding: 2px 8px; font-size: .7812rem; cursor: pointer; }
.wh-pdca-fact b { font-size: 1rem; color: var(--pd-c); margin-right: 1px; }
.wh-pdca-screens { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; }
.chip-sm { font-size: .75rem; border: 1px solid var(--border); border-radius: 10px; padding: 0 8px; background: var(--surface-2); }
.wh-pdca-links { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px var(--sp-3); margin-top: auto; }
.wh-pdca-links .muted { flex: 1 1 100%; }
.wh-pdca-links .link-btn { color: var(--pd-c); font-weight: 700; text-decoration: none; padding: 0; }
.wh-pdca-foot { margin: var(--sp-3) 0 0; text-align: center; }
@keyframes wh-flash { 0%, 100% { box-shadow: var(--shadow); } 30% { box-shadow: 0 0 0 4px var(--primary); } }
.wh-flash { animation: wh-flash 1.6s ease 2; }
@media (max-width: 1100px) and (min-width: 761px) {
  .wh-pdca-layout { grid-template-columns: 1fr 1fr; grid-template-areas: "ring ring" "plan do" "act check"; }
}
@media (max-width: 760px) {
  .wh-pdca-layout { grid-template-columns: 1fr; grid-template-areas: "ring" "plan" "do" "check" "act"; }
  .wh-pdca-svg { max-width: 260px; }
  .wh-pdca-card { grid-template-columns: 1fr; }
  .wh-pdca-scene { aspect-ratio: 16 / 7; min-height: 0; }
}
@media (prefers-reduced-motion: reduce) { .wh-flash { animation: none; outline: 3px solid var(--primary); } }
.wh-pdca-scene { margin: 0; position: relative; min-height: 100%; }
.wh-art { display: block; width: 100%; height: 100%; object-fit: cover; background: var(--surface-2); }
.wh-pdca-scene .wh-art { position: absolute; inset: 0; }
.wh-head > div:first-child { flex: 1 1 520px; min-width: 0; }
.wh-head .filters { flex: none; flex-wrap: wrap; }
.wh-pdca-card { overflow: hidden; }
/* 多面分析(analysis.js): 切り口の選択、指標のチップ、色の濃さで大きいところを示す表 */
.pv-actions { display: inline-flex; gap: var(--sp-2); align-items: center; flex-wrap: wrap; }
.pv-actions .drill { font-weight: 700; font-size: .8125rem; }
.pv-panel .sr-label:first-of-type { margin-top: var(--sp-2); }
.pv-controls { display: flex; flex-wrap: nowrap; gap: var(--sp-3); margin: var(--sp-4) 0 var(--sp-3); overflow-x: auto; padding: 2px; scrollbar-width: thin; }
.pv-controls label { flex: none; }
.pv-controls select { text-overflow: ellipsis; }
.pv-controls label { display: flex; flex-direction: column; gap: var(--sp-1); font-size: .7812rem; font-weight: 700; color: var(--muted); margin: 0; }
.pv-controls select { width: auto; min-width: 150px; }
.pv-measures { display: flex; flex-wrap: wrap; gap: var(--sp-2); align-items: center; margin-bottom: var(--sp-3); }
.pv-measures .chip-btn { padding: 4px 10px; font-size: .7812rem; }
.chip-btn.saved { padding: 0; gap: 0; }
.chip-btn .pv-chip, .chip-btn .pv-del { border: 0; background: none; color: inherit; font: inherit; cursor: pointer; display: inline-flex; align-items: center; gap: 5px; }
.chip-btn .pv-chip { padding: 6px 4px 6px 12px; }
.chip-btn .pv-del { padding: 6px 10px 6px 4px; opacity: .6; }
.chip-btn .pv-del:hover { opacity: 1; color: var(--red); }
.pv-table th.pv-row, .pv-table tbody th { text-align: left; font-weight: 600; white-space: nowrap; }
.pv-table td.pv-cell { background: color-mix(in srgb, var(--primary) calc(var(--h, 0) * 28%), transparent); }
.pv-table td.pv-cell.down { color: var(--red); }
.pv-table [data-kpi-list] { cursor: pointer; }
.pv-table [data-kpi-list]:hover { text-decoration: underline; }
.pv-table tfoot th, .pv-table tfoot td { font-weight: 700; }
.pv-cross td:last-child, .pv-cross th:last-child { border-left: 2px solid var(--border); font-weight: 700; }
@media (max-width: 760px) {
  .pv-controls { gap: var(--sp-2); }
  .pv-controls select { min-width: 0; width: 9.5em; }
}
.pv-panel .sr-presets .chip-btn { white-space: nowrap; }

/* ---------- さくらのデータの答え・分析レポート(reports.js) ---------- */
.b-msg.bot.data .b-bubble { max-width: 100%; width: auto; flex: 1 1 auto; }
.b-data { margin-top: var(--sp-3); border-top: 1px solid var(--border); padding-top: var(--sp-3); display: flex; flex-direction: column; gap: var(--sp-2); }
.b-data-head { display: flex; justify-content: space-between; gap: var(--sp-2); align-items: baseline; }
.b-data-head span { font-weight: 700; color: var(--primary); white-space: nowrap; }
.b-cond { font-size: .75rem; color: var(--muted); }
.b-data .table-wrap { max-height: 260px; }
.b-data table { font-size: .7812rem; }
.b-insight { background: var(--primary-soft); border-radius: 10px; padding: var(--sp-2) var(--sp-3); font-size: .8125rem; }
.b-insight > b { display: block; font-size: .75rem; color: var(--primary); }
.b-notes { margin: 0; padding-left: 1.2em; font-size: .7188rem; color: var(--muted); }
.b-data-actions { display: flex; flex-wrap: wrap; gap: var(--sp-2); }
.b-similar { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: var(--sp-2); font-size: .7812rem; color: var(--muted); }
.b-similar .butler-link { flex-direction: column; align-items: flex-start; line-height: 1.3; }
.b-similar .butler-link small { color: var(--muted); font-weight: 400; }
.rp-tools { display: flex; gap: var(--sp-2); flex-wrap: wrap; margin-bottom: var(--sp-3); }
.rp-tools input { flex: 1; min-width: 200px; }
.rp-tools select { width: auto; }
.rp-topcheck { display: inline-flex; align-items: center; gap: var(--sp-1); font-size: .8125rem; }
.rp-tools .rp-topcheck input { flex: none; min-width: 0; width: auto; height: auto; margin: 0; }
.rp-topnames { color: var(--yellow); }
.rp-toppeople { margin: calc(-1 * var(--sp-1)) 0 var(--sp-3); }
.rp-list { display: flex; flex-direction: column; gap: var(--sp-2); }
.rp-item { display: flex; gap: var(--sp-2); align-items: center; flex-wrap: wrap; border: 1px solid var(--border); border-radius: 12px; padding: var(--sp-1); }
.rp-item:hover { border-color: var(--primary); }
.rp-open { flex: 1; min-width: 240px; display: flex; flex-wrap: wrap; gap: 4px var(--sp-2); align-items: center; text-align: left; background: none; border: 0; padding: var(--sp-2); font: inherit; color: inherit; cursor: pointer; }
.rp-open .rp-title { font-weight: 700; font-size: .9375rem; color: var(--primary); }
.rp-open .muted { flex-basis: 100%; }
.rp-acts { display: flex; flex-wrap: wrap; gap: var(--sp-2); padding: 0 var(--sp-2); }
.rp-dup { border-left: 3px solid var(--orange); padding-left: var(--sp-2); margin-bottom: var(--sp-2); }
.rp-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: var(--sp-2); }
.rp-card { display: flex; flex-direction: column; gap: 2px; text-align: left; border: 1px solid var(--border); border-radius: 12px; padding: var(--sp-3); background: var(--surface); font: inherit; color: inherit; cursor: pointer; }
.rp-card b { color: var(--primary); }
.rp-card:hover { border-color: var(--primary); }
.rp-notes ul { margin: 0; padding-left: 1.2em; }
.rp-head { flex-direction: column; align-items: stretch; gap: var(--sp-1); }
.rp-head > p { margin: 0; }
.rp-count { margin-left: var(--sp-2); font-weight: 600; }
.rp-title-row { display: flex; flex-wrap: wrap; gap: var(--sp-2); align-items: center; }
.rp-title-input { font-size: 1.25rem; font-weight: 700; border: 1px solid transparent; background: transparent; padding: 4px 8px; margin-left: -8px; width: auto; min-width: 240px; max-width: 100%; flex: 1; color: var(--text); }
.rp-title-input:hover, .rp-title-input:focus { border-color: var(--border); background: var(--surface); }
.rp-actions { display: flex; flex-wrap: wrap; gap: var(--sp-2); }
.rp-filters { display: flex; flex-wrap: wrap; gap: var(--sp-2); align-items: center; }
.rp-filters .chip-btn.active { padding-right: 0; }
.rp-cond-text { margin: var(--sp-2) 0 0; }
.rp-notes-list { margin: var(--sp-3) 0 0; padding-left: 1.2em; }
.rp-defs dt { font-weight: 700; margin-top: var(--sp-1); }
.rp-defs dd { margin: 0 0 0 var(--sp-3); color: var(--muted); }
.rp-insight h2 .butler-svg, #rp-ask .butler-svg { width: 22px; height: 22px; vertical-align: middle; margin-right: 6px; }
.rp-insight-text { line-height: 1.8; }
.rp-prop { display: flex; justify-content: space-between; gap: var(--sp-3); flex-wrap: wrap; border-top: 1px solid var(--border); padding: var(--sp-3) 0; }
.rp-prop:first-of-type { border-top: 0; }
.rp-origin { margin: 0; }
.rp-checks { display: flex; flex-wrap: wrap; gap: var(--sp-1) var(--sp-3); max-height: 320px; overflow: auto; margin-bottom: var(--sp-3); }
.rp-check { display: inline-flex; gap: 6px; align-items: center; margin: 0; font-weight: 600; color: var(--text); }
.rp-check input { width: auto; margin: 0; }
.rp-users { flex-direction: column; flex-wrap: nowrap; }
.rp-link { display: flex; gap: var(--sp-2); margin-bottom: var(--sp-3); }
.rp-link input { flex: 1; font-size: .7812rem; }
label.check { display: flex; gap: 8px; align-items: center; color: var(--text); font-weight: 600; }
label.check input { width: auto; margin: 0; }
.rp-vers { list-style: none; padding: 0; margin: 0; }
.rp-ver { display: flex; justify-content: space-between; gap: var(--sp-3); border-top: 1px solid var(--border); padding: var(--sp-3) 0; }
@media (max-width: 760px) {
  .rp-title-input { font-size: 1.0625rem; min-width: 0; }
  .rp-actions .btn { flex: 1 1 auto; }
}
.rec-start-big { min-height: 52px; font-size: 1rem; }
.lib-list .lib-sum { flex-basis: 100%; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.lib-rest { margin-top: var(--sp-4); }
.lib-rest summary { cursor: pointer; color: var(--primary); font-weight: 600; font-size: .8125rem; }
.rec-choice { display: grid; gap: var(--sp-2); margin: var(--sp-3) 0; }
.rec-choice .btn { min-height: 48px; }
.rec-audio { display: grid; gap: 4px; margin: 0 0 var(--sp-3); flex-basis: 100%; }
.rec-audio audio { width: 100%; }
.lib-setting { margin-top: var(--sp-4); padding-top: var(--sp-3); border-top: 1px solid var(--border); display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2); }
.lib-setting select { width: auto; min-height: 36px; padding: 4px 8px; }

/* ---------- 活動を記録(案件画面・顧客カルテ・上の「活動を記録」で共通の大きな入力パネル) ---------- */
.log-panel { background: var(--surface); border: 2px solid var(--primary); border-radius: 14px; padding: var(--sp-4) var(--sp-5); box-shadow: 0 4px 16px rgba(0, 47, 123, .10); min-width: 0; }
.lp-head { display: grid; gap: var(--sp-2); margin-bottom: var(--sp-3); }
.lp-title { margin: 0; font-size: 1.25rem; color: var(--primary); display: flex; align-items: center; gap: 8px; }
.lp-title .i { width: 22px; height: 22px; }
.lp-ai { margin: 0; padding: 6px 8px 6px 12px; background: var(--purple-soft); gap: 6px; }
.lp-ai-lbl { font-size: .8125rem; font-weight: 700; color: var(--purple); display: inline-flex; align-items: center; gap: 4px; }
.lp-ai-lbl .i { width: 15px; height: 15px; }
.lp-ai .btn { background: var(--surface); }
.lp-form { display: grid; gap: var(--sp-3); }
.lp-form label { display: block; margin: 0; font-weight: 700; font-size: .8125rem; }
.lp-form label.chk-line { display: flex; }
.lp-form label.lp-kind { display: block; }
.lp-form label > input:not([type=checkbox]):not([type=radio]), .lp-form label > select, .lp-form label > textarea { display: block; width: 100%; }
.lp-deal select { margin-top: 4px; }
.lp-kinds { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: var(--sp-2); }
.lp-kind { position: relative; cursor: pointer; }
.lp-kind input { position: absolute; opacity: 0; pointer-events: none; }
.lp-kind > span { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; min-height: 68px; border: 1.5px solid var(--border); border-radius: 12px; background: var(--surface-2); color: var(--text); transition: background .12s, border-color .12s, color .12s; }
.lp-kind > span .i { width: 24px; height: 24px; color: var(--primary); }
.lp-kind > span b { font-size: .875rem; white-space: nowrap; }
.lp-kind:hover > span { border-color: var(--primary); }
.lp-kind input:checked + span { background: var(--primary); border-color: var(--primary); color: var(--on-primary); box-shadow: 0 2px 8px rgba(0, 47, 123, .25); }
.lp-kind input:checked + span .i { color: #fff; }
.lp-kind input:focus-visible + span { outline: 3px solid var(--primary-soft); outline-offset: 2px; }
.lp-fields { display: grid; gap: var(--sp-3); }
.lp-with input { margin-top: 4px; max-width: 360px; }
.lp-text textarea { margin-top: 4px; min-height: 132px; font-size: .9375rem; line-height: 1.6; }
.lp-acts:empty { display: none; }
.lp-acts { display: grid; gap: var(--sp-2); }
.lp-acts .done-pick { margin: 0; }
.lp-next { border: 1px solid var(--border); border-radius: 10px; padding: 0 12px; }
.lp-next > summary { cursor: pointer; padding: 10px 0; font-weight: 700; font-size: .875rem; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; color: var(--primary); }
.lp-next > summary .i { width: 16px; height: 16px; }
.lp-next > summary .muted { font-weight: 400; }
.lp-next-body { padding-bottom: 4px; }
.lp-foot { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); flex-wrap: wrap; }
.lp-submit { font-size: 1rem; padding: 12px 32px; min-height: 48px; display: inline-flex; align-items: center; gap: 6px; margin-left: auto; }
.lp-submit .i { width: 18px; height: 18px; }
.act-ch { margin-right: 4px; }
.act-with { font-size: .75rem; font-weight: 700; color: var(--primary); background: var(--primary-soft); border-radius: 10px; padding: 1px 8px; margin-right: 4px; white-space: nowrap; }
.timeline li.is-auto .txt { color: var(--muted); }
@media (max-width: 760px) {
  .log-panel { padding: var(--sp-3); border-radius: 12px; }
  .lp-title { font-size: 1.125rem; }
  .lp-ai { width: 100%; }
  .lp-kinds { gap: 6px; }
  .lp-kind > span { min-height: 60px; border-radius: 10px; }
  .lp-kind > span b { font-size: .75rem; }
  .lp-with input { max-width: none; }
  .lp-submit { width: 100%; justify-content: center; }
}
/* 案件画面: 「活動を記録」を左上の主役に、その下に次のアクション、右に活動履歴 */
.deal-flow .flow-main { display: grid; gap: var(--sp-4); align-content: start; }
.deal-flow .acts { margin: 0; }
@media (max-width: 899px) { .deal-flow .flow-side { margin-top: var(--sp-4); } }
/* 顧客カルテの一番上: 活動を記録 + 活動履歴 */
.cu-loggrid { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--sp-4); }  /* 1列のときも中身(長い商談名のセレクトなど)で横に広がらない */
@media (min-width: 1000px) { .cu-loggrid { grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); align-items: start; } }
.cu-acts .timeline { max-height: 560px; overflow: auto; padding-right: 4px; }
.cu-acts .cu-actkinds { margin: 0 0 var(--sp-3); flex-wrap: wrap; }
.cu-acts h2 .muted { font-weight: 400; margin-left: 6px; }
/* 上の「活動を記録」ボタンと「＋」のメニュー */
#log-btn { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
#log-btn .i { width: 16px; height: 16px; }
@media (max-width: 760px) { #log-btn { display: none; } }
#log-btn .lb-short { display: none; }
.topbar.hc8 .topbar-right > #log-btn .lb-full { display: none; }
.topbar.hc8 .topbar-right > #log-btn .lb-short { display: inline; }
.topbar.hc8 .topbar-right > #log-btn { padding: 0 12px; }
.plus-menu { display: grid; gap: var(--sp-3); }
.plus-item { display: flex; align-items: center; gap: var(--sp-3); text-align: left; padding: 16px; border: 1.5px solid var(--border); border-radius: 12px; background: var(--surface); color: var(--text); cursor: pointer; font: inherit; }
.plus-item .i { width: 28px; height: 28px; color: var(--primary); flex: none; }
.plus-item b { display: block; font-size: 1.0625rem; }
.plus-item small { display: block; color: var(--muted); font-size: .8125rem; margin-top: 2px; }
.plus-item.primary { border-color: var(--primary); background: var(--primary-soft); }
.plus-item:hover { border-color: var(--primary); }
.ql-pick input { margin-top: 4px; font-size: 1rem; }
.ql-list { display: grid; gap: 6px; margin-top: var(--sp-2); }
.ql-item { display: grid; grid-template-columns: 1fr auto; gap: 2px 8px; text-align: left; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); color: var(--text); cursor: pointer; font: inherit; }
.ql-item b { grid-column: 1; }
.ql-item .small { grid-column: 1; }
.ql-item .ql-go { grid-column: 2; grid-row: 1 / span 2; align-self: center; font-size: 1.375rem; color: var(--primary); }
.ql-item:hover { border-color: var(--primary); background: var(--primary-soft); }
/* 活動履歴の画面 */
.act-head .btn.big { font-size: .9375rem; padding: 10px 20px; display: inline-flex; align-items: center; gap: 6px; }
.act-head .btn.big .i { width: 18px; height: 18px; }
.act-kinds-row { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: var(--sp-2); }
.act-kind-chip { display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; gap: 0 8px; align-items: center; text-align: left; padding: 10px 12px; border: 1.5px solid var(--border); border-radius: 12px; background: var(--surface); color: var(--text); cursor: pointer; font: inherit; }
.act-kind-chip .i { grid-row: 1 / span 2; width: 22px; height: 22px; color: var(--primary); }
.act-kind-chip span { font-size: .8125rem; color: var(--muted); }
.act-kind-chip b { font-size: 1.125rem; }
.act-kind-chip.active { border-color: var(--primary); background: var(--primary); color: var(--on-primary); }
.act-kind-chip.active .i, .act-kind-chip.active span { color: var(--on-primary); }
.act-people > summary { cursor: pointer; display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.act-people > summary h2 { margin: 0; display: inline-flex; align-items: center; gap: 6px; }
.act-people[open] > summary { margin-bottom: var(--sp-3); }
.act-days { display: grid; gap: var(--sp-3); }
.act-day-h { display: flex; align-items: center; gap: 8px; font-size: 1rem; margin: 0 0 var(--sp-3); }
.act-day-h .muted { font-weight: 400; }
.empty-act p { margin: 0 0 4px; }
@media (max-width: 760px) {
  .act-kinds-row { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .act-kind-chip { padding: 8px; }
  .act-kind-chip b { font-size: 1rem; }
}
/* 案件は押すと開く: カード・行にさわったら浮き上がり、案件名は下線つきのリンクに */
.card { transition: box-shadow .12s, transform .12s; }
.card:hover { box-shadow: 0 4px 14px rgba(16, 24, 40, .16); transform: translateY(-1px); }
.card .title::after { content: " ›"; color: var(--primary); opacity: 0; transition: opacity .12s; }
.card:hover .title::after { opacity: 1; }
.todo .meta a[data-open] { text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
.todo .meta a[data-open]::after { content: " ›"; }
.cu-deal { transition: border-color .12s, background .12s; }
.cu-deal:hover { border-color: var(--primary); }
.sr-bar .owner-sel { flex: none; width: 12em; min-width: 0; text-overflow: ellipsis; }
@media (max-width: 760px) { .sr-bar .owner-sel { width: 9.5em; } }
/* 活動履歴の絞り込みも1行(収まらなければ横にスクロール) */
.filters.act-filters { flex-wrap: nowrap; overflow-x: auto; padding: 2px; margin: -2px; scrollbar-width: thin; }
.filters.act-filters > * { flex: none; }
@media (max-width: 760px) {
  .filters.act-filters .seg.compact { width: auto; }
  .filters.act-filters select, .filters.act-filters .org-filter select { flex: none; width: 9.5em; }
}
/* ---------- デジタルマーケティング(marketing.js) ---------- */
.mk-score { display: inline-flex; align-items: center; padding: 1px 8px; border-radius: 20px; font-size: .75rem; font-weight: 800; white-space: nowrap; margin-left: 6px; vertical-align: middle; }
.mk-score.hot { background: var(--orange-soft); color: var(--orange); }
.mk-score.warm { background: var(--yellow-soft); color: var(--yellow); }
.mk-score.cold { background: var(--gray-soft); color: var(--muted); }
.card .title .mk-score { margin-left: 4px; font-size: .6875rem; padding: 0 6px; }
.mk-gauge { display: flex; flex-direction: column; align-items: center; justify-content: center; min-width: 64px; padding: 6px 8px; border-radius: 10px; line-height: 1.2; }
.mk-gauge b { font-size: 1.25rem; }
.mk-gauge span { font-size: .6875rem; font-weight: 600; }
.mk-gauge.hot { background: var(--orange-soft); color: var(--orange); }
.mk-gauge.warm { background: var(--yellow-soft); color: var(--yellow); }
.mk-why { background: var(--orange-soft); color: var(--text); border-radius: 8px; padding: var(--sp-2) var(--sp-3); }
.mk-tabs { flex-wrap: wrap; }
.mk-mode { background: var(--yellow-soft); border-radius: 10px; padding: var(--sp-2) var(--sp-3); font-size: .8438rem; line-height: 1.6; }
.mk-mode.live { background: var(--green-soft); }
.badge.mk-line-badge { background: #06c755; color: #04210e; }
.badge.mk-sms-badge { background: #3b4a5e; color: #fff; }
.mk-linebubble.mk-smsbubble { background: var(--surface-2); }
.mk-linebubble { background: var(--green-soft); border-radius: 14px 14px 14px 4px; padding: var(--sp-2) var(--sp-3); white-space: pre-wrap; word-break: break-word; font-size: .875rem; line-height: 1.6; max-width: 520px; }
.mk-linebubble.out { background: var(--surface-2); border-radius: 14px 14px 4px 14px; margin-left: auto; }
.mk-line-thread { display: flex; flex-direction: column; gap: var(--sp-2); max-height: 320px; overflow-y: auto; margin-bottom: var(--sp-3); }
.mk-line-code { font-family: ui-monospace, monospace; letter-spacing: .05em; font-size: 1rem; }
.mk-howto { margin: 0 0 var(--sp-3); padding-left: 1.4em; line-height: 1.7; }
.mk-line-btn { margin-left: var(--sp-2); }
.mk-actions { display: flex; flex-wrap: wrap; gap: var(--sp-2); align-items: center; }
.mk-kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); margin-bottom: 0; }
.mk-kpis .mk-def { margin-top: var(--sp-2); padding-top: var(--sp-2); border-top: 1px dashed var(--border); font-size: .75rem; line-height: 1.5; color: var(--muted); }
.mk-forms { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: var(--sp-3); }
.mk-form-card { border: 1px solid var(--border); border-radius: 10px; padding: var(--sp-3); display: flex; flex-direction: column; gap: var(--sp-2); }
.mk-url code, .mk-code code { font-size: .7812rem; word-break: break-all; }
.mk-code { display: flex; gap: var(--sp-2); align-items: flex-start; background: var(--surface-2); border-radius: 8px; padding: var(--sp-2) var(--sp-3); margin: var(--sp-2) 0 var(--sp-3); }
.mk-code code { flex: 1; white-space: pre-wrap; }
.mk-map { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: var(--sp-2); }
.mk-chips { display: flex; flex-wrap: wrap; gap: var(--sp-2); align-items: center; margin: var(--sp-2) 0; }
.mk-preview { max-height: 360px; }
.mk-tpls { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: var(--sp-2); }
.mk-tpl { display: flex; flex-direction: column; gap: 2px; text-align: left; border: 1px solid var(--border); background: var(--surface); border-radius: 10px; padding: var(--sp-2) var(--sp-3); cursor: pointer; }
.mk-tpl:hover { border-color: var(--primary); }
.mk-aud { background: var(--primary-soft); border-radius: 8px; padding: var(--sp-2) var(--sp-3); display: flex; flex-wrap: wrap; gap: var(--sp-2); align-items: baseline; }
.mk-aud-list { flex-basis: 100%; }
.mk-aud-list > summary { cursor: pointer; font-size: .875rem; color: var(--primary); font-weight: 600; }
.mk-aud-list .table-wrap { max-height: 280px; overflow: auto; margin-top: var(--sp-2); background: var(--surface); border-radius: 8px; }
.mk-mailprev { border: 1px solid var(--border); border-radius: 10px; padding: var(--sp-3); display: flex; flex-direction: column; gap: var(--sp-2); }
.mk-mailbody { white-space: pre-wrap; font-size: .875rem; line-height: 1.7; background: var(--surface-2); border-radius: 8px; padding: var(--sp-3); max-height: 420px; overflow: auto; word-break: break-all; }
.mk-scn { border: 1px solid var(--border); border-radius: 10px; padding: var(--sp-3); display: flex; flex-direction: column; gap: var(--sp-2); margin-top: var(--sp-3); }
.mk-scn-head { display: flex; flex-wrap: wrap; gap: var(--sp-2); align-items: center; }
.mk-steps { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.mk-step { display: inline-block; padding: 3px 10px; border-radius: 8px; font-size: .8125rem; font-weight: 600; background: var(--surface-2); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mk-step.k-wait { background: var(--gray-soft); color: var(--muted); }
.mk-step.k-email { background: var(--primary-soft); color: var(--primary); }
.mk-step.k-action { background: var(--green-soft); color: var(--green); }
.mk-step.k-check { background: var(--yellow-soft); color: var(--yellow); }
.mk-arrow { color: var(--muted); font-size: .75rem; }
.mk-step-row { display: grid; grid-template-columns: 180px 1fr auto; gap: var(--sp-2); align-items: start; padding: var(--sp-2) 0; border-top: 1px solid var(--border); }
.mk-step-in { display: flex; flex-direction: column; gap: 6px; }
.mk-step-in input[type=number] { width: 80px; display: inline-block; }
.mk-step-btns { display: flex; gap: 4px; }
.mk-fields { border: 1px solid var(--border); border-radius: 8px; padding: var(--sp-2) var(--sp-3); display: flex; flex-wrap: wrap; gap: var(--sp-3); }
.mk-inline { display: flex; gap: var(--sp-2); flex-wrap: wrap; }
.mk-inline input { flex: 1; min-width: 200px; }
.mk-effect td, .mk-effect th { white-space: nowrap; }
@media (max-width: 760px) {
  .mk-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .mk-step-row { grid-template-columns: 1fr auto; }
  .mk-step-row .mk-step-in { grid-column: 1 / -1; }
}
/* ---------- カレンダー(calendar.js) ---------- */
.act-add.act-edit { grid-template-columns: 1fr 150px 110px auto; }
.act-time { color: var(--text); font-size: .8125rem; }
@media (max-width: 760px) { .act-add.act-edit { grid-template-columns: 1fr 1fr; } .act-add.act-edit input[name=text], .act-add.act-edit .act-edit-btns { grid-column: 1 / -1; } }
.cal-page-head { margin-bottom: 0; }
.cal-h1 { margin: 0; font-size: 1.375rem; }
.cal-head-btns { margin-top: 0; }
.cal-panel { margin-bottom: 0; display: flex; flex-direction: column; gap: var(--sp-3); }
.cal-bar { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); flex-wrap: wrap; }
.cal-nav { display: flex; align-items: center; gap: var(--sp-1); }
.cal-nav .icon-only { min-width: 34px; font-size: 1.125rem; line-height: 1; }
.cal-title { margin: 0 0 0 var(--sp-2); font-size: 1.125rem; white-space: nowrap; }
.cal-people { display: flex; align-items: center; gap: var(--sp-2); flex-wrap: wrap; }
.cal-person { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--border); border-radius: 20px; padding: 3px 6px 3px 10px; font-size: .8125rem; font-weight: 600; background: var(--surface); }
.cal-person i { width: 10px; height: 10px; border-radius: 50%; background: var(--c); }
.cal-person button { border: 0; background: none; cursor: pointer; color: var(--muted); font-size: .9375rem; padding: 0 4px; line-height: 1; }
.cal-people select { width: auto; min-height: 34px; padding: 4px 8px; font-size: .8125rem; }
.cal-legend { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: .7812rem; color: var(--muted); }
.cal-key { display: inline-flex; align-items: center; gap: 5px; }
.cal-key i { width: 12px; height: 12px; border-radius: 3px; background: var(--primary); }
.cal-key.t-action i { background: var(--primary); }
.cal-key.t-follow i { background: var(--purple); }
.cal-key.t-event i { background: var(--surface); border: 1.5px solid var(--muted); }
.cal-key.t-activity i { background: var(--green); }
.cal-key-sep { flex-basis: 100%; height: 0; }
.cal-hint { margin: 0; }
.cal-loading { padding: 40px 0; text-align: center; }
/* 予定1件 */
.cal-item { --c: var(--primary); display: flex; align-items: baseline; gap: 4px; width: 100%; min-width: 0; text-align: left; border: 0; border-left: 3px solid var(--c);
  background: color-mix(in srgb, var(--c) 12%, var(--surface)); color: var(--text); border-radius: 5px; padding: 2px 6px; font-size: .7812rem; line-height: 1.35; cursor: pointer; overflow: hidden; }
.cal-item:hover { background: color-mix(in srgb, var(--c) 22%, var(--surface)); }
.cal-item.t-follow { --c: var(--purple); border-left-style: dashed; }
.cal-item.t-event { --c: var(--muted); background: var(--surface); border: 1px solid var(--border); border-left: 3px solid var(--c); }
.cal-item.t-activity { --c: var(--green); opacity: .85; }
.cal-item.by-person { background: color-mix(in srgb, var(--c) 12%, var(--surface)); }
.cal-item.by-person.t-event { background: var(--surface); }
.cal-item.by-person.t-activity { background: repeating-linear-gradient(135deg, color-mix(in srgb, var(--c) 10%, var(--surface)) 0 6px, var(--surface) 6px 9px); }
.cal-item.late:not(.by-person) { --c: var(--red); }
.cal-item.dragging { opacity: .4; }
.cal-item[draggable] { cursor: grab; }
.cal-time { font-weight: 700; font-variant-numeric: tabular-nums; flex: none; white-space: nowrap; }
.cal-txt { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; }
.cal-co { color: var(--muted); margin-left: 4px; }
.cal-who { flex: none; color: var(--muted); font-size: .7188rem; }
.cal-g { display: inline-block; font-size: .625rem; font-weight: 800; color: #fff; background: #4285f4; border-radius: 3px; padding: 0 3px; margin-right: 3px; vertical-align: 1px; }
/* 週・日 */
.cal-grid { --cols: 7; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.cal-grid-head, .cal-allday, .cal-scroll { display: grid; grid-template-columns: 52px repeat(var(--cols), minmax(0, 1fr)); }
.cal-grid-head { background: var(--surface-2); border-bottom: 1px solid var(--border); }
.cal-colhead { padding: 6px 4px; text-align: center; font-weight: 700; font-size: .8125rem; border-left: 1px solid var(--border); display: flex; align-items: center; justify-content: center; gap: 6px; }
.cal-colhead i { width: 10px; height: 10px; border-radius: 50%; }
.cal-colhead.today { color: var(--orange); }
.cal-colhead .link { font-weight: 700; color: inherit; background: none; border: 0; cursor: pointer; }
.cal-gutter { display: flex; align-items: center; justify-content: center; }
.cal-allday { border-bottom: 1px solid var(--border); }
.cal-allday-cell { border-left: 1px solid var(--border); padding: 3px; display: flex; flex-direction: column; gap: 2px; min-height: 30px; cursor: copy; }
.cal-scroll { max-height: 640px; overflow-y: auto; position: relative; }
.cal-times { position: relative; }
.cal-hour { position: relative; border-top: 1px solid transparent; }
.cal-hour span { position: absolute; top: -8px; right: 6px; font-size: .6875rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.cal-hour:first-child span { top: 2px; }
.cal-col { position: relative; border-left: 1px solid var(--border); }
.cal-col.today { background: color-mix(in srgb, var(--orange) 4%, transparent); }
.cal-slot { position: absolute; left: 0; right: 0; border-top: 1px solid var(--border); cursor: copy; }
.cal-slot::after { content: ""; position: absolute; left: 0; right: 0; top: 50%; border-top: 1px dotted color-mix(in srgb, var(--border) 70%, transparent); }
.cal-pos { position: absolute; z-index: 1; }
.cal-pos .cal-item { height: 100%; display: block; }
.cal-pos .cal-time { margin-right: 4px; }
.cal-pos .cal-txt { white-space: normal; display: inline; }
.cal-pos .cal-who { margin-left: 4px; }
.cal-now { position: absolute; left: 0; right: 0; border-top: 2px solid var(--red); z-index: 2; pointer-events: none; }
.cal-now::before { content: ""; position: absolute; left: -4px; top: -5px; width: 8px; height: 8px; border-radius: 50%; background: var(--red); }
.drop-over { background: var(--primary-soft) !important; }
/* 月 */
.cal-month { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.cal-wd { text-align: center; font-size: .75rem; font-weight: 700; color: var(--muted); padding: 4px 0; background: var(--surface-2); border-bottom: 1px solid var(--border); }
.cal-wd.we { color: var(--red); }
.cal-cell { min-height: 108px; border-top: 1px solid var(--border); border-left: 1px solid var(--border); padding: 3px; display: flex; flex-direction: column; gap: 2px; min-width: 0; cursor: copy; }
.cal-month > .cal-cell:nth-child(7n + 1) { border-left: 0; }
.cal-month > .cal-wd + .cal-cell, .cal-month > .cal-cell:nth-child(-n + 14) { border-top: 0; }
.cal-cell.out { background: var(--surface-2); }
.cal-cell.out .cal-dnum { color: var(--muted); }
.cal-cell.today .cal-dnum { background: var(--orange); color: #fff; }
.cal-dnum { align-self: flex-start; border: 0; background: none; font-weight: 700; font-size: .7812rem; border-radius: 12px; min-width: 24px; min-height: 22px; cursor: pointer; padding: 0 6px; color: var(--text); }
.cal-cell.we:not(.today) .cal-dnum { color: var(--red); }
.cal-more { border: 0; background: none; color: var(--primary); font-size: .75rem; text-align: left; cursor: pointer; padding: 0 4px; font-weight: 600; }
.cal-dots { display: flex; flex-wrap: wrap; gap: 3px; padding: 0 4px; }
.cal-dots i { width: 7px; height: 7px; border-radius: 50%; background: var(--primary); }
.cal-dots i.t-follow { background: var(--purple); }
.cal-dots i.t-event { background: var(--muted); }
.cal-dots i.t-activity { background: var(--green); }
/* リスト */
.cal-list { display: flex; flex-direction: column; gap: var(--sp-3); }
.cal-day h3 { display: flex; align-items: center; gap: var(--sp-2); margin: 0 0 6px; font-size: .875rem; }
.cal-day h3 .link { font-weight: 700; color: var(--text); background: none; border: 0; padding: 0; cursor: pointer; }
.cal-day .cal-item { font-size: .875rem; padding: 6px 10px; margin-bottom: 4px; border-radius: 6px; }
.cal-day .cal-txt { white-space: normal; }
.cal-day-add { margin-left: auto; min-height: 30px; }
.cal-day.today h3 .link { color: var(--orange); }
/* 中身・追加 */
.cal-dl { display: grid; grid-template-columns: 5em 1fr; gap: 6px 12px; margin: 0 0 var(--sp-3); }
.cal-dl dt { color: var(--muted); font-size: .8125rem; }
.cal-dl dd { margin: 0; }
.cal-memo { white-space: pre-wrap; background: var(--surface-2); border-radius: 8px; padding: 8px 12px; font-size: .875rem; margin-bottom: var(--sp-3); }
.cal-when-row { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: var(--sp-2); }
.cal-when .section-title { margin: var(--sp-2) 0; }
.cal-kind { margin-bottom: var(--sp-3); }
.gcal-chip .gcal-st { font-size: .75rem; color: var(--muted); display: inline-flex; align-items: center; gap: 4px; margin-left: 4px; }
.gcal-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.gcal-dot.ok { background: var(--green); }
.gcal-dot.err { background: var(--red); }
.gcal-points { padding-left: 1.2em; margin: 0 0 var(--sp-3); }
.gcal-points li { margin-bottom: 4px; }
.cal-copy { display: flex; flex-direction: column; gap: 2px; margin-bottom: var(--sp-2); }
.cal-copy code { background: var(--surface-2); border-radius: 6px; padding: 6px 8px; font-size: .8125rem; word-break: break-all; user-select: all; }
@media (max-width: 760px) {
  .cal-title { font-size: 1rem; margin-left: var(--sp-1); }
  .cal-bar { gap: var(--sp-2); }
  .cal-modes { width: 100%; }
  .cal-modes button { flex: 1; }
  .cal-cell { min-height: 56px; }
  .cal-grid-head, .cal-allday, .cal-scroll { grid-template-columns: 40px repeat(var(--cols), minmax(0, 1fr)); }
  .cal-when-row { grid-template-columns: 1fr 1fr; }
  .cal-when-row label:first-child { grid-column: 1 / -1; }
  .cal-head-btns { width: 100%; justify-content: flex-start; }
}
.cal-pos.short .cal-item { display: flex; flex-wrap: nowrap; align-items: center; }
.cal-pos.short .cal-txt { display: block; }
.cal-pos.short .cal-txt { white-space: nowrap; }
button.cal-key { border: 0; background: none; padding: 2px 0; font: inherit; color: inherit; cursor: pointer; }
button.cal-key.off { opacity: .45; text-decoration: line-through; }
/* 録音・メモから活動を記録: 上に「AIで入力」(全部入力/話題ごとに選ぶ)、下はいつもの「活動を記録」パネル */
.rl-ai { background: var(--purple-soft); border-radius: 10px; padding: var(--sp-3) var(--sp-4); margin-bottom: var(--sp-3); display: grid; gap: var(--sp-2); }
.rl-ai-head { display: flex; align-items: center; gap: var(--sp-2); flex-wrap: wrap; color: var(--purple); }
.rl-ai-head .seg { margin-left: auto; }
.rl-ai p { margin: 0; }
.rl-stage { margin: var(--sp-3) 0; flex-wrap: wrap; }
#rl-karte:not(:empty) { margin-top: var(--sp-3); }
.rl-choose { display: flex; align-items: center; gap: var(--sp-2); flex-wrap: wrap; margin-bottom: var(--sp-2); color: var(--muted); font-weight: 600; }
.mk-hot-table .mk-reason { min-width: 180px; }
.mk-home-grid { display: grid; gap: var(--sp-4); }
.mk-home-grid > .panel { min-width: 0; margin: 0; }
.seg.compact.mk-tabs { flex-wrap: wrap; max-width: 100%; margin-bottom: var(--sp-3); }
@media (max-width: 760px) { .seg.compact.mk-tabs button { flex: 0 1 auto; } }
/* 棚卸しの判定・修正提案の比較 */
.rp-criteria { background: var(--surface-2); border-radius: 10px; padding: var(--sp-3); margin-bottom: var(--sp-3); font-size: .8125rem; }
.rp-criteria ul { list-style: none; margin: var(--sp-2) 0; padding: 0; display: flex; flex-direction: column; gap: var(--sp-1); }
.rp-criteria li { display: flex; gap: var(--sp-2); align-items: baseline; }
.rp-criteria li .badge { flex: none; }
.rp-criteria p { margin: 0; }
.rp-vtabs { margin-bottom: var(--sp-3); }
.rp-reason { font-weight: 600; }
.rp-v-delete .rp-reason { color: var(--red); }
.rp-v-merge .rp-reason { color: var(--orange); }
.rp-v-recommend .rp-reason { color: var(--primary); }
.rp-proposals > summary { cursor: pointer; list-style: none; }
.rp-proposals > summary::-webkit-details-marker { display: none; }
.rp-proposals > summary::marker { content: ""; }
.rp-proposals > summary h2 { display: inline-flex; align-items: center; gap: var(--sp-2); margin: 0; }
.rp-proposals > summary h2::after { content: "▸"; color: var(--muted); font-size: .75rem; }
.rp-proposals[open] > summary h2::after { content: "▾"; }
.rp-prop-how { margin: var(--sp-2) 0 0; }
.rp-cmp { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-3); margin: var(--sp-3) 0; }
.rp-cmp-col { min-width: 0; border: 1px solid var(--border); border-radius: 10px; padding: var(--sp-2) var(--sp-3); overflow-x: auto; }
.rp-cmp-col h3 { display: flex; gap: var(--sp-2); align-items: baseline; margin: 0; font-size: .9375rem; }
@media (max-width: 720px) { .rp-cmp { grid-template-columns: 1fr; } }
.rp-forks { flex: 0 0 100%; padding: 0 var(--sp-3) var(--sp-2); }
.rp-forks > button { background: none; border: 0; padding: 0; cursor: pointer; }
.rp-forks ul { margin: var(--sp-1) 0 0; padding-left: 1.2em; display: flex; flex-direction: column; gap: var(--sp-1); }

/* マーケティングの追加(mkplus.js): 反応を待って分岐の入力の出し分け */
.mk-when { display: contents; }
.mk-when[hidden] { display: none !important; }
.mkp-events td .btn.small + .btn.small { margin-left: 4px; }
/* ---------- 優先度(入会見込み × 取引見込み額。prospect.js) ---------- */
.prio { display: inline-flex; align-items: center; justify-content: center; min-width: 20px; min-height: 20px; padding: 0 5px; border-radius: 6px; font-size: .75rem; font-weight: 800; line-height: 1; white-space: nowrap; vertical-align: middle; cursor: pointer; }
.prio.g-A { background: var(--primary); color: var(--on-primary); }
.prio.g-B { background: var(--primary-soft); color: var(--primary); }
.prio.g-C { background: var(--gray-soft); color: var(--text); }
.prio.g-D { background: var(--gray-soft); color: var(--muted); font-weight: 600; }
.todo .meta .prio, .modal-head .prio { margin-left: 6px; }
.prio-line { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 8px; margin-top: 4px; font-size: .75rem; color: var(--muted); cursor: pointer; }
.prio-line b { color: var(--text); font-weight: 700; }
.prio-line .thin, .prio-thin { color: var(--orange); }
.prio-line .thin { font-size: .6875rem; }
.prio-line:hover b { text-decoration: underline; }
.prio-box { background: var(--primary-soft); border-radius: 8px; padding: var(--sp-3); margin-bottom: var(--sp-3); }
.card .prio-line { gap: 2px 6px; font-size: .7188rem; }
.prio-line > span { white-space: nowrap; }
.prio-nums { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2) var(--sp-5); }
.prio-nums > div { display: flex; flex-direction: column; }
.prio-nums .prio { min-width: 32px; min-height: 32px; font-size: 1.125rem; border-radius: 8px; }
.prio-box h3 { font-size: .8125rem; margin: var(--sp-3) 0 var(--sp-1); }
.prio-why { margin: 0; padding-left: 0; list-style: none; display: grid; gap: 2px; font-size: .8125rem; }
.prio-why li.up { color: var(--green); }
.prio-why li.down { color: var(--red); }
.prio-more { margin-top: var(--sp-2); font-size: .8125rem; }
.prio-more summary { cursor: pointer; color: var(--primary); font-weight: 600; }
.prio-thin { margin: var(--sp-2) 0 0; }
.prio-row { grid-template-columns: auto minmax(0, 1fr) auto; }
.prio-row .prio-rank .prio { min-width: 28px; min-height: 28px; font-size: .9375rem; }
.filters .sort-sel { flex: none; width: 10em; }
@media (max-width: 760px) { .page-head > .filters .sort-sel { width: 9em; } }
/* ---------- マーケティング: AIのおすすめ(mkai.js) ---------- */
.mkai-ask-row { display: flex; gap: var(--sp-2); }
.mkai-ask-row input { flex: 1; min-width: 0; }
.mkai-card { border: 1px solid var(--border); border-radius: 10px; padding: var(--sp-3); display: flex; flex-direction: column; gap: var(--sp-2); margin-top: var(--sp-3); }
.mkai-card.focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.mkai-card.swap { border-left: 4px solid var(--orange); }
.mkai-why { font-size: .875rem; line-height: 1.6; }
.mkai-target { font-size: .8125rem; font-weight: 600; }
.mkai-ev { margin: 0; padding-left: 1.2em; font-size: .8125rem; color: var(--muted); display: flex; flex-direction: column; gap: 2px; }
.mkai-fc { background: var(--surface-2); border-radius: 8px; padding: var(--sp-2) var(--sp-3); display: flex; flex-direction: column; gap: 4px; }
.mkai-fc.low { border: 1px dashed var(--orange); }
.mkai-fc-head { display: flex; flex-wrap: wrap; gap: var(--sp-2); align-items: baseline; }
.mkai-fc-num { font-size: 1.125rem; font-weight: 700; color: var(--primary); }
.mkai-fc ul { margin: 0; padding-left: 1.2em; font-size: .8125rem; }
.mkai-fc p { margin: 0; }
.mkai-actual { font-size: .8125rem; border-top: 1px solid var(--border); padding-top: 4px; }
.mkai-swap { display: grid; grid-template-columns: 1fr auto 1fr; gap: var(--sp-2); align-items: start; }
.mkai-stepbox { border-radius: 8px; padding: var(--sp-2); display: flex; flex-direction: column; gap: 6px; margin-top: 4px; }
.mkai-stepbox.del { background: var(--red-soft, #fdecec); }
.mkai-stepbox.add { background: var(--green-soft); }
.mkai-mail { white-space: normal; line-height: 1.6; max-height: 160px; overflow: auto; }
.mkai-done { margin-top: var(--sp-3); }
.mkai-done summary { cursor: pointer; font-size: .8125rem; color: var(--muted); }
.mkai-done-row { display: flex; flex-wrap: wrap; gap: var(--sp-2); align-items: center; padding: 6px 0; border-top: 1px solid var(--border); font-size: .8125rem; }
.mkai-best { background: var(--green-soft); }
.mkai-two { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-4); }
.mkai-steps { display: flex; flex-wrap: wrap; gap: var(--sp-2); align-items: center; }
.mkai-st { display: flex; flex-direction: column; gap: 2px; padding: 6px 8px; border-radius: 8px; border: 1px solid var(--border); }
.mkai-st.weak { border-color: var(--red); background: var(--red-soft, #fdecec); }
.mkai-edit { border: 1px dashed var(--primary); border-radius: 10px; padding: var(--sp-2) var(--sp-3); display: flex; flex-direction: column; gap: var(--sp-2); margin-top: var(--sp-3); }
.mkai-edit-row { display: flex; gap: var(--sp-2); align-items: center; flex-wrap: wrap; }
.mkai-edit-lbl { font-weight: 700; font-size: .8125rem; color: var(--primary); display: inline-flex; gap: 4px; align-items: center; white-space: nowrap; }
.mkai-edit-in { flex: 1; min-width: 12em; }
.mkai-diff-box { display: flex; flex-direction: column; gap: var(--sp-2); }
.mkai-diff-list { display: flex; flex-direction: column; gap: 2px; font-size: .8125rem; }
.mkai-d { padding: 3px 6px; border-radius: 6px; color: var(--muted); }
.mkai-d.chg { background: var(--yellow-soft); color: inherit; }
.mkai-d.add { background: var(--green-soft); color: inherit; }
.mkai-d.del { background: var(--red-soft, #fdecec); color: inherit; text-decoration: line-through; }
.mkai-d-mark { display: inline-block; width: 1.2em; font-weight: 700; }
.mkai-d del, .mkai-mail del { color: var(--red); }
.mkai-d ins, .mkai-mail ins { color: var(--green); text-decoration: none; font-weight: 600; }
.mkai-mail del, .mkai-mail ins { display: block; padding: 4px 0; }
.mkai-sum { margin: 0; font-size: .9375rem; line-height: 1.6; font-weight: 600; }
.mkai-flow { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.mk-step.k-line { background: var(--green-soft); color: var(--green); box-shadow: inset 0 0 0 1px #06c755; }
.mkai-fc-mini { background: var(--surface-2); border-radius: 8px; padding: var(--sp-2) var(--sp-3); display: flex; flex-direction: column; gap: 2px; }
.mkai-fc-mini > div:first-child { display: flex; flex-wrap: wrap; gap: var(--sp-2); align-items: baseline; }
.mkai-fc-mini.low { border: 1px dashed var(--orange); }
.mkai-more summary { cursor: pointer; font-size: .8125rem; color: var(--primary); font-weight: 600; }
.mkai-more[open] { display: flex; flex-direction: column; gap: var(--sp-2); }
.mkai-more .mkai-stepbox { margin-top: 0; padding: 0; }
.mkai-ph { display: inline-block; padding: 0 6px; margin: 0 1px; border-radius: 6px; background: var(--primary-soft); color: var(--primary); font-size: .9em; font-weight: 600; line-height: 1.5; }
.mkai-plan { background: var(--surface-2); border-radius: 8px; padding: var(--sp-2) var(--sp-3); font-size: .875rem; line-height: 1.6; }
.mkai-plan p, .mkai-plan ol, .mkai-plan ul { margin: 4px 0; }
.mkai-plan ol { padding-left: 1.4em; display: flex; flex-direction: column; gap: 4px; }
.mkai-warn { color: var(--orange); font-weight: 600; }
.mkai-btn-note { margin: 0; }
.mkai-at { display: flex; align-items: center; gap: var(--sp-2); flex-wrap: wrap; margin: 0 0 var(--sp-2); }
.mkai-top { display: flex; flex-direction: column; gap: var(--sp-3); }
.mkai-top-head { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-2); flex-wrap: wrap; }
.mkai-top-head h2 { margin: 0; }
.mkai-count { color: var(--primary); }
.mkai-ask-row { align-items: center; }
.mkai-ask-lbl { font-weight: 700; font-size: .8125rem; color: var(--primary); display: inline-flex; gap: 4px; align-items: center; white-space: nowrap; }
.mkai-ftabs { display: flex; gap: 6px; flex-wrap: wrap; }
.mkai-ftabs .chip-btn.on { background: var(--primary); color: var(--on-primary); border-color: var(--primary); }
.mkai-list { display: flex; flex-direction: column; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
.mkai-row + .mkai-row { border-top: 1px solid var(--border); }
.mkai-row-head { width: 100%; display: flex; flex-wrap: wrap; gap: var(--sp-2); align-items: center; padding: 10px var(--sp-3); background: var(--surface); border: 0; text-align: left; cursor: pointer; font: inherit; color: inherit; }
.mkai-row-head:hover { background: var(--surface-2); }
.mkai-row.open > .mkai-row-head { background: var(--primary-soft); }
.mkai-row-no { width: 24px; height: 24px; border-radius: 50%; background: var(--surface-2); display: inline-flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; }
.mkai-row-title { font-weight: 700; flex: 1; min-width: 12em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mkai-row-meta { font-size: .8125rem; color: var(--muted); white-space: nowrap; }
.mkai-row-meta b { color: var(--primary); }
.mkai-row-arrow { color: var(--muted); }
.mkai-row-body { padding: 0 var(--sp-3) var(--sp-3); background: var(--surface); }
.mkai-row-body .mkai-card { margin-top: 0; border: 0; padding: 0; }
.mkai-row-body .mkai-card.swap { border-left: 0; }
.mkai-row-body .mkai-card > .mk-scn-head { display: none; }
.mkai-nav { display: flex; align-items: center; gap: var(--sp-2); padding: var(--sp-2) 0; }
.mkai-fold > summary { cursor: pointer; display: flex; align-items: baseline; gap: var(--sp-2); flex-wrap: wrap; list-style: none; }
.mkai-fold > summary::-webkit-details-marker { display: none; }
.mkai-fold > summary h2 { margin: 0; }
.mkai-fold > summary h2::before { content: "▸ "; color: var(--muted); }
.mkai-fold[open] > summary h2::before { content: "▾ "; }
.mkai-fold-body { margin-top: var(--sp-3); }
@media (max-width: 760px) {
  .mkai-row-head .mkai-row-title { flex-basis: 100%; white-space: normal; order: 5; }
  .mkai-row-head .mkai-row-meta { order: 6; }
}
.mkai-help-row { display: flex; flex-direction: column; gap: 2px; padding: 6px 0; border-top: 1px solid var(--border); }
.mkai-confirm { display: flex; flex-direction: column; gap: var(--sp-3); }
@media (max-width: 760px) {
  .mkai-ask-row { flex-direction: column; }
  .mkai-two, .mkai-swap { grid-template-columns: 1fr; }
  .mkai-swap > .mk-arrow { display: none; }
}
/* 担当配置の見直し: 流れ(①〜④)・AIに相談・選んだ担当替えのバー */
.asg-steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--sp-2); margin: var(--sp-3) 0 var(--sp-2); }
.asg-step { display: grid; grid-template-columns: auto 1fr; column-gap: var(--sp-2); align-items: center; padding: var(--sp-2) var(--sp-3); border: 1px solid var(--border); border-radius: 10px; background: var(--surface); color: inherit; text-decoration: none; }
.asg-step b { grid-row: span 2; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: var(--primary); color: var(--on-primary); font-size: 13px; }
.asg-step span { font-weight: 600; font-size: .875rem; }
.asg-step em { font-style: normal; font-size: .75rem; color: var(--muted); }
.asg-step:hover { border-color: var(--primary); }
.asg-one { margin: 0 0 var(--sp-4); }
.asg-ask { display: flex; gap: var(--sp-2); margin: var(--sp-2) 0 var(--sp-3); }
.asg-ask input { flex: 1; }
.asg-ask .btn { white-space: nowrap; }
.asg-ai-sum { display: flex; flex-wrap: wrap; gap: var(--sp-2); align-items: center; padding: var(--sp-2) var(--sp-3); margin-bottom: var(--sp-3); border-radius: 8px; background: var(--purple-soft); }
.asg-ai-sum .btn { margin-left: auto; }
.asg-bar { position: sticky; bottom: var(--sp-3); z-index: 5; display: flex; gap: var(--sp-2); align-items: center; flex-wrap: wrap; margin-top: var(--sp-3); padding: var(--sp-2) 64px var(--sp-2) var(--sp-3); border: 1px solid var(--border); border-radius: 12px; background: var(--surface); box-shadow: 0 6px 20px rgba(0, 0, 0, .12); }
.asg-bar span { flex: 1; }
.b-assign { margin-top: var(--sp-2); }
@media (max-width: 760px) {
  .asg-steps { grid-template-columns: 1fr 1fr; }
  .asg-ask { flex-direction: column; }
}
.owner-line { display: flex; gap: var(--sp-2); align-items: center; }
.owner-line input { flex: 1; }
.owner-chips { display: flex; flex-wrap: wrap; gap: var(--sp-1); margin: calc(-1 * var(--sp-2)) 0 var(--sp-3); }
#cu-owner-change { margin-left: var(--sp-1); min-height: 28px; padding: 2px 10px; }
/* 顧客カルテのマーケティング(mkplus.js) */
.mkk h3 { font-size: .875rem; margin: var(--sp-4) 0 var(--sp-2); }
.mkk-top { display: flex; flex-wrap: wrap; gap: var(--sp-5); align-items: flex-start; }
.mkk-hist { display: flex; align-items: flex-end; gap: 3px; height: 36px; width: 180px; }
.mkk-hist span { flex: 1; background: var(--border); border-radius: 2px 2px 0 0; }
.mkk-hist span.warm { background: var(--orange); opacity: .6; }
.mkk-hist span.hot { background: var(--red); }
.mkk-run { border-top: 1px solid var(--border); padding: var(--sp-2) 0; display: flex; flex-direction: column; gap: 4px; }
.mk-step.mkk-done { opacity: .75; }
.mk-step.mkk-now { outline: 2px solid var(--primary); }
.mk-step.mkk-later { opacity: .5; }
.mkk-eng > div { display: grid; grid-template-columns: 96px auto 1fr; gap: var(--sp-2); align-items: baseline; padding: 4px 0; border-top: 1px dashed var(--border); }
@media (max-width: 640px) { .mkk-eng > div { grid-template-columns: 1fr; gap: 2px; } }
.mkr-steps { display: flex; gap: 3px; margin-bottom: 2px; }
.mkr-steps span { width: 20px; height: 20px; border-radius: 50%; font-size: 11px; display: inline-flex; align-items: center; justify-content: center; background: var(--surface-2); color: var(--muted); border: 1px solid var(--border); }
.mkr-steps span.done { background: var(--green-soft); color: var(--text); border-color: transparent; }
.mkr-steps span.now { border: 2px solid var(--primary); color: var(--primary); font-weight: 700; }
.mkr-steps span.stop { border-color: var(--red); color: var(--red); }

/* ---------- 通知(上部バーのベル。notify.js) ---------- */
.notif-btn { position: relative; box-sizing: border-box; width: 40px; height: 40px; padding: 0; border-radius: 20px; border: 1px solid var(--border);
  background: var(--surface-2); color: var(--muted); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; flex: none; }
.notif-btn:hover, .notif-btn[aria-expanded="true"] { color: var(--primary); border-color: var(--primary); }
.notif-btn .i { width: 18px; height: 18px; }
.notif-btn .nt-count { position: absolute; top: -4px; right: -4px; min-width: 18px; height: 18px; box-sizing: border-box; padding: 0 3px; border-radius: 9px; font-size: 11px;
  background: var(--red); color: #fff; font-weight: 800; line-height: 1; text-align: center; border: 2px solid var(--surface);
  display: inline-flex; align-items: center; justify-content: center; font-variant-numeric: tabular-nums; }  /* 数字(1・12・99+)を丸の真ん中に(枠の2px を引いた中で上下中央) */
.notif-btn .nt-count[hidden] { display: none; }
@media (max-width: 760px) { .notif-btn { width: 44px; height: 44px; border-radius: 50%; color: var(--text); } .notif-btn .i { width: 22px; height: 22px; } }
.nt-panel { position: fixed; z-index: 21; width: 420px; max-width: calc(100vw - 16px); max-height: min(640px, calc(100dvh - 80px)); display: flex; flex-direction: column;
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: 0 12px 32px rgba(16, 24, 40, .16); overflow: hidden; }
.nt-panel[hidden] { display: none; }
.nt-head { display: flex; align-items: center; gap: var(--sp-2); padding: var(--sp-3) var(--sp-3) var(--sp-2) var(--sp-4); border-bottom: 1px solid var(--border); }
.nt-head h2 { margin: 0 auto 0 0; font-size: 1rem; }
.nt-seg { display: inline-flex; background: var(--surface-2); border-radius: 16px; padding: 2px; }
.nt-seg button { border: 0; background: none; padding: 4px 10px; border-radius: 14px; font-size: .8125rem; color: var(--muted); cursor: pointer; white-space: nowrap; }
.nt-seg button.on { background: var(--surface); color: var(--text); font-weight: 700; box-shadow: var(--shadow); }
.nt-gear { border: 0; background: none; width: 32px; height: 32px; border-radius: 16px; display: grid; place-items: center; color: var(--muted); cursor: pointer; }
.nt-gear:hover { background: var(--surface-2); color: var(--text); }
.nt-gear .i { width: 18px; height: 18px; }
.nt-list { list-style: none; margin: 0; padding: 0 0 var(--sp-1); overflow-y: auto; flex: 1; overscroll-behavior: contain; }
.nt-day { padding: var(--sp-3) var(--sp-4) var(--sp-1); font-size: .75rem; font-weight: 700; color: var(--muted); }
.nt-item { position: relative; display: flex; gap: var(--sp-3); align-items: flex-start; padding: var(--sp-2) 32px var(--sp-2) var(--sp-4); cursor: pointer; }
.nt-item:hover, .nt-item:focus-visible { background: var(--surface-2); outline: none; }
.nt-item.nolink { cursor: default; }
.nt-item.unread { background: var(--primary-soft); }
.nt-item.unread:hover { filter: brightness(.98); }
.nt-ico { flex: none; width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-2); color: var(--muted); }
.nt-ico .i { width: 17px; height: 17px; }
.nt-ico.k-owner, .nt-ico.k-assigned { background: var(--primary-soft); color: var(--primary); }
.nt-ico.k-instruction, .nt-ico.k-prospect { background: var(--purple-soft); color: var(--purple); }
.nt-ico.k-overdue { background: var(--red-soft); color: var(--red); }
.nt-ico.k-news, .nt-ico.k-calendar { background: var(--orange-soft); color: var(--orange); }
.nt-ico.k-recording, .nt-ico.k-report, .nt-ico.k-proposal { background: var(--green-soft); color: var(--green); }
.nt-item.unread .nt-ico { background: var(--surface); }
.nt-body { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.nt-title { font-size: .875rem; font-weight: 600; line-height: 1.45; }
.nt-item.unread .nt-title { font-weight: 800; }
.nt-text { font-size: .8125rem; color: var(--muted); line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.nt-meta { font-size: .75rem; color: var(--muted); }
.nt-sample { color: var(--orange); }
.nt-dot { position: absolute; right: 14px; top: 50%; width: 8px; height: 8px; margin-top: -4px; border-radius: 50%; background: var(--primary); }
.nt-empty { padding: var(--sp-6) var(--sp-4); text-align: center; color: var(--muted); display: flex; flex-direction: column; gap: var(--sp-2); }
.nt-loading { padding: var(--sp-5); text-align: center; }
.nt-foot { border-top: 1px solid var(--border); padding: var(--sp-2) var(--sp-4); text-align: center; }
.nt-foot .link { border: 0; background: none; color: var(--primary); cursor: pointer; }
@media (max-width: 760px) {
  .nt-panel { left: 8px; right: 8px !important; width: auto; max-height: calc(100dvh - 72px); }
  .nt-head { flex-wrap: wrap; }
  .nt-item { padding-top: var(--sp-3); padding-bottom: var(--sp-3); }
}
/* 通知の設定 */
.nt-set td:first-child .small { display: block; margin-top: 2px; }
.nt-set th:not(:first-child), .nt-set td:not(:first-child) { text-align: center; width: 64px; }
.nt-set input[type="checkbox"] { width: 18px; height: 18px; }
.nt-mails { margin: var(--sp-2) 0 0; padding-left: 1.2em; }

/* =====================================================================
   スマホ専用のデザイン(Hiro 2026-10-24「携帯版は携帯用のデザインに」)
   PC の縮小ではなく、片手・親指で使う前提で組み直す。原則:
   1. 親指の届く下側に操作を集める: 下部メニューは5つまで(よく使う画面3つ + まん中の「＋ 記録」+「その他」)。
      「その他」と、選ぶだけの画面(＋ など)は下から出るシート
   2. 上部バーは「‹ 戻る・画面の名前・録音・検索・さくら・通知・自分」だけ。ロゴは出さない(場所を内容に使う)
   3. 押せるものは 44px 以上(Apple HIG 44pt / Material 48dp)。小さいボタンも 38px
   4. 入力欄の文字は 16px(iOS が入力のたびに画面を拡大しないように)
   5. 1列・カード。補足の説明は2行までに畳み、押すと全部出す(段階的に見せる)
   6. 絞り込みのチップは折り返さず横1行(縦の場所を取らない)
   7. 入力画面の「保存」は画面の下に固定(親指の位置・スクロールしても押せる)
   8. 画面の端(ノッチ・ホームバー)を避ける(safe-area)
   ===================================================================== */
.m-back, .m-title { display: none; }
.sheet-scrim { display: none; }
@media (max-width: 760px) {
  html { -webkit-text-size-adjust: 100%; }
  body { -webkit-tap-highlight-color: transparent; }
  /* 表の「CSV」書き出しはパソコンで使うもの。スマホでは出さず、表に場所を使う(Hiro 2026-10-27) */
  .csv-btn { display: none !important; }
  /* --- 上部バー: ‹ 画面の名前 …… 録音 検索 さくら 通知 自分 --- */
  .topbar { border-top: 0; gap: 4px; min-height: calc(56px + env(safe-area-inset-top)); padding: env(safe-area-inset-top) 8px 0 12px;
    background: color-mix(in srgb, var(--surface) 92%, transparent); -webkit-backdrop-filter: saturate(1.6) blur(14px); backdrop-filter: saturate(1.6) blur(14px); }
  .topbar > .brand { display: none; }
  .m-back:not([hidden]) { display: grid; place-items: center; flex: none; width: 40px; height: 44px; margin-left: -8px; border: 0; background: none; color: var(--primary); border-radius: 12px; cursor: pointer; }
  .m-back .i { width: 26px; height: 26px; stroke-width: 2.2; }
  .m-back:active { background: var(--primary-soft); }
  .m-title { display: block; flex: 1 1 auto; min-width: 0; margin: 0; font-size: 1.1875rem; font-weight: 800; letter-spacing: .01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .topbar-right { margin-left: 0; gap: 2px; flex: none; }
  .topbar-right > #new-deal-top, .topbar-right > #log-btn { display: none !important; }
  /* 録音(マイク)はワンタップで開けるよう、スマホでも上部バーに出す(Hiro 2026-10-25「携帯で音声入力がすぐ押せない」) */
  .topbar-right > #rec-top { background: color-mix(in srgb, var(--red) 10%, transparent); border: 0; }
  .topbar-right > #rec-top:active { background: color-mix(in srgb, var(--red) 20%, transparent); }
  /* 名刺の読み取り(録音の右。bizcard.js)。スマホだけ */
  .topbar-right > #card-top { background: color-mix(in srgb, var(--primary) 10%, transparent); border: 0; }
  .topbar-right > #card-top:active { background: color-mix(in srgb, var(--primary) 20%, transparent); }
  .search-btn, .notif-btn { width: 44px; height: 44px; padding: 0; border: 0; background: none; color: var(--text); justify-content: center; border-radius: 50%; }
  .search-btn .i, .notif-btn .i { width: 23px; height: 23px; }
  .search-btn:active, .notif-btn:active { background: var(--surface-2); }
  #butler-top.butler-btn { width: 44px; height: 44px; }
  .user-chip { width: 44px; height: 44px; max-width: none; padding: 0; border: 0; background: none; display: grid; place-items: center; position: relative; }
  .user-chip .uc-name, .user-chip .chev { display: none; }
  .user-chip .avatar { margin: 0; width: 32px; height: 32px; font-size: 14px; }
  /* 画面の名前は上部バーにあるので、本文の同じ見出しと「戻る」の行は出さない */
  .screen-h1, #content > .backbar { display: none; }
  #content > .backbar + * { margin-top: 0; }

  /* --- 下部メニュー: 5つを等分、まん中は「＋ 記録」 --- */
  main { padding: var(--sp-3) 16px calc(88px + env(safe-area-inset-bottom)); }
  .bottom-nav { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); overflow: visible; padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
    background: color-mix(in srgb, var(--surface) 94%, transparent); -webkit-backdrop-filter: saturate(1.6) blur(14px); backdrop-filter: saturate(1.6) blur(14px); z-index: 12; }
  .bottom-nav button { min-width: 0; min-height: 52px; padding: 2px 0; gap: 3px; font-size: .6875rem; letter-spacing: 0; font-weight: 700; justify-content: center; }
  .bottom-nav button .ico { width: 56px; height: 30px; border-radius: 15px; }
  .bottom-nav button .ico .i { width: 23px; height: 23px; }
  .bottom-nav .count { top: -2px; right: calc(50% - 26px); min-width: 18px; text-align: center; font-size: 11px; line-height: 18px; padding: 0 5px; }
  .bottom-nav .nav-plus { color: var(--primary); }
  .bottom-nav .nav-plus .ico { width: 48px; height: 32px; border-radius: 12px; background: var(--primary); color: var(--on-primary); box-shadow: 0 3px 8px rgba(0, 47, 123, .28); }
  .bottom-nav .nav-plus .ico .i { stroke-width: 2.6; }

  /* --- 下から出るシート(その他・選ぶだけの画面) --- */
  .sheet-scrim:not([hidden]) { display: block; position: fixed; inset: 0; z-index: 19; background: rgba(15, 20, 30, .4); animation: fade-in .2s ease; }
  #more-menu.sheet { position: fixed; left: 0; right: 0; bottom: 0; top: auto; z-index: 20; min-width: 0; max-height: 80vh; overflow-y: auto; border: 0; border-radius: 20px 20px 0 0;
    padding: 8px 16px calc(16px + env(safe-area-inset-bottom)); box-shadow: 0 -8px 30px rgba(0, 0, 0, .18); animation: sheet-up .22s cubic-bezier(.2, .8, .3, 1); display: block; }
  .sheet-grab { width: 40px; height: 5px; border-radius: 3px; background: var(--border); margin: 0 auto 12px; }
  .sheet-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  #more-menu.sheet .sheet-grid button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; min-height: 80px; padding: 10px 4px; text-align: center;
    border-radius: 14px; background: var(--surface-2); font-size: .8125rem; font-weight: 700; color: var(--text); line-height: 1.3; }
  #more-menu.sheet .sheet-grid button .i { width: 26px; height: 26px; color: var(--primary); }
  #more-menu.sheet .sheet-grid button.active { background: var(--primary-soft); color: var(--primary); }
  #more-menu.sheet .sheet-link { display: flex; align-items: center; gap: 8px; width: 100%; min-height: 48px; margin-top: 12px; padding: 0 12px; color: var(--primary); font-weight: 700; font-size: .875rem; border-radius: 12px; }
  dialog.sheet-dlg { height: fit-content; max-height: 88dvh; margin: auto 0 0; border-radius: 20px 20px 0 0; padding-bottom: env(safe-area-inset-bottom); }
  dialog.sheet-dlg .modal-head { border-bottom: 0; padding-top: 20px; }
  dialog.sheet-dlg .modal-head::before { content: ""; position: absolute; top: 8px; left: calc(50% - 20px); width: 40px; height: 5px; border-radius: 3px; background: var(--border); }

  /* --- 全画面の入力画面: 見出しは上に固定、保存は下に固定 --- */
  dialog:not(.sheet-dlg):not(.confirm-dlg):not(.tf-pop) .modal-head { padding: calc(8px + env(safe-area-inset-top)) 8px 8px 16px; min-height: 56px; }
  .modal-head h2 { font-size: 1.0625rem; }
  .close-x { width: 44px; height: 44px; padding: 0; font-size: 28px; border-radius: 50%; }
  .modal-back { width: 44px; height: 44px; justify-content: center; margin: 0 2px 0 -10px; }
  .modal-content { padding: 16px 16px 20px; }
  dialog .modal-content form > .btn-row:last-child { position: sticky; bottom: 0; z-index: 2; margin: 16px -16px -20px; padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
    background: color-mix(in srgb, var(--surface) 94%, transparent); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); border-top: 1px solid var(--border); flex-wrap: nowrap; }
  dialog .modal-content form > .btn-row:last-child .btn { flex: 1 1 0; min-width: 0; }

  /* --- 押せる大きさと文字の大きさ --- */
  input, select, textarea, label > input, label > select, label > textarea { font-size: 1rem; min-height: 44px; }
  textarea { min-height: 112px; }
  input[type="checkbox"], input[type="radio"] { min-height: 0; }
  .btn { border-radius: 10px; }  /* 高さは末尾の「ボタンの大きさの規格」 */
  .flow-main { grid-template-columns: minmax(0, 1fr); }
  .chip-btn { min-height: 36px; padding: 6px 14px; }
  .seg button { min-height: 40px; }
  .btn:active, .chip-btn:active, .seg button:active { transform: scale(.97); }

  /* --- 補足の説明は2行に畳む(押すと全部) --- */
  .page-head > div:first-child > p.muted { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; font-size: .8438rem; line-height: 1.5; cursor: pointer; }
  .page-head > div:first-child > p.muted.open { display: block; -webkit-line-clamp: none; }

  /* --- 絞り込みのチップ・切り替えは横1行(折り返さない。続きは横にスクロール) --- */
  .seg:not(.compact), .sr-presets, .chip-row { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; overscroll-behavior-x: contain; }
  #content > :is(.seg:not(.compact), .sr-presets, .chip-row) { margin-left: -16px; margin-right: -16px; padding-left: 16px; padding-right: 16px; scroll-padding: 0 16px; }
  .seg:not(.compact)::-webkit-scrollbar, .sr-presets::-webkit-scrollbar, .chip-row::-webkit-scrollbar { display: none; }
  .seg:not(.compact) > *, .sr-presets > *, .chip-row > * { flex: none; }

  /* --- カード --- */
  .panel { border-radius: 14px; }
  .panel h2 { font-size: 1rem; }
  .toast { bottom: calc(84px + env(safe-area-inset-bottom)); }
}
@media (max-width: 760px) {
  .close-x:focus:not(:focus-visible), .modal-back:focus:not(:focus-visible) { outline: none; }
}

/* スマホ: 画面ごとの調整(大事なものを上に・縦の場所を取らない) */
@media (max-width: 760px) {
  /* アクション: 件数の4枚は横1列(押すとその区切りへ)。売上は今月だけを大きく、四半期・年度は1行 */
  .summary-strip:not(.stuck) { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
  .summary-strip:not(.stuck) .tile { padding: 10px 4px 8px; border-left: 0; border-top: 4px solid var(--border); text-align: center; border-radius: 12px; }
  .summary-strip .tile.red { border-top-color: var(--red); } .summary-strip .tile.orange { border-top-color: var(--orange); }
  .summary-strip .tile.blue { border-top-color: var(--primary); } .summary-strip .tile.gray { border-top-color: var(--muted); }
  .summary-strip:not(.stuck) .tile .num { font-size: 1.5rem; }
  .summary-strip:not(.stuck) .lbl { font-size: .75rem; white-space: nowrap; }
  .summary-strip:not(.stuck) .lbl .full { display: none; }
  .summary-strip:not(.stuck) .lbl .short { display: inline; }
  /* 活動履歴: 手段ごとの件数は横1行のチップ */
  .act-kinds-row { display: flex; overflow-x: auto; scrollbar-width: none; gap: 8px; margin: 0 -16px; padding: 0 16px; }
  .act-kinds-row::-webkit-scrollbar { display: none; }
  .act-kind-chip { flex: none; display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 6px 14px; border-radius: 20px; }
  .act-kind-chip .i { width: 18px; height: 18px; }
  .act-kind-chip span { font-size: .8438rem; color: inherit; font-weight: 700; }
  .act-kind-chip b { font-size: .8438rem; font-weight: 600; opacity: .8; }
  .act-kind-chip.active .i { color: var(--on-primary); }
  /* カレンダー: 表示する人は横1行 */
  .cal-people { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin: 0 -16px; padding: 2px 16px; }
  .cal-people::-webkit-scrollbar { display: none; }
  .cal-people > * { flex: none; }
  .cal-person { min-height: 36px; }
  .cal-person button { min-width: 28px; min-height: 28px; }
  /* 顧客: 取引額の帯も横1行 */
  .cu-bands .seg.compact { flex: 1 1 100%; width: auto; max-width: none; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin: 0 -16px; padding: 0 16px; }
  .cu-bands .seg.compact::-webkit-scrollbar { display: none; }
  .cu-bands .seg.compact button { flex: none; }
}
@media (max-width: 760px) {
  .close-x { margin-right: 0; flex: none; }
  /* 案件の「次のアクション」: ボタンは本文の下の行に(押しやすく、横にはみ出さない) */
  .timeline.upcoming li.act:not(.editing) { grid-template-columns: 30px minmax(0, 1fr); }
  .timeline.upcoming li.act:not(.editing) > .act-btns { grid-column: 2; justify-self: start; margin-top: 6px; }
}
@media (max-width: 760px) {
  .close-x:focus, .modal-back:focus { outline: none; }
  .m-title { font-size: 1.125rem; }
  /* 切り替え(タブ)は横1行。少ないときは等分、多いときは横にスクロール */
  .seg.compact { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .seg.compact::-webkit-scrollbar { display: none; }
  .seg.compact > button { flex: 1 0 auto; }
  #content > .seg.compact { margin-left: -16px; margin-right: -16px; padding-left: 16px; padding-right: 16px; width: auto; }
}
/* パイプライン: スマホはフェーズのタブで1つずつ */
.mobile-tabs { display: none; }
@media (max-width: 760px) {
  .mobile-tabs { display: flex; }
  #content > .pipe-phase-tabs { position: sticky; top: var(--topbar-h, 56px); z-index: 4; background: var(--bg); padding-top: 6px; padding-bottom: 6px; margin-top: calc(6px - var(--sp-block)); margin-bottom: -6px; }
  .pipe-phase-tabs + .board .column:not(.m-on) { display: none; }
  .pipe-phase-tabs + .board .column.m-on .column-head { clip-path: none; padding-left: 12px; border-radius: var(--radius) var(--radius) 0 0; }
}
@media (max-width: 760px) { .pipe-phase-tabs + .board { min-height: 0; } .pipe-phase-tabs + .board .column.m-on { min-height: 0; height: auto; } }
/* タブで1フェーズずつ見るときも、今のフェーズの見出し(件数・金額・確度)はタブのすぐ下に止める(Hiro 2026-10-25)。
   --pipe-tabs-h はタブの高さ(app.js の updateStickyStrip が測る) */
@media (max-width: 760px) { .pipe-phase-tabs + .board .column-top { top: calc(var(--topbar-h, 56px) + var(--pipe-tabs-h, 48px)); z-index: 3; } }
/* 配信の同意(consent.js): カルテの先方担当者ごとの行・マーケティングの集計 */
.cs-rows { display: flex; flex-direction: column; gap: var(--sp-2); }
.cs-row { display: grid; grid-template-columns: minmax(9em, 1.2fr) repeat(3, minmax(0, 1fr)) auto; gap: var(--sp-2) var(--sp-3); align-items: center; padding: var(--sp-2) 0; border-top: 1px solid var(--border); }
.cs-who { display: flex; flex-direction: column; min-width: 0; }
.cs-who .small { overflow-wrap: anywhere; }
.cs-cell { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; min-width: 0; }
.cs-hist { margin-top: var(--sp-3); }
.cs-hist summary { cursor: pointer; font-weight: 600; }
.cs-log { display: flex; flex-direction: column; gap: var(--sp-2); margin-top: var(--sp-2); }
.cs-log-row { display: grid; grid-template-columns: 7.5em 1fr; gap: var(--sp-2); align-items: baseline; }
.cs-field { border: 1px solid var(--border); border-radius: 8px; padding: var(--sp-2) var(--sp-3); margin: 0 0 var(--sp-3); }
.cs-field legend { font-weight: 600; padding: 0 4px; display: flex; gap: var(--sp-2); align-items: baseline; }
.cs-opts { display: flex; flex-wrap: wrap; gap: var(--sp-1) var(--sp-4); }
.cs-field p { margin: var(--sp-1) 0 0; }
.cs-basis { margin-top: var(--sp-2); }
.cs-sums { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--sp-4); }
.cs-sum h3 { margin: 0 0 var(--sp-2); }
.cs-sum-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(7em, 1fr)); gap: var(--sp-2); }
.cs-num { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: var(--sp-2) var(--sp-3); border: 1px solid var(--border); border-radius: 8px; background: none; cursor: pointer; font: inherit; color: inherit; }
.cs-num b { font-size: 1.25rem; }
.cs-num.active { border-color: var(--primary); box-shadow: 0 0 0 1px var(--primary) inset; }
@media (max-width: 760px) {
  .cs-row { grid-template-columns: 1fr; gap: var(--sp-1); }
  .cs-cell { flex-direction: row; flex-wrap: wrap; align-items: center; gap: 2px var(--sp-2); }
  .cs-cell .cs-ch { min-width: 4.5em; }
  .cs-row > .btn { grid-column: 1 / -1; justify-self: start; }
  .cs-sums { grid-template-columns: 1fr; gap: var(--sp-3); }
  .cs-log-row { grid-template-columns: 1fr; gap: 0; }
}

/* ---------- 上部バーのメニュー(「?」・⚙・名前)。アイコン・1行の説明・小見出し・別ウィンドウの印・未読の件数 ---------- */
.user-menu.menu-rich { min-width: 300px; max-width: min(22.5rem, calc(100vw - 16px)); padding: 8px; gap: 2px; border-radius: 16px; border-color: color-mix(in srgb, var(--border) 70%, transparent);
  box-shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 12px 32px -6px rgba(16, 24, 40, .22); transform-origin: top right; }
.user-menu.menu-rich:not([hidden]) { animation: menu-pop .18s cubic-bezier(.2, .8, .3, 1); }
@keyframes menu-pop { from { opacity: 0; transform: translateY(-6px) scale(.97); } to { opacity: 1; transform: none; } }
.user-menu.menu-rich .menu-sec { margin: 0; padding: 10px 10px 4px; font-size: .6875rem; font-weight: 700; letter-spacing: .08em; color: var(--muted); }
.user-menu.menu-rich .menu-sec:first-child { padding-top: 4px; }
.user-menu.menu-rich > .menu-sec ~ .menu-sec { border-top: 1px solid var(--border); margin-top: 6px; padding-top: 12px; }
.user-menu.menu-rich button.mi { display: flex; align-items: center; gap: 12px; width: 100%; padding: 8px 10px; border-radius: 10px; color: var(--text); transition: background .15s ease, transform .15s ease; }
.user-menu.menu-rich button.mi:hover, .user-menu.menu-rich button.mi:focus-visible { background: var(--primary-soft); outline: none; }
.user-menu.menu-rich button.mi:active { transform: scale(.985); }
.mi-ico { flex: none; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; background: var(--mi-bg, var(--surface-2)); color: var(--mi-fg, var(--muted)); transition: transform .15s ease; }
.mi-ico .i { width: 18px; height: 18px; vertical-align: 0; }
button.mi:hover .mi-ico { transform: scale(1.06); }
.mi-ico.c-violet { --mi-bg: var(--purple-soft); --mi-fg: var(--purple); }
.mi-ico.c-blue { --mi-bg: var(--primary-soft); --mi-fg: var(--primary); }
.mi-ico.c-teal { --mi-bg: color-mix(in srgb, #0f9f8f 14%, transparent); --mi-fg: #0f8577; }
.mi-ico.c-red { --mi-bg: var(--red-soft); --mi-fg: var(--red); }
.mi-ico.c-orange { --mi-bg: var(--orange-soft); --mi-fg: var(--orange); }
.mi-ico.c-green { --mi-bg: var(--green-soft); --mi-fg: var(--green); }
.mi-ico.c-gray { --mi-bg: var(--gray-soft); --mi-fg: var(--muted); }
.mi-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.mi-t { font-weight: 600; font-size: .875rem; line-height: 1.35; }
.mi-d { font-size: .75rem; line-height: 1.4; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mi-ext { flex: none; width: 15px; height: 15px; color: var(--muted); opacity: .7; }
button.mi:hover .mi-ext { color: var(--primary); opacity: 1; }
button.mi .menu-new { margin-left: 0; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; display: inline-grid; place-items: center; font-size: 11.5px; line-height: 1; }
button.mi .menu-new[hidden] { display: none; }
button.mi[data-action="logout"] .mi-t { color: var(--red); }
@media (max-width: 760px) {
  .user-menu.menu-rich { min-width: 0; width: min(21.25rem, calc(100vw - 16px)); }
  .user-menu.menu-rich button.mi { padding: 9px 10px; }
}

/* スマホの上部バーの「?」: 検索・ベルと同じ丸いアイコン。押すとパソコンと同じ「?」のメニュー(チュートリアル〜システム仕様書) */
@media (max-width: 760px) {
  .topbar-right > #help-btn { display: grid; place-items: center; position: relative; width: 44px; height: 44px; padding: 0; border: 0; border-radius: 50%; background: none; color: var(--text); }
  .topbar-right > #help-btn span { display: none; }
  .topbar-right > #help-btn .i { width: 23px; height: 23px; }
  .topbar-right > #help-btn:active, .topbar-right > #help-btn[aria-expanded="true"] { background: var(--surface-2); }
  .topbar-right > #help-btn .new-dot { top: 6px; right: 6px; }
}
/* 幅の狭いスマホ(iPhone 15 / SE など 430px 以下)は、画面の名前(パイプライン・経営報告・アクションなど)が切れないよう、
   右のアイコン(マイク・検索・さくら・?・ベル・名前)を小さく・すき間なしにする。長い名前は app.js fitMobileTitle で字を小さくして収める */
@media (max-width: 430px) {
  .topbar { gap: 2px; padding-left: 10px; padding-right: 4px; }
  .topbar-right { gap: 0; }
  .topbar-right > #rec-top, .topbar-right > #card-top, .topbar-right > .search-btn, .topbar-right > #butler-top, .topbar-right > #help-btn, .topbar-right > .notif-btn, .topbar-right > .user-chip { width: 36px; height: 36px; border-radius: 50%; }
  .topbar-right > #rec-top .i, .topbar-right > #card-top .i, .topbar-right > .search-btn .i, .topbar-right > #help-btn .i, .topbar-right > .notif-btn .i { width: 21px; height: 21px; }
  .topbar-right > #butler-top .butler-svg { width: 32px; height: 32px; }
  .topbar-right > .user-chip .avatar { width: 28px; height: 28px; font-size: 13px; }
  .topbar-right > #help-btn .new-dot { right: 3px; }
  .topbar-right > .user-chip.has-new::after { right: 2px; }
  .m-title { font-size: 1.0625rem; letter-spacing: 0; }
}
@media (max-width: 380px) {
  .topbar-right > #rec-top, .topbar-right > #card-top, .topbar-right > .search-btn, .topbar-right > #butler-top, .topbar-right > #help-btn, .topbar-right > .notif-btn, .topbar-right > .user-chip { width: 34px; height: 34px; }
}

/* ---------- 操作の速さと手ざわり(ux.js。Linear・Raycast などの作法) ---------- */
/* キーボードで動かしたときだけ、押せるものに輪郭を出す(マウス・指では出さない) */
:where(button, a, [role="button"], [tabindex], summary):focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
/* 数字は桁をそろえる(表・件数・金額が縦に並んでも揺れない) */
:where(td, th, .num, .kpi, .tile, .badge, .count, .rev-mini, .column-head) { font-variant-numeric: tabular-nums; }
/* ⌘K の窓: 操作・画面の行の右に近道のキー */
.qs-item > span.qs-keys { flex: none; flex-direction: row; display: inline-flex; gap: 4px; margin-left: 8px; }
.qs-keys kbd { display: inline-grid; place-items: center; min-width: 22px; height: 22px; padding: 0 6px; border: 1px solid var(--border); border-bottom-width: 2px; border-radius: 6px;
  background: var(--surface); color: var(--muted); font: 600 .7188rem/1 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
.qs-item.sel .qs-keys kbd { color: var(--text); }
.qs-cmd > .i { color: var(--muted); }
.qs-cmd.sel > .i, .qs-cmd:hover > .i { color: var(--primary); }
@media (max-width: 760px) { .qs-item > span.qs-keys { display: none; } }
/* キーボードの近道の一覧 */
.kb-cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 var(--sp-5); }
.kb-row { display: grid; grid-template-columns: 5.5em minmax(0, 1fr); align-items: center; gap: var(--sp-3); min-height: 40px; padding: 4px 0; border-bottom: 1px solid var(--border); font-size: .875rem; }
.kb-row .qs-keys { display: inline-flex; gap: 4px; }
@media (max-width: 760px) { .kb-cols { grid-template-columns: 1fr; } }
/* スマホのシートは指で引いて閉じる: つまみを少し太く、引ける場所だとわかるように */
@media (max-width: 760px) {
  dialog.sheet-dlg, #more-menu.sheet { will-change: transform; touch-action: pan-y; overscroll-behavior: contain; }
  /* つまみと見出しは指で引くためだけの場所(ブラウザのスクロールに取られない) */
  dialog.sheet-dlg .modal-head, #more-menu.sheet .sheet-grab { touch-action: none; }
  #more-menu.sheet .sheet-grab { height: 5px; padding: 0; box-sizing: content-box; border-top: 10px solid transparent; border-bottom: 10px solid transparent; background-clip: padding-box; margin-top: -10px; margin-bottom: 2px; }
  dialog.sheet-dlg .modal-head, .sheet-grab { cursor: grab; }
}

/* ---------- パソコンの画面のメニューは左のサイドバー(Linear・Notion・HubSpot・Attio と同じ形) ----------
   上の端から下の端まで。上にロゴ、続けて画面の一覧(アイコン+名前+件数)、いちばん下に「たたむ」。
   html.side-rail のときは細い列(アイコンだけ。名前はマウスを置くと出る)。上部バーと本文はサイドバーの右側に置く */
.side-nav { display: none; }
@media (min-width: 761px) {
  :root { --side-w: 228px; }
  html.side-rail { --side-w: 68px; }
  #main-view { padding-left: var(--side-w); }
  .side-nav { display: flex; flex-direction: column; gap: var(--sp-2); position: fixed; left: 0; top: 0; bottom: 0; z-index: 9; width: var(--side-w);
    padding: calc(var(--topbar-h, 64px) + 12px) 12px 12px; background: var(--surface); border-right: 1px solid var(--border); overflow-x: hidden; overflow-y: auto; scrollbar-width: thin;
    transition: width .2s cubic-bezier(.2, .8, .3, 1); }
  /* ロゴは上部バーから取り出してサイドバーの上に置く(上部バーの3px の線と同じ線を上に) */
  .topbar { border-top: 0; }
  .side-nav { border-top: 3px solid var(--primary); }
  .topbar > .brand { position: fixed; left: 0; top: 0; z-index: 12; width: var(--side-w); height: var(--topbar-h, 64px); padding: 3px 16px 0; border-right: 1px solid var(--border);
    border-bottom: 1px solid var(--border); background: var(--surface); overflow: hidden; transition: width .2s cubic-bezier(.2, .8, .3, 1); }
  .topbar > .brand .brand-name { display: none; }
  html.side-rail .topbar > .brand { padding: 3px 0 0; justify-content: center; }
  html.side-rail .topbar > .brand .logo-full { display: none; }
  html.side-rail .topbar > .brand .logo-mark { display: block; }
  .topbar { padding-left: 20px; }
  /* 画面の一覧: 縦に並べる */
  .side-nav .tabs { flex: none; display: flex; flex-direction: column; gap: 2px; overflow: visible; min-width: 0; }
  .side-nav .tabs button { position: relative; display: flex; align-items: center; gap: 12px; width: 100%; min-height: 40px; padding: 0 12px; border-radius: 10px; font-size: .9062rem; font-weight: 600;
    color: var(--muted); text-align: left; white-space: nowrap; overflow: hidden; }
  .side-nav .tabs button .ico { display: inline-flex !important; margin: 0; flex: none; }
  .side-nav .tabs button .ico .i { width: 20px; height: 20px; }
  .side-nav .tabs button:hover { background: var(--surface-2); color: var(--text); }
  .side-nav .tabs button.active { background: var(--primary-soft); color: var(--primary); }
  .side-nav .tabs button.active::before { content: ""; position: absolute; left: 0; top: 10px; bottom: 10px; width: 3px; border-radius: 0 3px 3px 0; background: var(--primary); }
  .side-nav .tabs .lbl-full { display: inline !important; }
  .side-nav .tabs .lbl-short { display: none !important; }
  .side-nav .tabs .count { margin-left: auto; min-width: 22px; text-align: center; }
  .side-nav .tabs .nav-more .chev { display: none; }
  /* いちばん下の「たたむ / 広げる」 */
  .side-toggle { margin-top: auto; display: flex; align-items: center; gap: 12px; height: 38px; padding: 0 12px; border: 0; border-radius: 10px; background: none; color: var(--muted);
    font-size: .8125rem; font-weight: 600; cursor: pointer; white-space: nowrap; overflow: hidden; }
  .side-toggle:hover { background: var(--surface-2); color: var(--text); }
  .side-toggle .i { width: 20px; height: 20px; flex: none; transition: transform .2s ease; }
  html.side-rail .side-toggle .i { transform: scaleX(-1); }
  /* 細い列: アイコンだけ。件数は右上の小さな丸 */
  html.side-rail .side-nav { padding-left: 10px; padding-right: 10px; }
  /* たたんだ時: 名前(文字だけのものも含む)は幅を取らないよう隠し、どのボタンも同じ 44px 四方にして列の真ん中に揃える */
  html.side-rail .side-nav .tabs button { justify-content: center; gap: 0; width: 44px; height: 44px; min-height: 44px; margin: 0 auto; padding: 0; font-size: 0; }
  html.side-rail .side-nav .tabs button > :not(.ico):not(.count) { display: none !important; }
  html.side-rail .side-nav .tabs .count { position: absolute; top: 2px; right: 0; margin: 0; min-width: 18px; padding: 0 4px; font-size: .6562rem; line-height: 16px; }
  html.side-rail .side-toggle { justify-content: center; gap: 0; width: 44px; margin-left: auto; margin-right: auto; padding: 0; font-size: 0; }
  html.side-rail .side-toggle span { display: none; }
  /* 上部バー: 「記録」「新しい案件」「録音」は左、検索は広い窓にして右の道具の先頭に */
  .topbar-right > .tb-sep { margin-left: auto; }
  .topbar:not(.hc4) .topbar-right > .search-btn { min-width: 220px; justify-content: flex-start; color: var(--muted); font-weight: 500; }
  .topbar:not(.hc4) .topbar-right > .search-btn kbd { margin-left: auto; }
}
@media (min-width: 761px) and (max-width: 1100px) {
  .topbar:not(.hc4) .topbar-right > .search-btn { min-width: 0; }
}
@media print {
  .side-nav, .topbar > .brand { display: none !important; }
  #main-view { padding-left: 0 !important; }
}

/* ---------- 案件画面: 上の「要点」の1行と、パソコンでは右から出るパネル ---------- */
.deal-hl { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2); margin-bottom: var(--sp-3); }
.hl-chip { display: inline-flex; flex-direction: column; gap: 1px; min-width: 0; padding: 6px 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); line-height: 1.25; }
.hl-chip small { font-size: .6875rem; font-weight: 600; color: var(--muted); }
.hl-chip b { font-size: .875rem; font-weight: 700; white-space: nowrap; }
.hl-chip b .badge { margin: 0; }
.hl-acts { margin-left: auto; display: inline-flex; align-items: center; gap: var(--sp-2); }
.hl-acts .cu-link, .hl-acts > .btn { display: inline-flex; align-items: center; margin: 0; }
.hl-acts .cu-link a { display: inline-flex; align-items: center; gap: 6px; min-height: 32px; padding: 0 12px; border-radius: 8px; background: var(--primary-soft); font-weight: 700; font-size: .8438rem; text-decoration: none; }
.hl-acts .cu-link a:hover { filter: brightness(.97); }
.hl-acts .btn .i { margin-right: 4px; color: var(--purple); }
@media (max-width: 760px) {
  .deal-hl { gap: 6px; }
  .hl-chip { padding: 4px 10px; }
  .hl-chip b { font-size: .8438rem; }
  .hl-acts { margin-left: 0; width: 100%; }
  .hl-acts .cu-link a, .hl-acts > .btn { min-height: var(--btn-h-sm); height: var(--btn-h-sm); }
}
/* パソコン(1100px 以上): 案件は右から出るパネル。左に一覧が少し見えたまま、外側を押すと閉じる */
@media (min-width: 1100px) {
  dialog.side-panel { margin: 0 0 0 auto; width: min(1080px, calc(100vw - 280px)); max-width: none; height: 100dvh; max-height: 100dvh; border-radius: 18px 0 0 18px;
    box-shadow: -12px 0 40px rgba(16, 24, 40, .18); }
  dialog.side-panel[open] { animation: panel-in .26s cubic-bezier(.2, .8, .3, 1); }
  dialog.side-panel::backdrop { background: rgba(15, 20, 30, .22); }
  dialog.side-panel .modal-head { border-radius: 18px 0 0 0; }
}
@keyframes panel-in { from { transform: translateX(48px); opacity: 0; } to { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) { dialog.side-panel[open] { animation: none; } }
/* 顧客一覧: 取引額・配信の同意はふだん畳む。選んでいる条件は見出しのチップ(× で外す) */
.cu-more-f { display: flex; flex-direction: column; gap: var(--sp-3); }
.cu-more-f > summary { display: flex; align-items: center; flex-wrap: wrap; gap: var(--sp-2); width: fit-content; min-height: 36px; padding: 4px 14px; border: 1px dashed var(--border); border-radius: 18px;
  color: var(--muted); font-size: .8438rem; font-weight: 600; cursor: pointer; list-style: none; }
.cu-more-f > summary::-webkit-details-marker { display: none; }
.cu-more-f > summary:hover { color: var(--primary); border-color: var(--primary); }
.cu-more-f[open] > summary { border-style: solid; color: var(--primary); background: var(--primary-soft); border-color: transparent; }
.cu-more-f > summary .i { width: 16px; height: 16px; }
.cu-more-f > .cu-bands { margin: 0; }
.f-chip { display: inline-flex; align-items: center; gap: 4px; padding: 2px 4px 2px 10px; border-radius: 12px; background: var(--primary); color: var(--on-primary); font-size: .7812rem; }
.f-chip button { border: 0; background: rgba(255, 255, 255, .2); color: #fff; width: 20px; height: 20px; border-radius: 50%; cursor: pointer; line-height: 1; padding: 0; font-size: 13px; }
/* スマホ: アクションの行のスワイプ。右へ=完了(緑)、左へ=明日へ(オレンジ)。引いた下に出る色と文字は行の影(box-shadow)で描く */
@media (max-width: 760px) {
  #content .todo { touch-action: pan-y; position: relative; }
  #content .todo.swiping { z-index: 2; }
  #content .todo.swiping::after { position: absolute; top: 0; bottom: 0; display: grid; place-items: center; width: 120px; font-weight: 800; font-size: .875rem; color: #fff; border-radius: var(--radius); }
  #content .todo.swiping[data-swipe="done"]::after { content: "✓ 完了"; right: 100%; margin-right: 8px; background: var(--green); opacity: .55; }
  #content .todo.swiping[data-swipe="later"]::after { content: "明日へ →"; left: 100%; margin-left: 8px; background: var(--orange); opacity: .55; }
  #content .todo.swiping.swipe-far[data-swipe]::after { opacity: 1; }
}
.toast-undo { margin-left: 12px; border: 0; background: rgba(255, 255, 255, .16); color: #fff; font: inherit; font-weight: 700; padding: 6px 12px; border-radius: 8px; cursor: pointer; }

/* 文字の大きさを選ぶ(名前のメニューの中と、⌘K の「文字の大きさ」)。押すとすぐ全画面に効く */
.user-menu.menu-rich .mi.fs-mi { display: flex; align-items: center; gap: 12px; padding: 8px 10px; }
.fs-seg { display: flex; gap: 4px; margin-top: 6px; }
.fs-seg:not(.fs-big) button { padding: 2px 4px; }
.fs-seg button { flex: 1; min-height: 36px; text-align: center; padding: 2px 6px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); color: var(--text); font-weight: 700; line-height: 1.2; cursor: pointer; white-space: nowrap; }
.fs-seg button:hover { background: var(--surface-2); }
.fs-seg button[aria-pressed="true"] { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
/* ボタンの字は、選んだときの大きさの見本(小・標準・大・特大) */
.fs-seg button[data-fs="s"] { font-size: 12px; }
.fs-seg button[data-fs="m"] { font-size: 13px; }
.fs-seg button[data-fs="l"] { font-size: 15px; }
.fs-seg button[data-fs="xl"] { font-size: 17px; }
.fs-seg.fs-big { flex-direction: column; gap: 8px; }
.fs-seg.fs-big button { min-height: 56px; text-align: left; padding: 8px 14px; }
.fs-seg.fs-big button small { display: block; font-weight: 400; font-size: 12px; opacity: .8; }

/* ---------- 事業。色は事業の設定(--bz を要素に入れる)。濃い字と淡い背景は色から作る ---------- */
:root { --bz: var(--primary); --bz-ink: var(--bz); --bz-soft: color-mix(in srgb, var(--bz) 12%, var(--surface)); }
@media (prefers-color-scheme: dark) { :root { --bz-ink: color-mix(in srgb, var(--bz) 55%, #fff); --bz-soft: color-mix(in srgb, var(--bz) 22%, var(--surface)); } }
.biz-badge, .biz-seg button, .jt-kid, .jt-pick, .biz-pick, .pt-karte, .pt-landing, .pt-land, .pt-spark, .bs-item { --bz-ink: var(--bz); --bz-soft: color-mix(in srgb, var(--bz) 12%, var(--surface)); }
@media (prefers-color-scheme: dark) { .biz-badge, .biz-seg button, .jt-kid, .jt-pick, .biz-pick, .pt-karte, .pt-landing, .pt-land, .pt-spark, .bs-item { --bz-ink: color-mix(in srgb, var(--bz) 55%, #fff); --bz-soft: color-mix(in srgb, var(--bz) 22%, var(--surface)); } }
.biz-chip { display: flex; align-items: center; margin-left: 10px; }
.biz-badge { display: inline-flex; align-items: center; font-size: .75rem; font-weight: 700; padding: 1px 9px; border-radius: 999px; line-height: 1.7; white-space: nowrap; margin-right: 6px; vertical-align: 1px; background: var(--bz-soft); color: var(--bz-ink); }
.biz-chip .biz-badge { margin-right: 0; font-size: .8125rem; padding: 2px 12px; }
.biz-seg { display: inline-flex; background: var(--surface-2); border-radius: 10px; padding: 3px; gap: 2px; }
.biz-seg button { border: 0; background: none; font: inherit; font-size: .8125rem; font-weight: 700; padding: 3px 12px; border-radius: 7px; color: var(--muted); cursor: pointer; }
.biz-seg button.active { background: var(--surface); color: var(--bz-ink); box-shadow: inset 0 -2px 0 var(--bz); }
.biz-chip.switching .biz-seg { opacity: .6; cursor: progress; }  /* 先読みが間に合わなかったときだけ(読み込み中) */
body.multi-biz .topbar { box-shadow: inset 0 -2px 0 var(--bz); }
.biz-summary { font-size: .6875rem; color: var(--muted); border: 1px dashed var(--border); border-radius: 6px; padding: 0 6px; margin-left: 6px; white-space: nowrap; }
.biz-picks, .jt-picks { display: grid; gap: 6px; margin-bottom: 12px; }
.biz-picks .lbl, .jt-picks .lbl { font-weight: 700; font-size: .875rem; }
.biz-pick-row { display: flex; flex-wrap: wrap; gap: 6px 14px; }
.biz-pick input[type=checkbox], .jt-pick input[type=checkbox] { accent-color: var(--bz); }
@media (max-width: 760px) { .biz-chip { margin-left: 6px; } }
/* 幅の狭いスマホは、上部バーに名刺の読み取り(#card-top)も並ぶので、事業の切り替えを詰める */
@media (max-width: 430px) {
  .biz-chip { margin-left: 2px; }
  .biz-seg { padding: 2px; }
  .biz-seg button { padding: 3px 7px; }
  .topbar .m-back:not([hidden]) { width: 34px; }
}
/* 共同提案(joint.js) */
.jt-badge { background: linear-gradient(90deg, var(--primary), var(--orange)); color: var(--on-primary); font-size: .6562rem; padding: 0 6px; margin-right: 5px; vertical-align: 1px; }
.jt-panel { margin-bottom: 14px; }
.jt-card { border: 1px solid var(--border); border-radius: 12px; padding: 12px; margin-top: 10px; display: grid; gap: 8px; }
.jt-head { display: flex; justify-content: space-between; gap: 8px; align-items: flex-start; }
.jt-kids { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 8px; }
.jt-kid { border-radius: 10px; padding: 8px 10px; background: var(--bz-soft); border-left: 4px solid var(--bz); display: grid; gap: 2px; }
.jt-pick { border-left: 4px solid var(--bz); background: var(--bz-soft); border-radius: 10px; padding: 8px 10px; display: grid; gap: 4px; }
.jt-pick label { margin: 0; }
.jt-split-in { display: flex; flex-wrap: wrap; gap: 8px 16px; margin-bottom: 10px; }
.jt-split-in label { display: flex; align-items: center; gap: 6px; margin: 0; }
.jt-split-in input { width: 80px; }
.jt-todos { display: grid; gap: 4px; }
.jt-panel label.jt-todo { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-weight: 400; color: var(--text); margin: 0; }
.jt-todo input[type=checkbox] { width: 18px; height: 18px; min-height: 0; flex: none; margin: 0; padding: 0; }
.jt-todo.done .jt-t { text-decoration: line-through; opacity: .6; }
.jt-todos .btn { justify-self: start; }
/* 事業ごとの部品(parts.js)。顧客一覧・カルテ・アクション・週次MTG・着地見込みに出す。色はいまの事業 */
.pt-spark { display: inline-flex; align-items: flex-end; gap: 2px; height: 22px; width: 84px; vertical-align: middle; }
.pt-spark i { flex: 1; background: var(--bz); border-radius: 2px 2px 0 0; opacity: .75; }
.pt-rank-S { background: var(--red-soft); color: var(--red); }
.pt-rank-A { background: var(--orange-soft); color: var(--orange); }
.pt-rank-B { background: var(--primary-soft); color: var(--primary); }
.pt-rank-C { background: var(--border); color: var(--muted); }
.pt-karte { margin-bottom: 14px; border-left: 4px solid var(--bz); }
.pt-karte-row { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
.pt-karte-row .pt-spark { height: 40px; width: 160px; }
.pt-landing { margin-bottom: 14px; border-left: 4px solid var(--bz); }
.pt-land-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 10px; }
.pt-land { background: var(--bz-soft); border-radius: 12px; padding: 10px 12px; }
.pt-land .lbl { font-size: .8125rem; color: var(--muted); font-weight: 700; }
.pt-land .num { font-size: 1.5rem; font-weight: 800; }
.pt-done { margin-top: 10px; }
.pt-decisions { margin-top: 14px; }
.pt-dec.done .action { text-decoration: line-through; opacity: .6; }
#pt-counts input[type=number] { max-width: 110px; }
/* 事業の設定(bizset.js) */
.bs-sample { display: flex; gap: 12px; align-items: center; justify-content: space-between; padding: 12px 14px; margin-bottom: 14px; border-radius: 12px; background: var(--orange-soft); border: 1px solid var(--orange); }
.bs-sample .btn { flex: none; }
.bs-wrap { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 16px; align-items: start; }
.bs-list { display: grid; gap: 6px; position: sticky; top: 0; }
.bs-item { display: flex; gap: 8px; align-items: center; text-align: left; border: 1px solid var(--border); background: var(--surface); border-radius: 10px; padding: 8px 10px; font: inherit; color: var(--text); cursor: pointer; }
.bs-item small { display: block; font-size: .6875rem; color: var(--muted); }
.bs-item.active { border-color: var(--bz); background: var(--bz-soft); box-shadow: inset 3px 0 0 var(--bz); }
.bs-dot { width: 12px; height: 12px; border-radius: 50%; background: var(--bz); flex: none; }
.bs-form fieldset { border: 1px solid var(--border); border-radius: 12px; padding: 10px 12px; margin: 0 0 12px; }
.bs-form legend { font-weight: 700; padding: 0 4px; }
.bs-phase { display: grid; grid-template-columns: minmax(0, 1.2fr) 84px minmax(0, 2fr) auto; gap: 6px; align-items: center; margin-bottom: 6px; }
.bs-phase input { margin: 0; }
.bs-prob { display: flex; align-items: center; gap: 4px; margin: 0; }
.bs-ops { display: flex; gap: 4px; }
.bs-parts { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 10px; }
.bs-part { border: 1px solid var(--border); border-radius: 10px; padding: 8px 10px; display: grid; gap: 4px; }
.bs-part label.check-label { margin: 0; }
.bs-params { display: grid; gap: 4px; }
.bs-params label { margin: 0; }
@media (max-width: 760px) {
  .bs-wrap { grid-template-columns: 1fr; }
  .bs-list { position: static; grid-auto-flow: column; grid-auto-columns: max-content; overflow-x: auto; }
  .bs-phase { grid-template-columns: minmax(0, 1fr) 76px; }
  .bs-phase > input[name=ps] { grid-column: 1 / -1; }
}
label.tick { display: flex; align-items: center; gap: 8px; margin: 0; font-weight: 400; color: var(--text); cursor: pointer; }
label.tick input[type=checkbox] { width: 18px; height: 18px; min-height: 0; flex: none; margin: 0; padding: 0; accent-color: var(--bz, var(--primary)); }
.bs-part { align-content: start; }

/* 伸びしろ(取引余地ランキング)と AI の施策提案(growth.js) */
.hr-bar { display: block; height: 6px; border-radius: 3px; background: color-mix(in srgb, var(--orange) 22%, var(--surface)); overflow: hidden; margin-top: 4px; min-width: 72px; }
.hr-bar b { display: block; height: 100%; background: var(--primary); border-radius: 3px; }
.hr-row { grid-template-columns: 44px minmax(0, 1fr) 150px auto; }
.hr-no { display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: 1.05rem; color: var(--muted); }
.hr-why { margin-top: 4px; color: var(--text); }
.hr-sum { display: flex; flex-wrap: wrap; gap: 8px 28px; align-items: flex-end; margin-bottom: 12px; }
.hr-sum .lbl, .hr-axis .lbl { font-size: .78rem; color: var(--muted); display: flex; gap: 6px; align-items: center; }
.hr-sum .num, .hr-axis .num { font-size: 1.35rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.hr-sum p { flex-basis: 100%; margin: 0; }
.hr-axes { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; margin-top: 10px; }
.hr-axis { padding: 10px 12px; border-radius: 10px; background: var(--bz-soft, var(--primary-soft)); }
.plan-summary { margin: 4px 0 10px; font-weight: 600; }
.plan-list { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.plan-item { border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px; display: flex; flex-direction: column; gap: 6px; background: var(--surface); }
/* ボタンはカードの下端にそろえる(隣のカードが高くても、ボタンの位置と大きさは同じ) */
.plan-item > .btn-row { margin-top: auto; padding-top: 2px; }
.plan-item.done { opacity: .6; }
.plan-head { display: flex; gap: 8px; align-items: center; }
@media (max-width: 640px) { .hr-row { grid-template-columns: 36px 1fr; } .hr-row .sr-amount, .hr-row .sr-next { grid-column: 2; } }
.plan-head { align-items: flex-start; }
.plan-head b { flex: 1; line-height: 1.45; }
.plan-item .meta { display: flex; flex-wrap: wrap; gap: 2px 12px; font-size: .8125rem; color: var(--muted); }
#sec-headroom .todo > .badge { justify-self: start; align-self: center; min-width: 28px; text-align: center; }
/* 顧客カルテの見出しの、事業ごとの関係(customer.js custBizHtml)。どの事業から開いても同じ見た目 */
.cu-biz { --bz-ink: var(--bz); --bz-soft: color-mix(in srgb, var(--bz) 12%, var(--surface)); display: inline-flex; align-items: baseline; gap: 6px; background: var(--bz-soft); border-left: 3px solid var(--bz); border-radius: 8px; padding: 1px 9px; margin-right: 6px; font-size: .75rem; white-space: nowrap; }
.cu-biz b { color: var(--bz-ink); }
.cu-biz small { color: var(--muted); }
@media (prefers-color-scheme: dark) { .cu-biz { --bz-ink: color-mix(in srgb, var(--bz) 55%, #fff); --bz-soft: color-mix(in srgb, var(--bz) 22%, var(--surface)); } }
/* 顧客カルテの活動履歴: 共同の客は事業でも絞れる(事業の色の点を付ける) */
.cu-actbiz { margin-bottom: 6px; }
.cu-actbiz button { display: inline-flex; align-items: center; gap: 6px; }
.cu-actbiz .bs-dot { width: 8px; height: 8px; }
/* 共同の客(複数の事業の客)の印: 事業の色を横に並べた札 */
.biz-shared { display: inline-flex; vertical-align: 1px; margin-right: 6px; border-radius: 6px; overflow: hidden; font-size: .75rem; font-weight: 800; line-height: 1.6; flex: none; white-space: nowrap; box-shadow: 0 0 0 1px color-mix(in srgb, var(--text) 10%, transparent); }
.biz-shared i { font-style: normal; padding: 0 7px; background: var(--bz); color: #fff; letter-spacing: .02em; }
.page-head .pipe-legend { display: flex; flex-wrap: wrap; gap: 4px 0; margin: 4px 0 0; color: var(--muted); }
.pipe-legend > span { display: inline-flex; align-items: center; gap: 0; margin-right: 14px; }
.pipe-legend .lg-edge { width: 4px; height: 14px; border-radius: 2px; background: var(--c); margin-right: 6px; }

/* ---------- スマホの上部バー(Hiro 2026-10-29「携帯版の上部のデザインがcoolじゃない」「縦にすると上部のパイプラインという文字が見えない。横の時だけ表示でもいいのでは？」) ----------
   1行: ‹ 事業の切り替え(AM | MC) [画面の名前] …… 録音・名刺 │ 検索・さくら・?・通知・自分(線の細い同じ形のアイコン)
   縦向きは画面の名前を出さない(今の画面は下のメニューでわかる。切れた名前を出さない)。横向きは名前を出す。
   .topbar-right を display: contents にして、中のボタンを上部バーの並び(order)で並べる。PC の並びは変えない */
@media (max-width: 760px) {
  .topbar { align-items: center; column-gap: 2px; min-height: 0;
    padding: calc(6px + env(safe-area-inset-top)) 8px 6px 10px; border-bottom: 0;
    background: color-mix(in srgb, var(--surface) 82%, transparent); }
  body.multi-biz .topbar, body.scrolled .topbar { box-shadow: none; }
  /* 下の線: 事業の色から透明へ(スクロールしたら薄い影も) */
  .topbar::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 1px; background: var(--border); }
  body.multi-biz .topbar::after { height: 2px; background: linear-gradient(90deg, var(--bz), color-mix(in srgb, var(--bz) 0%, transparent)); }
  body.scrolled .topbar { box-shadow: 0 6px 16px -10px rgba(16, 24, 40, .25); }
  .topbar .topbar-right { display: contents; }

  .topbar .m-back:not([hidden]) { order: 1; width: 30px; height: 40px; margin-left: -6px; }
  .topbar .biz-chip { order: 2; margin-left: 0; flex: none; }
  .topbar .biz-seg { padding: 3px; border-radius: 999px; gap: 0; }
  .topbar .biz-seg button { min-height: 0; height: 28px; padding: 0 12px; border-radius: 999px; font-size: 13px; letter-spacing: .02em; box-shadow: none; transition: background-color .2s ease, color .2s ease; }  /* 字の大きさの設定で上部バーがあふれないよう px */
  .topbar .biz-seg button.active { background: var(--bz); color: #fff; box-shadow: 0 2px 6px -2px color-mix(in srgb, var(--bz) 70%, transparent); }
  .topbar .biz-chip .biz-badge { height: 28px; display: inline-flex; align-items: center; font-size: 13px; padding: 0 12px; }
  .topbar .m-title { order: 3; flex: 1 1 0; min-width: 0; margin-left: 8px; font-size: 1.1875rem; font-weight: 800; letter-spacing: 0; }

  /* 右側のアイコン: どれも 38px の丸・線の細い同じ形。録音(赤)と名刺(紺)だけ色を付け、細い線で区切る */
  .topbar .topbar-right > :is(#rec-top, #card-top:not([hidden]), .search-btn, #butler-top, #help-btn, .notif-btn, .user-chip) {
    order: 5; display: grid; place-items: center; position: relative; width: 36px; height: 38px; min-height: 0; padding: 0; border: 0; border-radius: 50%; background: none; color: var(--text); flex: none; }
  .topbar .topbar-right > #rec-top { order: 4; margin-left: auto; color: var(--red); }
  .topbar .topbar-right > #card-top { order: 4; color: var(--primary); }
  .topbar .topbar-right > :is(#rec-top, #card-top) span { display: none; }
  .topbar .topbar-right > .search-btn { margin-left: 5px; }
  .topbar .topbar-right > .search-btn::before { content: ""; position: absolute; left: -4px; top: 11px; bottom: 11px; width: 1px; background: var(--border); }
  .topbar .topbar-right > :is(#rec-top, #card-top, .search-btn, #help-btn, .notif-btn) .i { width: 22px; height: 22px; stroke-width: 1.8; }
  .topbar .topbar-right > :is(#rec-top, #card-top, .search-btn, #help-btn, .notif-btn, .user-chip):active { background: var(--surface-2); }
  .topbar .topbar-right > #help-btn .new-dot { top: 5px; right: 5px; }
  /* さくら: 「AI」の札の代わりに、細い紺の輪と小さな点 */
  .topbar .topbar-right > #butler-top { overflow: visible; }
  .topbar .topbar-right > #butler-top .butler-svg { width: 30px; height: 30px; box-shadow: 0 0 0 2px var(--surface), 0 0 0 3.5px color-mix(in srgb, var(--primary) 35%, transparent); }
  .topbar .topbar-right > #butler-top .ai-tag { display: none; }
  .topbar .topbar-right > #butler-top::after { content: ""; position: absolute; right: 3px; bottom: 5px; width: 9px; height: 9px; border-radius: 50%;
    background: var(--primary); box-shadow: 0 0 0 2px var(--surface); }
  .topbar .topbar-right > #butler-top.active .butler-svg { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--primary); }
  .topbar .topbar-right > .user-chip .avatar { width: 30px; height: 30px; margin: 0; font-size: .8125rem; background: var(--primary); }
  .topbar .topbar-right > .user-chip.has-new::after { top: 4px; right: 4px; }
}
/* 縦向きは画面の名前を出さない */
@media (max-width: 760px) and (orientation: portrait) {
  .topbar .m-title { display: none; }
}
/* 幅の狭いスマホ(iPhone 13〜16・SE・Android の 360〜400px): アイコンと事業の切り替えを詰めて1行に収める */
@media (max-width: 400px) {
  .topbar { padding-left: 8px; padding-right: 4px; column-gap: 0; }
  .topbar .topbar-right > :is(#rec-top, #card-top:not([hidden]), .search-btn, #butler-top, #help-btn, .notif-btn, .user-chip) { width: 32px; height: 36px; }
  .topbar .topbar-right > #butler-top .butler-svg { width: 28px; height: 28px; }
  .topbar .topbar-right > .user-chip .avatar { width: 28px; height: 28px; }
  .topbar .topbar-right > :is(#rec-top, #card-top, .search-btn, #help-btn, .notif-btn) .i { width: 21px; height: 21px; }
  .topbar .biz-seg button { padding: 0 9px; }
}
@media (max-width: 340px) {
  .topbar .topbar-right > :is(#rec-top, #card-top:not([hidden]), .search-btn, #butler-top, #help-btn, .notif-btn, .user-chip) { width: 29px; }
  .topbar .topbar-right > .search-btn { margin-left: 2px; }
  .topbar .topbar-right > .search-btn::before { left: -2px; }
  .topbar .biz-seg button { padding: 0 7px; }
}
/* 前に開いたときの起動データで描いていて、最新を読んでいる間(app.js の bootFresh)。上の端に細い帯を流す */
body.boot-stale::before { content: ""; position: fixed; z-index: 1000; top: 0; left: 0; right: 0; height: 2px; background: linear-gradient(90deg, transparent, var(--bz, var(--primary)), transparent); background-size: 40% 100%; background-repeat: no-repeat; animation: boot-stale 1.1s linear infinite; pointer-events: none; }
@keyframes boot-stale { from { background-position: -40% 0; } to { background-position: 140% 0; } }
@media (prefers-reduced-motion: reduce) { body.boot-stale::before { animation: none; background: var(--bz, var(--primary)); opacity: .5; } }

/* ========== 落ち着いた見た目(Hiro 2026-10-29: 「ごちゃごちゃ・リッチすぎて見ていて疲れる。PDCA がわかるように」) ==========
   決まりごと: 色はブランドの紺と「要対応」の赤だけ。緑・橙・紫は文字の色を少し沈め、札は色の面ではなく細い枠に。
   影はやめ、薄い枠線1本・角丸12のカードにそろえる。太字は見出し・会社名・大事な数字だけ。各画面の上の説明文は1行に。
   文字の大きさの既定(大)は変えない。ここより上の個別のスタイルを上書きするので、新しい画面もこの決まりに合わせる */
:root {
  --bg: #f7f8fa; --border: #e6e8ec; --line: #eef0f3; --muted: #5b6472; --faint: #687181; --red: #c8281b;
  --shadow: none; --radius: 12px;
  --orange: #a1490f; --green: #1d6b4a; --purple: #5b4a8a; --yellow: #7a6000;
  --red-soft: #fbeeec; --orange-soft: #fbf3ec; --green-soft: #edf5f1; --purple-soft: #f3f1f8; --yellow-soft: #faf6e6;
}
@media (prefers-color-scheme: dark) {
  /* 上の明るい表示の値をそのまま暗い表示に持ち込まない(背景が明るいまま字も明るくなり、読めなかった) */
  :root { --bg: #0f141b; --border: #2a3342; --line: #232b37; --red: #ff6b5e; --muted: #a3acba; --faint: #a3acba; --shadow: none;
    --orange: #e0a070; --green: #7cc9a0; --purple: #b9a8e8; --yellow: #f2c94c;
    --red-soft: #3a1d1b; --orange-soft: #3a2614; --green-soft: #12301f; --purple-soft: #2a2140; --yellow-soft: #352d10; }
}
/* 枠線は幅を取らない内側の線で(今までの影と同じ幅のまま。スマホで横にはみ出さない) */
.panel, .kpi, .todo, .card, .summary-strip .tile { box-shadow: inset 0 0 0 1px var(--border); }
.empty { box-shadow: none; }
.panel h2, .todo-section h2 { font-weight: 700; }
.kpi .num, .tile .num { font-weight: 700; }
.kpi .lbl, .tile .lbl { font-weight: 500; }
.todo .action { font-weight: 600; }
.todo .meta a, .link { font-weight: 500; }
.badge { font-weight: 600; }
.b-orange, .b-yellow, .b-green, .b-purple, .b-gray { background: transparent; box-shadow: inset 0 0 0 1px var(--border); }
.b-blue { background: transparent; box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--primary) 25%, transparent); }
.todo-section h2 .dot { width: 6px; height: 6px; }
/* 期限ごとの数字: 色の太い線をやめ、数字が「要対応」のときだけ赤 */
.summary-strip .tile { border-left: 0 !important; }
.summary-strip .tile .num { color: var(--text) !important; font-size: 1.5rem; }
.summary-strip .tile.red .num { color: var(--red) !important; }
.summary-strip.stuck { box-shadow: 0 1px 0 var(--border); }
/* カード(パイプライン): 色の左線は細く */
.card { border-left-width: 0; }
/* 期限切れ・未設定=赤の太い線、今日が期限=紺の点線(色だけでなく形でも見分ける。凡例の .lg-alert / .lg-today と同じ) */
.card.overdue, .card.noaction { box-shadow: inset 4px 0 0 var(--red), inset 0 0 0 1px var(--border); }
.card.today { position: relative; }
.card.today::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; border-radius: 8px 0 0 8px;
  background: repeating-linear-gradient(to bottom, var(--primary) 0 5px, transparent 5px 9px); }
/* 画面の上の説明文は1行で控えめに */
.page-head:has(> .filters) > div:first-child > p { -webkit-line-clamp: 1; color: var(--faint); font-size: .8125rem; }
.page-head > div:first-child > p.muted { color: var(--faint); font-size: .8125rem; }
/* 成功事例・アドバイスの箱などの色の面は白に */
.advice-box, .cu-advice { background: var(--surface); border: 1px solid var(--border); }
.instruction { background: transparent; border: 1px solid var(--border); }
/* 一覧の行の札: フェーズは色の札ではなく灰色の文字に。サービス(AUC / i-Auc)・見込みのランクも枠だけ */
.meta .badge.b-blue, .meta .badge.b-purple, .meta .badge.b-green, .meta .badge.b-gray, .card .badge.b-blue, .card .badge.b-purple, .card .badge.b-green { box-shadow: none; background: none; padding: 0; color: var(--muted); font-weight: 500; }
.svc.auc, .svc.iauc { background: transparent; color: var(--muted); border: 1px solid var(--border); font-weight: 600; }
.prio.g-A { background: var(--primary-soft); color: var(--primary); }
.prio.g-B { background: var(--surface-2); color: var(--primary); }
.todo .meta a[data-open] { text-decoration: none; }
/* 売上・件数の進み具合のバー: 実績=濃い紺、見込み=薄い紺、目標=細い灰色の線(緑と赤をやめる) */
.pbar { height: 6px; border-radius: 3px; background: var(--line); }
.pbar .won, .sw.won, .fc-stack .won { background: var(--primary); }
.pbar .exp { background: var(--primary); opacity: .3; }
.sw.wt, .fc-stack .wt { background: color-mix(in srgb, var(--primary) 35%, var(--surface)); }
.pbar .tgt { width: 2px; background: var(--text); opacity: .45; top: -3px; bottom: -3px; }
.sw.tg { background: var(--text); opacity: .45; width: 2px; }
.mtg-big { font-size: 1.75rem; font-weight: 700; }
.rev-gap .badge, .rev-todo .badge { background: none; box-shadow: none; padding: 0; font-weight: 600; }
.rev-pace b.down, .rev-pace b.up { color: var(--text); }
.up { font-weight: 600; } .down { font-weight: 600; }
.todo .meta a[data-open]:hover, .link:hover { text-decoration: underline; text-underline-offset: 3px; }

/* ---------- アクションの上の「今月のPDCA」(app.js pdcaStripHtml) ---------- */
.pdca { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 20px; overflow: hidden; }
.pdca-cell { padding: 14px 18px; border-left: 1px solid var(--line); min-width: 0; }
.pdca-cell:first-child { border-left: 0; }
.pdca-cell[role="button"] { cursor: pointer; }
.pdca-cell[role="button"]:hover { background: var(--surface-2); }
.pdca-cell[role="button"]:focus-visible { outline: 2px solid var(--primary); outline-offset: -2px; }
.pdca-k { display: flex; align-items: center; gap: 6px; font-size: .75rem; color: var(--faint); letter-spacing: .04em; }
.pdca-k b { display: inline-grid; place-items: center; width: 18px; height: 18px; border-radius: 5px; background: var(--primary-soft); color: var(--primary); font-size: .6875rem; flex: none; }
.pdca-v { font-size: 1.375rem; font-weight: 700; margin-top: 4px; line-height: 1.3; font-variant-numeric: tabular-nums; }
.pdca-v small { font-size: .75rem; font-weight: 400; color: var(--muted); margin-left: 3px; }
.pdca-s { font-size: .78rem; color: var(--muted); margin-top: 2px; }
.pdca-s .alert { color: var(--red); }
.pdca-bar { height: 4px; border-radius: 2px; background: var(--line); margin-top: 8px; overflow: hidden; }
.pdca-bar i { display: block; height: 100%; background: var(--primary); border-radius: 2px; }
.pdca-link { border: 0; background: none; padding: 0; color: var(--primary); font: inherit; font-weight: 600; cursor: pointer; }
@media (max-width: 760px) {
  .pdca { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pdca-cell { padding: 12px 14px; }
  .pdca-cell:nth-child(odd) { border-left: 0; }
  .pdca-cell:nth-child(n+3) { border-top: 1px solid var(--line); }
  .pdca-v { font-size: 1.2rem; }
}

/* ---------- メニューを PDCA で分ける見出し(app.js navGroupHead) ---------- */
.nav-grp { display: none; }
@media (min-width: 761px) {
  .side-nav .tabs .nav-grp { display: flex; align-items: center; gap: 6px; margin: 12px 12px 2px; font-size: .6875rem; color: var(--faint); letter-spacing: .06em; white-space: nowrap; }
  .side-nav .tabs .nav-grp b { display: inline-grid; place-items: center; width: 16px; height: 16px; border-radius: 4px; background: var(--line); color: var(--muted); font-size: .625rem; }
  html.side-rail .side-nav .tabs .nav-grp { justify-content: center; margin: 10px 0 2px; }
  html.side-rail .side-nav .tabs .nav-grp span { display: none; }
  .side-nav .tabs button { font-weight: 500; min-height: 36px; }
  .side-nav .tabs button.active { font-weight: 700; }
  .side-nav .tabs button.active::before { display: none; }
  .side-nav { border-top-color: var(--border); }
}
.sheet-grid .nav-grp { display: flex; grid-column: 1 / -1; align-items: center; gap: 6px; margin: 8px 4px 0; font-size: .75rem; color: var(--faint); }
.sheet-grid .nav-grp b { display: inline-grid; place-items: center; width: 16px; height: 16px; border-radius: 4px; background: var(--line); color: var(--muted); font-size: .625rem; }

/* ---------- 週次MTG: 決めたこと(改善)を議題の横に ---------- */
@media (min-width: 1600px) {  /* 1600px 未満(ノートPCなど)は横に並べると議題も決めたことも窮屈なので、議題の下に置く */
  .mtg-layout.has-aside { display: grid; grid-template-columns: minmax(0, 1fr) clamp(340px, 27%, 520px); gap: 20px; align-items: stretch; }
  /* 列の高さは左の議題に合わせる(決めたことが多くても左の下に大きな空白を作らない。2026-11-03「この巨大スペースださい」)。
     中身は列の中で上に貼り付き、入りきらない分は欄の中でスクロール */
  .mtg-aside { position: relative; min-height: 360px; }
  .mtg-aside-in { position: absolute; inset: 0; }
  .mtg-aside .pt-decisions { position: sticky; top: calc(var(--topbar-h, 64px) + 12px); max-height: min(100%, calc(100vh - var(--topbar-h, 64px) - 24px)); overflow-y: auto; }
  /* 期日の札を上に、本文の右下に「済み」(ボタンだけの行を作らず縦に詰める) */
  .mtg-aside .todo { grid-template-columns: minmax(0, 1fr) auto; gap: 6px 10px; padding: 10px 12px; }
  .mtg-aside .todo .due { flex-direction: row; gap: 6px; justify-self: start; grid-column: 1 / -1; }
  .mtg-aside .todo-buttons { justify-content: flex-end; align-self: end; }
  /* 本文は列いっぱいに、担当・MTGの行の右にボタン(本文の幅をボタンで削らない) */
  .mtg-aside .pt-dec > div:nth-child(2) { display: contents; }
  .mtg-aside .pt-dec .action { grid-column: 1 / -1; }
  .mtg-aside .pt-dec .meta { align-self: center; }
  .mtg-aside .pt-decisions { margin-top: 0; }
  .mtg-aside .fc-head { flex-wrap: wrap; }
  .mtg-aside .fc-head h2 { font-size: .9375rem; }
}

/* ---------- 顧客カルテのタブ(customer.js CU_TABS) ---------- */
.cu-ktabs { display: flex; gap: 22px; border-bottom: 1px solid var(--border); margin: 4px 0 18px; overflow-x: auto; scrollbar-width: none; }
.cu-ktabs::-webkit-scrollbar { display: none; }
.cu-ktabs button { border: 0; background: none; padding: 10px 0; font: inherit; font-size: .875rem; color: var(--muted); cursor: pointer; white-space: nowrap; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.cu-ktabs button.active { color: var(--text); font-weight: 700; border-bottom-color: var(--text); }
.cu-ktabs .n { margin-left: 5px; color: var(--faint); font-weight: 500; }
.cu-ktabs .n.alert { color: var(--red); }
.cu-pane { display: none; }
.cu-pane.on { display: block; }
@media print { .cu-pane { display: block; } .cu-ktabs { display: none; } }
.cu-health-line { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; width: 100%; text-align: left; margin: 0 0 16px; padding: 10px 14px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); font: inherit; font-size: .875rem; cursor: pointer; color: var(--text); }
.cu-health-line .i { width: 16px; height: 16px; color: var(--muted); }
.cu-health-line .muted:last-child { margin-left: auto; }
.cu-health-line:hover { background: var(--surface-2); }
.cu-pane > .cu-kpis { margin-bottom: 16px; }
.cu-dates > div { box-shadow: inset 0 0 0 1px var(--border); }
/* パイプラインの列見出し(矢羽根): フェーズが進むほど少しずつ濃くなる、やわらかい紺のグラデーション。参加開始・成約はやわらかい緑。
   見出しの文字ははっきり(Hiro 2026-10-29: 矢羽根と文字はもう少し目立ってよい・やわらかいグラデーションはあり)。列の中は見出しの色をごく薄く */
.board .column:nth-child(1) { --pp: #e9eff9; }
.board .column:nth-child(2) { --pp: #d9e4f5; }
.board .column:nth-child(3) { --pp: #c6d6f0; }
.board .column:nth-child(4) { --pp: #b2c7ea; }
.board .column:nth-child(5) { --pp: #9db8e3; }
.board .column:nth-child(n+6) { --pp: #8aa9dc; }
.board .column.won { --pp: #cfe9dc; }
@media (prefers-color-scheme: dark) {
  .board .column:nth-child(1) { --pp: #1c2840; } .board .column:nth-child(2) { --pp: #21304d; } .board .column:nth-child(3) { --pp: #26385a; }
  .board .column:nth-child(4) { --pp: #2b4068; } .board .column:nth-child(n+5) { --pp: #314876; } .board .column.won { --pp: #1d3a2e; }
}
.board .column:not(.lost) { background: color-mix(in srgb, var(--pp, var(--surface-2)) 22%, var(--surface)) !important; }
.board .column:not(.lost) .column-head { background: linear-gradient(90deg, color-mix(in srgb, var(--pp) 65%, var(--surface)), var(--pp)) !important; }
.board .column:not(.lost) .column-head .name { color: var(--primary) !important; font-weight: 700; font-size: .9375rem; }
.board .column.won .column-head .name { color: #17573c !important; }
.board .column:not(.lost) .column-head .sum { color: color-mix(in srgb, var(--primary) 70%, var(--muted)) !important; opacity: 1; }
.board .column.won .column-head .sum { color: #2c6a4f !important; }
@media (prefers-color-scheme: dark) {
  .board .column:not(.lost) .column-head .name { color: var(--text) !important; }
  .board .column:not(.lost) .column-head .sum, .board .column.won .column-head .sum { color: #c9d0db !important; }
  .board .column.won .column-head .name { color: var(--text) !important; }
}
.card .status { color: var(--muted); font-weight: 500; }
.summary-strip .tile { border-top: 0 !important; }
@media (max-width: 760px) {
  .todo-section h2 { flex-wrap: wrap; row-gap: 0; }
  .todo-section h2 > .muted { flex-basis: 100%; font-weight: 400; }
}

/* パイプラインの凡例は絞り込みのボタン(app.js pipeLegend) */
.page-head.stack > div:first-child > p.pipe-legend { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.pipe-legend .pl-flag { display: inline-flex; align-items: center; gap: 6px; margin: 0; padding: 3px 10px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface); color: var(--muted); font: inherit; cursor: pointer; white-space: nowrap; }
.pipe-legend .pl-flag:hover { color: var(--text); border-color: color-mix(in srgb, var(--primary) 35%, var(--border)); }
.pipe-legend .pl-flag b { font-weight: 700; color: var(--text); font-variant-numeric: tabular-nums; }
.pipe-legend .pl-flag.on { background: var(--primary-soft); border-color: var(--primary); color: var(--primary); }
.pipe-legend .pl-flag.on b { color: var(--primary); }
.pipe-legend .pl-flag .lg-edge { margin-right: 0; }
.pipe-legend .pl-flag .biz-shared, .pipe-legend .pl-flag .badge { margin-right: 0; }
.pipe-legend .pl-clear { border: 0; background: none; color: var(--primary); font: inherit; cursor: pointer; padding: 3px 4px; }
.lg-edge.lg-alert { width: 4px; background: var(--red); }
.lg-edge.lg-today { width: 4px; background: repeating-linear-gradient(to bottom, var(--primary) 0 4px, transparent 4px 7px); }
/* パイプラインの上: 説明3行と、切り替え・絞り込みのボタン群の左端と上端をそろえる(Hiro 2026-10-29: 水平を合わせた方がうつくしい)。
   説明の下に、同じ左端からボタン群を1段で並べる(入りきらない幅では折り返す。スマホは横にずらす) */
.page-head.pipe-head { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; align-items: start; }
.page-head.pipe-head > .filters { margin: 0; padding: 0; max-width: 100%; justify-content: flex-start; flex-wrap: wrap; overflow: visible; gap: 8px; }
.page-head.pipe-head > .filters select { width: auto; max-width: 13em; }
.page-head.pipe-head > .filters input[type="search"] { flex: 1 1 12em; width: auto; min-width: 10em; max-width: 24em; }
@media (max-width: 760px) {
  .page-head.pipe-head > .filters { flex-wrap: nowrap; overflow-x: auto; }
  .pipe-legend { flex-wrap: nowrap !important; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
  .pipe-legend::-webkit-scrollbar { display: none; }
}
/* 優先度の札は「優先A」と書く(prospect.js)。字が増えた分、大きな札は字を小さめに */
.prio { font-weight: 700; }
.prio-row .prio-rank .prio { font-size: .8125rem; padding: 0 8px; }
.prio-nums .prio { font-size: .9375rem; padding: 0 10px; }
/* 担当配置の見直しの試算: 見込みの増減を大きく出す(万円単位) */
.asg-total { display: grid; gap: var(--sp-1); }
.asg-gain { font-size: 1rem; font-weight: 600; display: flex; gap: var(--sp-2); align-items: baseline; flex-wrap: wrap; }
.asg-gain b { font-size: 1.5rem; color: var(--primary); }
.asg-gain b.down { color: var(--red); }
.asg-delta { font-weight: 600; white-space: nowrap; }
.asg-panel tfoot td { border-top: 1px solid var(--border); font-weight: 600; }

/* 顧客カルテの配置(Hiro 2026-10-29: どのタブもレイアウトが美しくない)。
   どのタブも「本文(広い列)+ 横の列(狭い列)」の同じ形(cuLayout)。カードは同じ枠・同じ余白で、列の中で同じ間隔に積む。
   広い画面では幅を使い、上の数字は1行に同じ高さで並べる。空のときの文は1行で小さく */
main.roomy { max-width: 1680px; }
.cu-head { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; align-items: start; }
@media (min-width: 1100px) { .cu-head { grid-template-columns: minmax(0, 1fr) auto; } .cu-head .btn-row { justify-content: flex-end; flex-wrap: nowrap; } }
.cu-head .cu-name { margin: 0 0 4px; }
.cu-head .meta .cu-date { color: var(--muted); white-space: nowrap; }
.cu-head .meta .cu-date b { color: var(--text); font-weight: 600; }
.cu-head.stuck { grid-template-columns: minmax(0, 1fr) auto; }
.cu-pane > * + * { margin-top: var(--sp-block); }
.cu-pane .panel { margin: 0; }
.cu-main, .cu-aside { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--sp-block); align-content: start; min-width: 0; }
.cu-main:empty, .cu-aside:empty { display: none; }
.cu-layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--sp-block); align-items: start; }
@media (min-width: 1100px) { .cu-layout { grid-template-columns: minmax(0, 1fr) minmax(300px, 32%); } }
@media (min-width: 1500px) { .cu-layout { grid-template-columns: minmax(0, 1fr) 440px; } }
.cu-none { margin: 0; color: var(--muted); font-size: .8125rem; }
.cu-pane .panel > .small.muted:last-child { margin: 0; }
.cu-pane .fc-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.cu-pane .fc-head h2 { margin: 0; }
/* 上の数字: 同じ高さのタイルを1行に(スマホは2列) */
.cu-stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--sp-3); }
@media (min-width: 900px) { .cu-stats { grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); grid-auto-flow: column; } }
.cu-stat { display: grid; align-content: start; gap: 2px; background: var(--surface); border: 0; border-radius: var(--radius); box-shadow: inset 0 0 0 1px var(--border); padding: 12px 16px; text-align: left; font: inherit; color: inherit; min-width: 0; }
.cu-stat .lbl { font-size: .75rem; color: var(--muted); }
.cu-stat b { font-size: 1.375rem; line-height: 1.25; font-weight: 700; overflow-wrap: anywhere; }
.cu-stat .sub { font-size: .75rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cu-stat.alert b { color: var(--red); }
.cu-stat.link { cursor: pointer; }
.cu-stat.link:hover { box-shadow: inset 0 0 0 1px var(--primary); }
.cu-stats > :last-child:nth-child(odd) { grid-column: 1 / -1; }
@media (min-width: 900px) { .cu-stats > :last-child:nth-child(odd) { grid-column: auto; } }
/* 横の列の小さなカード */
.cu-deals-mini .cu-deal + .cu-deal, .cu-contacts-mini .cu-contact + .cu-contact { margin-top: 8px; }
.cu-contacts-mini .cu-contact { padding: 0; border: 0; }
.cu-recent .timeline { margin: 0; }
/* 商談タブ: 同じ高さのカードを並べる */
.cu-pane[data-cu-pane="deals"] .cu-deals { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); gap: var(--sp-3); }
.cu-pane[data-cu-pane="deals"] .cu-deal { margin: 0; }
/* 活動履歴タブ: 記録の入力欄はふだん畳む。開いたら履歴の上に */
.cu-loggrid, .cu-loggrid.open { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--sp-block); }
@media (min-width: 1300px) { .cu-loggrid.open { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: start; } }
.cu-loggrid .cu-logform { display: none; }
.cu-loggrid.open .cu-logform { display: block; }
.cu-acts .fc-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
.cu-loggrid.open #cu-log-open { display: none; }
.log-panel { border: 0; box-shadow: inset 0 0 0 1px var(--border); border-radius: var(--radius); }
/* 1列のとき(スマホ・狭い画面)は、アクションのすぐ下に横の列(進行中の商談・先方担当者)を出し、長いニュースなどはその後に */
@media (max-width: 1099px) {
  .cu-layout { display: flex; flex-direction: column; }
  .cu-layout > .cu-main, .cu-layout > .cu-aside { display: contents; }
  .cu-layout > .cu-main > * { order: 3; }
  .cu-layout > .cu-main > :first-child { order: 1; }
  .cu-layout > .cu-aside > * { order: 2; }
}
@media (max-width: 760px) {
  .cu-stat { padding: 10px 12px; }
  .cu-stat b { font-size: 1.125rem; }
  .cu-head .btn-row { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .cu-head .btn-row > * { flex: none; }
}
/* 顧客カルテの見出し: 事業ごとの関係と顧客担当(共同の客は AM・MC それぞれに担当がいる)。
   事業ごとに1行で、札・状態・担当・変更の列を行どうしでそろえる(Hiro 2026-10-29「携帯で2人の担当営業の配置がうつくしくない」) */
.cu-head .meta .cu-bizgrid { flex-basis: 100%; }
.cu-bizgrid { display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; align-items: center; column-gap: 10px; row-gap: 6px; max-width: 520px; margin: 2px 0; }
.cu-bizgrid.solo { grid-template-columns: minmax(0, 1fr) auto auto; }
.cu-bizrow { display: contents; --bz-ink: var(--bz); --bz-soft: color-mix(in srgb, var(--bz) 12%, var(--surface)); }
@media (prefers-color-scheme: dark) { .cu-bizrow { --bz-ink: color-mix(in srgb, var(--bz) 55%, #fff); --bz-soft: color-mix(in srgb, var(--bz) 22%, var(--surface)); } }
.cu-biztag { min-width: 44px; text-align: center; font-size: .75rem; font-weight: 800; line-height: 1.8; padding: 0 8px; border-radius: 6px; background: var(--bz-soft); color: var(--bz-ink); box-shadow: inset 3px 0 0 var(--bz); }
.cu-bizstate { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text); font-size: .8125rem; }
.cu-bizstate small { margin-left: 6px; color: var(--muted); font-size: .6875rem; }
.cu-bizowner { display: inline-flex; align-items: baseline; gap: 6px; white-space: nowrap; font-size: .8125rem; }
.cu-bizowner small { color: var(--muted); font-size: .6875rem; }
.cu-bizowner b { color: var(--text); }
.cu-owner-btn { display: inline-grid; place-items: center; width: 28px; height: 28px; padding: 0; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); color: var(--muted); cursor: pointer; }
.cu-owner-btn:hover { color: var(--bz-ink); border-color: var(--bz); }
.cu-owner-btn .i { width: 15px; height: 15px; }
/* 見出しのボタン: 広い画面は「アイコン+名前」、スマホは同じ幅のアイコン+短い名前を1列に(横にはみ出さない) */
.cu-actions .btn { gap: 6px; }
.cu-actions .lb-short { display: none; }
@media (max-width: 760px) {
  .cu-head .btn-row.cu-actions { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 6px; overflow: visible; justify-content: stretch; }
  .cu-head .btn-row.cu-actions > .btn { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 52px; padding: 6px 2px; font-size: .6875rem; line-height: 1.2; white-space: nowrap; min-width: 0; }
  .cu-actions .lb-full { display: none; }
  .cu-actions .lb-short { display: inline; }
  .cu-actions .btn .i { width: 18px; height: 18px; }
  .cu-bizgrid { column-gap: 8px; max-width: none; }
}

/* ---------- 数の丸(バッジ)の字を、丸の上下左右のまん中に(Hiro 2026-10-29「赤丸内の数値の位置が美しくない。全てチェックして」) ----------
   以前は line-height や flex で行の高さの中央に置いていたが、字体(Hiragino・Meiryo・Noto)ごとに上下の余白がちがい、数字が1〜2px 上下にずれていた。
   text-box で字の箱を「数字の高さ(cap)」まで削り、残りを上の余白にする → どの字体でも数字の中心が丸の中心に来る。
   --bh: 丸の高さ、--bb: 枠の太さ、--bx: 左右の余白。1・12・99+ は min-width で丸、桁が増えると横に伸びる。
   text-box が使えない古いブラウザは行の高さで中央に。tests/badge_center.js が画面の上で字の位置を測る */
.nt-count, .tabs .count, .bottom-nav .count, .sr-toggle .count, .tf-bar .count, .menu-new, .up-new, .tf-num, .mtg-no, .wh-step, .asg-step b, th[data-tf-n]::before, #butler-top .ai-tag {
  --bh: 18px; --bb: 0px; --bx: 5px;
  display: inline-block; box-sizing: border-box; height: var(--bh); min-width: var(--bh); padding: calc((var(--bh) - 2 * var(--bb) - 1cap) / 2) var(--bx) 0;
  line-height: 1; text-box: trim-both cap alphabetic; text-align: center; white-space: nowrap; font-variant-numeric: tabular-nums; border-radius: 999px; }
.tabs .count, .sr-toggle .count, .tf-bar .count, .menu-new, .up-new { vertical-align: middle; }
.tabs .count, .sr-toggle .count, .tf-bar .count, .tf-num { --bh: 20px; --bx: 6px; }
.nt-count { --bb: 2px; --bx: 3px; }
#butler-top .ai-tag { --bh: 14px; --bx: 3px; border-radius: 4px; letter-spacing: 0; }
th[data-tf-n]::before { --bh: 15px; --bx: 3px; }
.mtg-no, .asg-step b { --bh: 26px; --bx: 0px; }
.wh-step { --bh: 22px; --bx: 0px; }
@media (min-width: 761px) { html.side-rail .side-nav .tabs .count { --bh: 16px; --bx: 4px; padding: calc((var(--bh) - 1cap) / 2) var(--bx) 0; line-height: 1; } }
.nt-count[hidden], .tabs .count[hidden], .bottom-nav .count[hidden], .menu-new[hidden], .up-new[hidden] { display: none; }
@supports not (text-box: trim-both cap alphabetic) {
  .nt-count, .tabs .count, .bottom-nav .count, .sr-toggle .count, .tf-bar .count, .menu-new, .up-new, .tf-num, .mtg-no, .wh-step, .asg-step b, th[data-tf-n]::before, #butler-top .ai-tag, html.side-rail .side-nav .tabs .count {
    padding-top: 0; line-height: calc(var(--bh) - 2 * var(--bb)); }
}
/* 顧客の整理(外す・統合・削除)と、外した・削除した顧客の一覧 */
.cu-tidy .btn-row { flex-wrap: wrap; }
.cu-tidy p { margin: 8px 0 0; }
.merge-list { margin-top: 8px; max-height: 50vh; overflow-y: auto; }
.trash-list { list-style: none; margin: 0; padding: 0; }
.trash-list li { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; border-top: 1px solid var(--border); }
.trash-list li:first-child { border-top: 0; }
.cu-head.stuck .cu-bizgrid { display: none; }

/* 準備中の機能(app.js の soon())。見せたまま押せなくし、「準備中」の札を付ける。押すと理由をお知らせで出す */
[data-soon] { opacity: .55; cursor: not-allowed; }
[data-soon]:hover { filter: none; transform: none; }
[data-soon]::after { content: "準備中"; display: inline-block; margin-left: 6px; padding: 0 7px; border: 1px solid currentColor; border-radius: 20px; font-size: .72rem; font-weight: 700; line-height: 1.5; white-space: nowrap; vertical-align: middle; }
label.check[data-soon] input { pointer-events: none; }

/* AI ヘルプのキャラクター(ai-chars.js): 見出しの顔で切り替え。最新の答えの顔だけ少し大きくして動かす */
.butler-title .aic-sw { justify-self: start; }
.butler-title > span { margin-top: 2px; }
.b-ava.live { width: 40px; height: 40px; margin-top: 0; }
@media (max-width: 760px) { .b-ava.live { width: 34px; height: 34px; } }
.b-ava .aic, #butler-top .aic, .butler-fab .aic, .rp-insight h2 .aic, #rp-ask .aic { background: #e9eef7; }
#rp-ask .aic, .rp-insight h2 .aic { display: inline-block; }

/* カルテ項目(karte.js、部品 karte)。どの事業でも同じつくり: 見出しごとに2列の項目(複数行は全幅)、値の下に更新日・どこから・誰が */
.ka-panel .fc-head { align-items: flex-start; }
.ka-panel .neg, .ka-row .neg, .ka-at.neg { color: var(--red); }
.ka-group { margin-top: 14px; }
.ka-group h3 { margin: 0 0 6px; font-size: .8125rem; color: var(--muted); font-weight: 700; }
.ka-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 24px; }
.ka-item { position: relative; padding: 8px 28px 8px 0; border-bottom: 1px solid var(--border); min-width: 0; }
.ka-item.wide { grid-column: 1 / -1; }
.ka-item[role=button] { cursor: pointer; }
.ka-item[role=button]:hover .ka-pen, .ka-item[role=button]:focus-visible .ka-pen { opacity: 1; }
.ka-label { font-size: .75rem; color: var(--muted); }
.ka-value { white-space: pre-wrap; overflow-wrap: anywhere; margin-top: 2px; }
.ka-at { font-size: .6875rem; color: var(--muted); margin-top: 2px; }
.ka-pen { position: absolute; right: 2px; top: 10px; opacity: .45; color: var(--muted); }
.ka-pen .i { width: 16px; height: 16px; }
.ka-log { margin-top: 14px; }
.ka-log ul { list-style: none; margin: 6px 0 0; padding: 0; }
.ka-log li { padding: 6px 0; border-top: 1px solid var(--border); }
.ka-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 16px; }
.ka-form .wide, .ka-form .ka-fg { grid-column: 1 / -1; }
.ka-fg { margin: 10px 0 2px; font-size: .8125rem; color: var(--muted); }
.ka-props { display: grid; gap: 6px; margin-top: 6px; }
.ka-prop-head { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; }
.ka-prop select, .ka-prop input:not([type=checkbox]), .ka-prop textarea { margin: 4px 0 0; }
.ka-quote { margin-top: 2px; }
.ka-recs { display: grid; gap: 4px; }
.ka-row { grid-template-columns: minmax(0, 1fr) auto; }
.ka-row .sr-next { flex-direction: column; align-items: flex-end; gap: 0; white-space: nowrap; }
.bs-kf { display: grid; grid-template-columns: minmax(0, 1.4fr) 92px minmax(0, 2fr) minmax(0, .9fr) auto; gap: 6px; align-items: center; margin-bottom: 6px; }
.bs-kf input, .bs-kf select { margin: 0; }
@media (max-width: 760px) {
  .ka-grid, .ka-form { grid-template-columns: minmax(0, 1fr); }
  .bs-kf { grid-template-columns: minmax(0, 1fr) 92px; }
  .bs-kf > input[name=kc], .bs-kf > input[name=kg] { grid-column: 1 / -1; }
}

/* 残作業一覧(remain.js)。色は紺(作業)と赤(決めること)だけ */
.remain-sum { display: flex; flex-wrap: wrap; gap: var(--sp-3) var(--sp-6); padding: var(--sp-3) var(--sp-4); margin-bottom: var(--sp-3); }
.remain-sum > div { display: flex; flex-direction: column; }
.remain-sum b { font-size: 1.25rem; }
.remain-toc { display: flex; flex-wrap: wrap; gap: var(--sp-2) var(--sp-4); padding: var(--sp-3) var(--sp-4); margin-bottom: var(--sp-4); }
.remain-toc a { color: var(--primary); text-decoration: none; font-weight: 600; }
.remain-toc a span { margin-left: 6px; font-weight: 400; }
.remain-filter .chip-btn[aria-pressed="true"] { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
.remain-cat { margin-bottom: var(--sp-5); scroll-margin-top: 80px; }
.remain-cat > h2 { margin: 0 0 2px; }
.remain-cat > p { margin: 0 0 var(--sp-2); }
.remain-item { padding: var(--sp-3) var(--sp-4); margin-bottom: var(--sp-3); scroll-margin-top: 90px; transition: box-shadow .3s; }
.remain-item h3 { margin: 6px 0 4px; font-size: 1rem; }
.remain-item p { margin: 0 0 6px; }
.remain-top { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.remain-kind, .remain-all { display: inline-flex; align-items: center; padding: 0 8px; border: 1px solid currentColor; border-radius: 20px; font-size: .75rem; font-weight: 700; line-height: 1.6; color: var(--primary); }
.remain-all { color: var(--muted); }
.remain-kind.is-decide { color: var(--red); }
.remain-anchor { margin-left: auto; text-decoration: none; }
.remain-todo { margin: 4px 0 8px; padding-left: 1.3em; }
.remain-todo li { margin: 2px 0; }
.remain-meta { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 4px var(--sp-4); margin: 0; }
.remain-meta div { display: flex; gap: 8px; min-width: 0; }
.remain-meta dt { color: var(--muted); white-space: nowrap; }
.remain-meta dd { margin: 0; overflow-wrap: anywhere; }
.remain-item.remain-hit { box-shadow: inset 0 0 0 2px var(--primary); }
a.remain-link { color: var(--primary); font-weight: 600; white-space: nowrap; }
.toast a.remain-link.toast-undo { color: #fff; text-decoration: none; display: inline-block; }

/* ---------- 満足度アンケート(survey.js) ---------- */
.sv-note { background: var(--yellow-soft); color: var(--text); border-radius: var(--radius); padding: 10px 12px; margin: 0 0 16px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.sv-note .btn { margin-left: auto; }
.sv-row { cursor: pointer; }
.sv-head h1 { font-size: 1.25rem; margin: 6px 0 2px; }
.sv-kpis { margin: 12px 0 16px; }
.sv-tabs { margin-bottom: 12px; }
.sv-tabs .n { margin-left: 4px; font-size: .75rem; color: var(--muted); }
.sv-h { font-size: .875rem; margin: 14px 0 6px; }
.sv-q { border: 1px solid var(--border); border-radius: 8px; padding: 10px; margin-bottom: 8px; background: var(--surface-2); }
.sv-q-head { display: flex; gap: 6px; align-items: center; margin-bottom: 6px; }
.sv-q-head select { flex: 1; }
.sv-locked .sv-q { opacity: .75; }
.sv-qlist li { margin: 4px 0; }
.sv-chart { width: 100%; max-width: 560px; height: auto; display: block; }
.sv-grid { stroke: var(--border); stroke-width: 1; }
.sv-ax { fill: var(--muted); font-size: .6875rem; }
.sv-line path { fill: none; stroke-width: 2; stroke: var(--primary); }
.sv-line circle { fill: var(--primary); stroke: var(--surface); stroke-width: 2; }
.sv-line.ref path { stroke: var(--muted); stroke-dasharray: 5 4; }
.sv-line.ref circle { fill: var(--muted); }
.sv-key { display: inline-block; width: 18px; height: 0; border-top: 3px solid var(--primary); vertical-align: middle; margin-right: 5px; }
.sv-key.ref { border-top: 3px dashed var(--muted); }
.sv-bars { display: grid; gap: 8px; margin: 6px 0; }
.sv-bar-row { display: grid; grid-template-columns: minmax(84px, 9rem) 1fr 4.5rem; gap: 8px; align-items: center; font-size: .8125rem; }
.sv-bar-l { color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sv-bar { position: relative; height: 10px; background: var(--gray-soft); border-radius: 5px; }
.sv-bar b { position: absolute; left: 0; top: 0; bottom: 0; background: var(--primary); border-radius: 5px; }
.sv-bar i { position: absolute; top: -4px; bottom: -4px; width: 0; border-left: 2px solid var(--text); transform: translateX(-1px); }
.sv-bar-v { font-weight: 700; font-variant-numeric: tabular-nums; }
.sv-bar-v .neg, .sv-bar-v .pos, .sv-gap-v .neg, .sv-gap-v .pos, td .neg, td .pos { font-size: .75rem; margin-left: 4px; font-weight: 700; }
.sv-bar-v .neg, .sv-gap-v .neg, .report td .neg { color: var(--red); }
.sv-bar-v .pos, .sv-gap-v .pos, .report td .pos { color: var(--green); }
.sv-dists { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; margin-top: 14px; }
.sv-hist { display: flex; gap: 3px; height: 56px; align-items: flex-end; margin-top: 4px; }
.sv-hist span { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; }
.sv-hist b { width: 100%; background: var(--primary); border-radius: 3px 3px 0 0; opacity: .8; }
.sv-hist small { font-size: .625rem; color: var(--muted); }
.sv-gap { display: flex; justify-content: space-between; gap: 8px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--border); cursor: pointer; }
.sv-gap:last-of-type { border-bottom: 0; }
.sv-click { cursor: pointer; }
.sv-comment { border-bottom: 1px solid var(--border); padding: 8px 0; }
.sv-comment p { margin: 0 0 4px; white-space: pre-wrap; }
.sv-px-q { border: 0; padding: 0; margin: 0 0 12px; }
.sv-px-q legend { font-weight: 700; font-size: .875rem; margin-bottom: 4px; padding: 0; }
.sv-px-opts { display: flex; flex-wrap: wrap; gap: 4px; }
.sv-px-opts label { display: flex; flex-direction: column; align-items: center; min-width: 38px; padding: 6px 4px; border: 1px solid var(--border); border-radius: 8px; font-weight: 600; margin: 0; cursor: pointer; }
.sv-px-opts label:has(input:checked) { background: var(--primary); color: var(--on-primary); border-color: var(--primary); }
.sv-px-opts input { margin: 0; }
.sv-px-opts small { font-size: .625rem; font-weight: 400; }
.sv-k-top { display: flex; flex-wrap: wrap; gap: 8px 24px; margin-bottom: 10px; }
.sv-k-top > div { display: flex; flex-direction: column; gap: 2px; }
.sv-k-top .lbl { font-size: .75rem; color: var(--muted); }
.sv-k-top b { font-size: 1.25rem; }
.sv-k-texts p { margin: 0 0 6px; white-space: pre-wrap; }
.sv-k-pend { margin-top: 8px; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
@media (max-width: 760px) { .sv-note .btn { margin-left: 0; } }
.sv-backrow { margin-bottom: 4px; }
.sv-sum .panel { align-self: stretch; min-width: 0; }
.sv-key.tick { width: 0; height: 14px; border-top: 0; border-left: 2px solid var(--text); margin: 0 8px 0 4px; }
.sv-k-top b .badge { font-size: .75rem; vertical-align: middle; }
@media (max-width: 760px) { .sv-bar-row { grid-template-columns: 34% minmax(0, 1fr) 3.4rem; } }
.sv-note { flex-wrap: nowrap; } .sv-note-t { flex: 1; min-width: 0; } .sv-note > .btn { flex: none; }
@media (max-width: 760px) { .sv-note { flex-wrap: wrap; } }
.sv-look-phone { display: flex; justify-content: center; margin: 12px 0; }
.sv-look-phone iframe { width: 390px; max-width: 100%; height: 640px; border: 8px solid var(--text); border-radius: 28px; background: #f4f6fa; }
.sv-look-msg { border: 1px solid var(--border); border-radius: 8px; padding: 12px; margin: 12px 0; background: var(--surface); }
.sv-look-msg pre { white-space: pre-wrap; font-family: inherit; margin: 0; font-size: .875rem; }
.sv-look-msg hr { border: 0; border-top: 1px solid var(--border); margin: 8px 0; }
.sv-look-sms { display: flex; margin: 12px 0; }
.sv-look-sms p { background: var(--gray-soft); border-radius: 16px 16px 16px 4px; padding: 10px 14px; max-width: 320px; margin: 0; font-size: .875rem; white-space: pre-wrap; }
/* 満足度アンケート: 出す条件・改善の優先順位・ご意見のテーマ・対応 */
.sv-when { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin-top: 6px; }
.sv-when select, .sv-when input { width: auto; flex: 0 1 auto; min-width: 0; }
.sv-when input[type=number] { width: 4.5rem; }
.sv-quad { max-width: 620px; margin: 6px 0 8px; }
.sv-q-fix { fill: var(--red); opacity: .07; }
.sv-q-lbl { fill: var(--red); font-weight: 700; }
.sv-pt circle { fill: var(--muted); stroke: var(--surface); stroke-width: 2; }
.sv-pt.fix circle { fill: var(--red); }
.sv-pt.keep circle { fill: var(--green); }
.sv-pt.ok circle { fill: var(--primary); }
.sv-pt-l { fill: var(--text); font-size: .75rem; }
.sv-drv-say { background: var(--red-soft, var(--yellow-soft)); border-radius: 8px; padding: 8px 10px; margin: 0 0 6px; font-size: .875rem; }
.sv-drv-list { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: .8125rem; margin-bottom: 6px; }
.sv-theme { width: 100%; background: none; border: 0; padding: 4px 6px; border-radius: 6px; cursor: pointer; text-align: left; color: inherit; font: inherit; font-size: .8125rem; }
.sv-theme:hover, .sv-theme.active { background: var(--gray-soft); }
.sv-bar em { position: absolute; left: 0; top: 0; bottom: 0; background: var(--red); border-radius: 5px; }
.sv-key.negk { border-top-color: var(--red); }
.sv-tabs .n.late { color: var(--red); font-weight: 700; }
.report tr.sv-done td { opacity: .7; }
.report tr.sv-late td:first-child { box-shadow: inset 3px 0 0 var(--red); }
.sv-look-mail { width: 100%; height: 26rem; border: 0; background: #fff; border-radius: 6px; }
.sv-tabs .active .n { color: inherit; }
.pt-dec .due .pt-edits { font-size: .75rem; font-weight: 600; opacity: .8; white-space: nowrap; }
.mtg-main > .mtg-nav + .plan-sec { margin-top: var(--sp-4, 16px); }
/* 決めたこと: 担当の絞り込み(「決定事項を残す」の横の複数選択プルダウン。ボタンの高さは .btn.small の規格) */
.pt-dec-tools { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.pt-who-dd { position: relative; }
.pt-who-dd > summary { list-style: none; display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
.pt-who-dd > summary::-webkit-details-marker { display: none; }
.pt-who-dd > summary.on { border-color: var(--primary); background: var(--primary-soft); color: var(--primary); }
.pt-who-dd > summary .caret { font-size: .75rem; opacity: .7; }
.pt-who-pop { position: absolute; right: 0; top: calc(100% + 4px); z-index: 30; width: max-content; min-width: 220px; max-width: min(320px, 86vw);
  background: var(--surface); border: 1px solid var(--border); border-radius: 10px; box-shadow: var(--shadow); padding: 8px; }
.pt-who-bulk { display: flex; gap: 6px; padding-bottom: 6px; margin-bottom: 4px; border-bottom: 1px solid var(--border); }
.pt-who-bulk .btn { flex: 1; }
.pt-who-list { max-height: min(320px, 50vh); overflow-y: auto; }
.pt-who-row { display: flex; flex-direction: row; align-items: center; gap: 8px; margin: 0; padding: 6px 6px; border-radius: 6px; color: var(--text); font-size: .875rem; font-weight: 600; cursor: pointer; }
.pt-who-row:hover { background: var(--gray-soft); }
.pt-who-row input { margin: 0; padding: 0; width: 16px; height: 16px; min-height: 0; flex: none; accent-color: var(--primary); }
.pt-who-row .nm { flex: 1; }
.pt-who-row .n { min-width: 22px; padding: 0 6px; border-radius: 999px; background: var(--gray-soft); font-size: .75rem; text-align: center; }
.pt-who-sum { margin: 0 0 6px; }
/* 右の列(1600px 以上)は欄が横スクロールの箱なので、プルダウンは左に寄せて右へ開く(左の議題の下に隠れないように) */
@media (min-width: 1600px) {
  .mtg-aside .pt-dec-tools { justify-content: flex-start; }
  .mtg-aside .pt-who-pop { left: 0; right: auto; }
}
@media (max-width: 760px) {  /* スマホは見出しの下に折り返すので、同じく左に寄せて右へ開く(画面の左にはみ出さない) */
  .pt-dec-tools { justify-content: flex-start; }
  .pt-who-pop { left: 0; right: auto; }
}

/* ===== ボタンの大きさの規格(2026-11-03 Hiro「ボタンの大きさがバラバラ最高にダサい。全画面から撲滅して」) =====
   ・高さは3種類だけ: ふつう 40px / 小 32px / 大 48px(スマホは押しやすく ふつう 44px / 小 38px)。
   ・字の大きさもボタンの種類で決める(置いた場所の字の大きさを引きつがない)。行の高さを固定して、字体や設定で高さがずれないように。
   ・字は折り返さない。同じ並びのボタンは同じ高さ(並びの高さに引きのばさない)。
   ・新しいボタンは .btn / .btn.small / .btn.big のどれかを使い、ここ以外で高さ(min-height・height・上下の padding)を変えない。
   tests/button_size.js が全画面(AM・MC、PC 1440/1920px・スマホ 390px)で測る。 */
:root { --btn-h: 40px; --btn-h-sm: 32px; --btn-h-lg: 48px; }
@media (max-width: 760px) { :root { --btn-h: 44px; --btn-h-sm: 38px; } }
.btn { min-height: var(--btn-h); padding-top: 4px; padding-bottom: 4px; font-size: .9375rem; line-height: 1.25; white-space: nowrap; }
.btn.small { min-height: var(--btn-h-sm); padding: 2px 10px; font-size: .8125rem; }
.btn.big { min-height: var(--btn-h-lg); }
a.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; text-decoration: none; }
/* 並びの中のボタンは、並びが高くなっても引きのばさない(カードの高さに引っぱられて、カードごとに高さが違っていた) */
.btn-row, .sr-next, .todo-buttons, .act-btns, .ai-entry, .story-actions, .tips-row, .rp-actions, .ai-insert { align-items: center; }
/* パイプラインの細い列でも「さらに○件を表示」が1行に入るように、左右の余白だけ詰める(高さは規格のまま) */
.btn.small.more-btn { padding-left: 6px; padding-right: 6px; }

/* ===== 洗練した見た目(2026-11-03 Hiro「全体的に見た目がごちゃごちゃしてる。最新のデザインガイドを参考に世界トップレベルの cool な見た目に。社員のやる気に関わる」) =====
   参考: Material 3(色の役割・面の段階)、Apple HIG(文字の階層・余白)、Linear / Vercel / Stripe の業務画面(線を減らし、面と余白で区切る)。決まりごと:
   1. 面は3段だけ: 背景(--bg) < カード(--surface) < 押せる面のホバー(--surface-2)。カードは髪の毛ほどの線 + ごく薄い影。カードの中にカードの枠を重ねない(行は細い区切り線)
   2. 文字の階層は4段: 画面・カードの見出し(600) / 本文(400) / 補足(--muted) / 目立たせない補足(--faint)。太字(700 以上)は大きな数字だけ
   3. 色は紺(操作・選択)と赤(要対応)だけ。状態の札は色の面や枠にせず「点 + 字」。緑の「済み」「完了」も紺の淡い面に
   4. 日本語はつめ組み(palt)で字間を整える。数字は桁をそろえる(tabular-nums)
   5. 改行はさせない所を決める: 名前・会社名・札・期日・増減(あと○万円)は途中で折り返さない。カードの中の補足は、ボタンと横に並べず全幅の1行に
   ボタンの高さ・字の大きさは上の「ボタンの大きさの規格」のまま(ここでは変えない)。暗い表示は下の @media で同じ役割の色を決める */
:root {
  --bg: #f6f7f9; --surface: #ffffff; --surface-2: #f2f4f7; --border: #e3e6eb; --line: #edeff2;
  --text: #101828; --muted: #4b5565; --faint: #5f6b7a;
  --primary-soft: #eef2f9; --gray-soft: #f2f4f7;
  --ring: 0 0 0 1px var(--border); --elev-1: 0 1px 2px rgba(16, 24, 40, .04);
  --radius: 12px;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #0c0f14; --surface: #141921; --surface-2: #1b212b; --border: #262e3a; --line: #1e2530;
    --text: #e8ebf0; --muted: #a6afbd; --faint: #9aa4b2; --primary-soft: #18233a; --gray-soft: #1b212b;
    --elev-1: 0 1px 2px rgba(0, 0, 0, .3); }
}
body { font-feature-settings: "palt" 1; letter-spacing: .02em; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; text-rendering: optimizeLegibility;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI Variable Text", "Segoe UI", "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP", "Yu Gothic UI", Meiryo, sans-serif; }
input, textarea, select, code, pre, kbd { font-feature-settings: normal; letter-spacing: normal; }
h1, h2, h3, h4 { letter-spacing: .01em; }
.num, .kpi .num, .tile .num, .mtg-big, .rev-big, td.num { font-variant-numeric: tabular-nums; letter-spacing: 0; }

/* 1. 面: カード・パネルは髪の毛の線 + ごく薄い影(角丸12) */
.panel, .kpi, .todo, .card, .summary-strip .tile, .pdca { box-shadow: var(--ring), var(--elev-1); border: 0; }
.pdca { border: 0; }
.empty { box-shadow: none; border: 1px dashed var(--border); background: transparent; color: var(--faint); }
/* パネルの中のカード(アクション・決めたこと・商談など)は枠を重ねず、細い区切り線の行に */
.panel .todo-list, .mtg-sec .todo-list { gap: 0; }
.panel .todo { box-shadow: none; background: transparent; border-radius: 0; padding-left: 2px; padding-right: 2px; border-top: 1px solid var(--line); }
.panel .todo:first-child { border-top: 0; }
.panel .todo:hover { background: transparent; }

/* 2. 文字の階層 */
.panel h2, .todo-section h2, .page-head h1, .cu-name, .modal-head { font-weight: 600; }
.panel h2 { font-size: 1rem; letter-spacing: .01em; }
.panel h2 .i, .todo-section h2 .i, .fc-head h2 .i { color: var(--faint); }
.todo .action { font-weight: 600; }
.kpi .num, .tile .num, .pdca-v.num, .mtg-big { font-weight: 700; letter-spacing: -.01em; }
.kpi .lbl, .tile .lbl { color: var(--muted); font-weight: 500; }
th { font-size: .75rem; font-weight: 600; color: var(--faint); letter-spacing: .04em; }
.page-head > div:first-child > p.muted, .page-head:has(> .filters) > div:first-child > p { color: var(--faint); }

/* 3. 札: 状態は「点 + 字」。要対応(赤)・期限が近い(橙)だけ淡い面 */
.badge { font-weight: 600; border-radius: 6px; letter-spacing: .02em; }
.badge.b-green, .badge.b-gray, .badge.b-blue, .badge.b-purple { background: none; box-shadow: none; padding-left: 0; padding-right: 0; color: var(--muted); font-weight: 500; }
.badge.b-green::before, .badge.b-blue::before, .badge.b-purple::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex: none; }
.badge.b-green::before { background: #12a150; }
.badge.b-blue::before { background: var(--primary); }
.badge.b-purple::before { background: var(--purple); }
.badge.due::before, .due.b-green::before { content: none; }
.badge.due { box-shadow: none; }
.badge.due.b-gray { background: var(--gray-soft); color: var(--muted); padding: 2px 8px; }
.b-orange, .b-yellow { box-shadow: none; }
.badge.b-orange:not(.due), .badge.b-yellow:not(.due) { background: var(--orange-soft); }
.svc.auc, .svc.iauc { border-color: var(--line); color: var(--faint); font-weight: 600; }

/* ボタン: 枠は髪の毛の線。「済み」「完了」は緑をやめて紺の淡い面 */
.btn { border-color: var(--border); font-weight: 600; letter-spacing: .02em; transition: background-color .12s, border-color .12s, color .12s, box-shadow .12s; }
.btn:hover { background: var(--surface-2); border-color: color-mix(in srgb, var(--text) 18%, var(--border)); }
.btn.primary { box-shadow: 0 1px 0 rgba(255, 255, 255, .12) inset, var(--elev-1); }
.btn.primary:hover { background: var(--primary); border-color: var(--primary); filter: brightness(1.12); }
.btn.success { background: var(--primary-soft); border-color: transparent; color: var(--primary); }
.btn.success:hover { background: color-mix(in srgb, var(--primary) 14%, var(--surface)); border-color: transparent; }

/* 入力欄: 線は細く、選ぶと紺の輪 */
input, select, textarea { border-color: var(--border); border-radius: 8px; transition: border-color .12s, box-shadow .12s; }
input:hover, select:hover, textarea:hover { border-color: color-mix(in srgb, var(--text) 22%, var(--border)); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 18%, transparent); }

/* 表: 縦線なし・行の区切りは細く・行にマウスを置くと淡く */
th, td { border-bottom-color: var(--line); }
thead th { border-bottom: 1px solid var(--border); }
tbody tr:hover > td { background: color-mix(in srgb, var(--surface-2) 70%, transparent); }

/* 上部バーとサイドバー: 線は1本、選んでいる画面は面 + 字の色だけ */
.topbar { border-bottom-color: var(--border); }
@media (min-width: 761px) {
  .side-nav { background: var(--bg); border-right-color: var(--line); }
  .topbar > .brand { background: var(--bg); border-right-color: var(--line); }
  .side-nav .tabs button { font-weight: 500; color: var(--muted); border-radius: 8px; }
  .side-nav .tabs button .ico .i { color: var(--faint); }
  .side-nav .tabs button:hover { background: color-mix(in srgb, var(--text) 5%, transparent); }
  .side-nav .tabs button.active { background: var(--surface); color: var(--text); font-weight: 600; box-shadow: var(--ring), var(--elev-1); }
  .side-nav .tabs button.active .ico .i { color: var(--primary); }
  .side-nav .tabs button.active::before { content: none; }
}

/* 4. 折り返さない所: 名前・会社名と札・期日・増減は1かたまりに */
.up, .down, .biz-shared, .cu-date, .pt-edits, .rev-gap b, .badge { white-space: nowrap; }
.todo .meta > .who { white-space: nowrap; }
/* パソコン: 札と会社名は1かたまり(スマホの細い所では会社名を語の区切りで折り返してよい。横にはみ出さないように) */
@media (min-width: 761px) { .todo .meta > span:has(> .biz-shared), .sr-row .meta > span:has(> .biz-shared) { white-space: nowrap; } }
/* 事業の色の字は、淡い面の上でも読める濃さに(明るい表示。暗い表示は上の決まりのまま) */
@media not (prefers-color-scheme: dark) {
  .biz-badge, .biz-seg button, .jt-kid, .jt-pick, .biz-pick, .pt-karte, .pt-landing, .pt-land, .pt-spark, .bs-item, .cu-bizrow, .cu-biz { --bz-ink: color-mix(in srgb, var(--bz) 80%, #000); }
}
/* 暗い表示の通知の件数: 明るい赤の丸には濃い字 */
@media (prefers-color-scheme: dark) { .notif-btn .nt-count { color: #1f0805; } }

/* 週次MTGの「決めたこと」(右の列): 期日の札と「編集」「済み」を1行目に、本文、担当・会社・会議を全幅の1行に
   (Hiro 2026-11-03「名前の横で1行に収まるよね。無駄な改行はすべて撲滅して」: ボタンの横の細い所に担当と会社を入れて2行に割れていた) */
@media (min-width: 1600px) {
  .mtg-aside .todo.pt-dec { grid-template-columns: minmax(0, 1fr) auto; row-gap: 6px; padding: 12px 2px; }
  .mtg-aside .pt-dec > .due { grid-column: 1; grid-row: 1; align-self: center; }
  .mtg-aside .pt-dec > .todo-buttons { grid-column: 2; grid-row: 1; align-self: center; }
  .mtg-aside .pt-dec .action { grid-column: 1 / -1; grid-row: 2; }
  .mtg-aside .pt-dec .meta { grid-column: 1 / -1; grid-row: 3; align-self: start; gap: 4px 14px; }
}

/* 顧客カルテの見出し(パソコン): 会社名とボタンを1行目に、状態・担当・日付は下の全幅に(ボタンの横の細い所で日付が折り返していた) */
@media (min-width: 1100px) {
  .cu-head:not(.stuck) { grid-template-columns: minmax(0, 1fr) auto; }
  .cu-head:not(.stuck) > .cu-title { display: contents; }
  .cu-head:not(.stuck) > .cu-title > .cu-name { grid-column: 1; grid-row: 1; align-self: center; }
  .cu-head:not(.stuck) > .btn-row { grid-column: 2; grid-row: 1; align-self: center; }
  .cu-head:not(.stuck) > .cu-title > .meta { grid-column: 1 / -1; grid-row: 2; }
  .cu-head .meta .cu-bizgrid.solo { flex-basis: auto; display: inline-grid; margin: 0 6px 0 0; }
}

/* パイプラインのカード(Hiro 2026-11-03「無駄な改行はすべて撲滅」): 1440px 幅では列が細く、会社名が「AUC 有限会社 / フォレスト / 自動車」と3行に割れていた。
   サービスの札(AUC / i-Auc)は会社名の前から後ろへ移し(名前の書き出しが列の左端にそろう)、法人の種類は (株)・(有) と略し(app.js shortCo)、会社名は列の幅いっぱいに。字は語の途中で切らない */
.card { overflow-wrap: normal; }
.card .title { font-weight: 600; font-size: .9375rem; line-height: 1.4; overflow-wrap: anywhere; word-break: keep-all; }
.card .row > b { white-space: nowrap; }
.card .row .owner { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; margin-left: auto; }
.card .title .svc { margin: 0 0 0 4px; vertical-align: 2px; font-size: .6875rem; }
.card .next .what { overflow-wrap: anywhere; }
@media (min-width: 761px) and (max-width: 1600px) { .board .card { padding: 8px 9px; } }
