:root {
  --bg: #eef1f5;
  --panel: #ffffff;
  --border: #d5dbe3;
  --border-light: #e6eaf0;
  --text: #1f2933;
  --muted: #5f6b7a;
  --faint: #8a95a5;
  --primary: #1f4e9a;
  --primary-hover: #183f7d;
  --primary-light: #e8effa;
  --danger: #b42318;
  --danger-light: #fdecea;
  --success: #0f7b45;
  --success-light: #e5f4ec;
  --warn: #9a5b00;
  --warn-light: #fff4e0;
  --side: #1d2a3d;
  --side-text: #c9d3e0;
  --side-active: #2b3d57;
  --th: #f4f6f9;
  --radius: 3px;
  --font: "Segoe UI", "Yu Gothic UI", "Meiryo", "Hiragino Sans", "Hiragino Kaku Gothic ProN", sans-serif;
}
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
/* overflow-wrap: 枠に収まらない長い英数字（URL など）だけをその場で折り返す（2026-10-20: スマホで枠からはみ出していた） */
body { font-family: var(--font); font-size: 13px; color: var(--text); background: var(--bg); line-height: 1.5; overflow-wrap: break-word; }
.break-all { word-break: break-all; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
.hidden { display: none !important; }
button, input, select, textarea { font: inherit; color: inherit; }
input[type=text], input[type=search], input[type=password], input[type=number], input[type=date], input[type=datetime-local], input[type=email], input[type=url], select, textarea {
  border: 1px solid var(--border); border-radius: var(--radius); padding: 5px 8px; background: #fff; min-height: 30px; width: 100%;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 2px rgba(31,78,154,.15); }
textarea { min-height: 80px; resize: vertical; }
label { display: block; font-size: 12px; color: var(--muted); margin-bottom: 8px; }
label > input, label > select, label > textarea { margin-top: 3px; }
label.inline { display: inline-flex; align-items: center; gap: 6px; margin: 0 12px 0 0; color: var(--text); font-size: 13px; }
label.inline input { width: auto; min-height: 0; margin: 0; }
h1 { font-size: 18px; font-weight: 600; margin: 0; }
h2 { font-size: 14px; font-weight: 600; margin: 0 0 10px; }
h3 { font-size: 13px; font-weight: 600; margin: 0 0 8px; color: var(--muted); }

/* ---------- ログイン ---------- */
.login { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: var(--side); }
.login-box { background: #fff; width: 360px; padding: 32px 36px 24px; border-radius: 4px; box-shadow: 0 8px 30px rgba(0,0,0,.35); }
.login-brand { text-align: center; margin-bottom: 24px; }
.wordmark { font-weight: 700; letter-spacing: .12em; font-size: 20px; color: var(--primary); }
.login-sub { display: block; font-size: 12px; color: var(--muted); margin-top: 2px; }
.login-foot { text-align: center; color: var(--faint); font-size: 11px; margin-top: 18px; }
.form-error { color: var(--danger); background: var(--danger-light); padding: 6px 10px; border-radius: var(--radius); margin-bottom: 10px; font-size: 12px; }

/* ---------- レイアウト ---------- */
/* 100dvh: iPhone の Safari ではアドレスバーの分だけ 100vh が実際の画面より高く、ページ全体が上下に動いてしまうため（2026-10-20） */
.app { display: flex; flex-direction: column; height: 100vh; height: 100dvh; }
.nav-backdrop { display: none; }
.topbar { height: 46px; background: #fff; border-bottom: 1px solid var(--border); display: flex; align-items: center; padding: 0 16px; gap: 24px; flex-shrink: 0; }
.brand { display: flex; align-items: baseline; gap: 10px; color: inherit; }
.brand:hover { text-decoration: none; }
.brand .wordmark { font-size: 16px; }
.brand-sub { font-size: 12px; color: var(--muted); }
.gsearch { display: flex; gap: 6px; flex: 0 1 420px; }
.gsearch input { min-height: 28px; }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 18px; font-size: 12px; color: var(--muted); }
.usermenu { display: flex; gap: 12px; align-items: center; position: relative; }
.user-name { color: var(--text); font-weight: 600; }
/* ヘッダーのメニュー（2026-10-19）: 広い画面ではこれまでどおり横に並べ、幅 900px 以下で頭文字の丸ボタンのメニューにまとめる */
.usermenu-links { display: flex; gap: 12px; align-items: center; }
.usermenu-who, .usermenu-btn, .search-toggle { display: none; }
.usermenu-btn { align-items: center; gap: 3px; background: none; border: 0; padding: 2px; cursor: pointer; }
.avatar { width: 30px; height: 30px; border-radius: 50%; background: var(--primary); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-size: 14px; font-weight: 600; }
body.platform .avatar { background: #b8860b; }
.caret { font-size: 11px; color: var(--muted); }
.topbar-btn { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 2px 8px; font-size: 12px; color: var(--muted); cursor: pointer; }
.body { display: flex; flex: 1; min-height: 0; }
.sidenav { width: 200px; background: var(--side); color: var(--side-text); padding: 10px 0; overflow-y: auto; flex-shrink: 0; }
.nav-group { padding: 6px 0; }
.nav-group + .nav-group { border-top: 1px solid rgba(255,255,255,.06); }
/* 分類の見出し（押すと折りたたむ） */
.nav-title { display: flex; align-items: center; gap: 6px; width: 100%; background: none; border: 0; margin: 0; font: inherit; font-size: 11px; font-weight: 600; color: #9aabc2; padding: 7px 14px 4px 16px; letter-spacing: .06em; text-align: left; cursor: pointer; }
.nav-title::after { content: ""; margin-left: auto; width: 6px; height: 6px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(45deg) translate(-2px, -2px); opacity: .7; transition: transform .15s; }
.nav-title:hover { color: #fff; }
.nav-title:focus-visible { outline: 2px solid #6ea1ee; outline-offset: -2px; }
.nav-group.collapsed .nav-title::after { transform: rotate(-45deg); }
.nav-group.collapsed > a { display: none; }
.nav-group.collapsed { padding-bottom: 2px; }
.sidenav a { display: block; color: var(--side-text); padding: 7px 16px 7px 20px; font-size: 13px; }
.sidenav a:hover { background: rgba(255,255,255,.05); text-decoration: none; color: #fff; }
.sidenav a.active { background: var(--side-active); color: #fff; border-left: 3px solid #6ea1ee; padding-left: 17px; }
.main { flex: 1; overflow-y: auto; padding: 18px 22px 40px; min-width: 0; }

/* ---------- 共通部品 ---------- */
.page-head { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; flex-wrap: wrap; }
.page-head .spacer { flex: 1; }
.crumbs { font-size: 12px; color: var(--muted); margin-bottom: 6px; }
.crumbs a { color: var(--muted); }
.panel { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; margin-bottom: 14px; }
.panel.tight { padding: 0; }
.panel-head { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-bottom: 1px solid var(--border-light); }
.panel-head h2 { margin: 0; }
.panel-head .spacer { flex: 1; }
.grid { display: grid; gap: 14px; }
.grid.c2 { grid-template-columns: 1fr 1fr; }
.grid.c3 { grid-template-columns: repeat(3, 1fr); }
.grid.c4 { grid-template-columns: repeat(4, 1fr); }
.grid.side { grid-template-columns: 1fr 340px; }
.grid.side-l { grid-template-columns: 380px 1fr; }
@media (max-width: 1100px) { .grid.c3, .grid.c4, .grid.side, .grid.side-l { grid-template-columns: 1fr 1fr; } }
.nav-toggle { display: none; }
@media (max-width: 900px) {
  /* 以前はここで「ヘルプ・アカウント・ログアウト」を消していたため、狭い画面ではログアウトできなかった（2026-10-19 修正） */
  .brand-sub, .clock, .user-name { display: none; }
  .topbar { gap: 10px; padding: 0 10px; }
  .brand { flex-shrink: 0; }
  .gsearch { flex: 1; min-width: 0; }
  .gsearch input { min-width: 0; width: 100%; }
  .topbar-right { gap: 8px; flex-shrink: 0; }
  .usermenu-btn { display: inline-flex; }
  .usermenu-links { display: none; position: absolute; right: 0; top: calc(100% + 8px); flex-direction: column; align-items: stretch; gap: 0; min-width: 220px; max-width: calc(100vw - 16px); padding: 6px 0; background: #fff; border: 1px solid var(--border); border-radius: var(--radius); box-shadow: 0 8px 24px rgba(0,0,0,.15); z-index: 60; font-size: 14px; }
  .usermenu.open .usermenu-links { display: flex; }
  .usermenu-who { display: block; padding: 8px 14px 10px; margin-bottom: 4px; border-bottom: 1px solid var(--border-light); color: var(--text); font-weight: 600; word-break: break-all; }
  .usermenu-links .link { display: block; padding: 10px 14px; color: var(--text); }
  .usermenu-links .link:hover { background: var(--primary-light); text-decoration: none; }
  .main { padding: 12px 12px 40px; }
}
@media (max-width: 800px) {
  .grid.c2, .grid.c3, .grid.c4, .grid.side, .grid.side-l { grid-template-columns: 1fr !important; }
  .nav-toggle { display: inline-block; }
  .sidenav { display: none; position: fixed; top: 46px; left: 0; bottom: 0; z-index: 40; box-shadow: 4px 0 16px rgba(0,0,0,.3); }
  body.nav-open .sidenav { display: block; }
  .board { grid-template-columns: repeat(7, 200px); }
}
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row.end { justify-content: flex-end; }
.stack > * + * { margin-top: 10px; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.small { font-size: 12px; }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.nowrap { white-space: nowrap; }
.mt { margin-top: 12px; }
.mb { margin-bottom: 12px; }
.empty { color: var(--faint); padding: 24px; text-align: center; }

.btn { border: 1px solid var(--border); background: #fff; border-radius: var(--radius); padding: 5px 12px; min-height: 30px; cursor: pointer; white-space: nowrap; color: var(--text); }
.btn:hover { background: #f5f7fa; }
.btn:disabled { opacity: .5; cursor: default; }
.btn.primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn.primary:hover { background: var(--primary-hover); }
.btn.danger { color: var(--danger); border-color: #e4a39d; }
.btn.danger:hover { background: var(--danger-light); }
.btn.sm { padding: 2px 8px; min-height: 24px; font-size: 12px; }
.btn.lg { padding: 8px 18px; font-size: 14px; }
.btn.block { width: 100%; }
.btn-group { display: inline-flex; gap: 6px; flex-wrap: wrap; }

.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 14px; }
.kpi { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 14px; }
.kpi .k-label { font-size: 12px; color: var(--muted); }
.kpi .k-value { font-size: 22px; font-weight: 600; margin-top: 2px; font-variant-numeric: tabular-nums; }
.kpi .k-sub { font-size: 11px; color: var(--faint); margin-top: 2px; }

table.tbl { width: 100%; border-collapse: collapse; background: #fff; font-size: 12.5px; }
.tbl th, .tbl td { padding: 6px 10px; border-bottom: 1px solid var(--border-light); text-align: left; vertical-align: middle; }
.tbl th { background: var(--th); font-weight: 600; color: var(--muted); font-size: 12px; white-space: nowrap; position: sticky; top: 0; }
.tbl tr:hover td { background: #f8fafc; }
.tbl tr.clickable { cursor: pointer; }
.tbl td.num, .tbl th.num { text-align: right; }
.tbl .sub { color: var(--faint); font-size: 11px; }
.tbl-wrap { overflow: auto; max-height: 70vh; }
.tbl.compact th, .tbl.compact td { padding: 4px 8px; }
.pager { display: flex; align-items: center; gap: 10px; padding: 8px 12px; font-size: 12px; color: var(--muted); border-top: 1px solid var(--border-light); }
.pager .spacer { flex: 1; }

.pill { display: inline-block; max-width: 100%; padding: 1px 8px; border-radius: 10px; font-size: 11px; background: #eef1f5; color: var(--muted); white-space: nowrap; border: 1px solid transparent; }
/* 文章を入れるピル（取り込みエラーの説明など）は折り返す（2026-10-20: スマホで画面からはみ出していた） */
.pill.msg { white-space: normal; border-radius: 8px; text-align: left; }
.pill.blue { background: var(--primary-light); color: var(--primary); }
.pill.green { background: var(--success-light); color: var(--success); }
.pill.red { background: var(--danger-light); color: var(--danger); }
.pill.amber { background: var(--warn-light); color: var(--warn); }
.pill.gray { background: #eef1f5; color: var(--muted); }
.pill.dark { background: #dfe4ea; color: #3b4654; }

.filters { display: flex; gap: 8px; align-items: flex-end; flex-wrap: wrap; margin-bottom: 10px; }
.filters label { margin: 0; min-width: 120px; }
.filters .grow { flex: 1; min-width: 200px; }
.filters .btn { margin-bottom: 0; }

/* タブ（2026-10-19）: 項目が多いと 1 行に押し込まれて文字が縦に 1 文字ずつ並び、画面からはみ出していたため、
   文字は折り返さず、収まらない分は次の行に送る。スマホではチップ型にする（下の幅 800px 以下の指定） */
.tabs { display: flex; flex-wrap: wrap; border-bottom: 1px solid var(--border); margin-bottom: 12px; gap: 2px; }
.tabs a { padding: 7px 14px; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs a:hover { text-decoration: none; color: var(--text); }
.tabs a.active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 600; }

dl.props { display: grid; grid-template-columns: max-content 1fr; gap: 4px 14px; margin: 0; font-size: 12.5px; }
dl.props dt { color: var(--muted); white-space: nowrap; }
dl.props dd { margin: 0; word-break: break-all; }

.bars { display: grid; grid-template-columns: max-content 1fr max-content; gap: 3px 10px; align-items: center; font-size: 12px; }
.bars .bar { height: 12px; background: #e2e8f0; border-radius: 2px; overflow: hidden; }
.bars .bar > i { display: block; height: 100%; background: #4f7ccf; }
.bars .n { text-align: right; font-variant-numeric: tabular-nums; color: var(--muted); }

.chart { display: flex; align-items: flex-end; gap: 4px; height: 120px; padding: 8px 4px 0; border-bottom: 1px solid var(--border); }
.chart .col { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 1px; height: 100%; position: relative; }
.chart .col i { display: block; width: 100%; background: #b9c9e6; }
.chart .col i.hi { background: #1f4e9a; }
.chart .col span { position: absolute; bottom: -18px; font-size: 10px; color: var(--faint); white-space: nowrap; }
.chart-labels { height: 18px; }

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 16px; }
.form-grid .full { grid-column: 1 / -1; }
.form-grid.c3 { grid-template-columns: repeat(3, 1fr); }
.checks { display: flex; flex-wrap: wrap; gap: 4px 10px; max-height: 150px; overflow: auto; border: 1px solid var(--border); padding: 6px 8px; border-radius: var(--radius); background: #fff; }
.checks label { margin: 0; font-size: 12px; color: var(--text); display: inline-flex; align-items: center; gap: 4px; }
.checks input { width: auto; min-height: 0; margin: 0; }

.estimate { text-align: center; padding: 14px; }
.estimate .big { font-size: 34px; font-weight: 600; font-variant-numeric: tabular-nums; }
.estimate .big small { font-size: 14px; font-weight: normal; color: var(--muted); margin-left: 4px; }

.modal-backdrop { position: fixed; inset: 0; background: rgba(15,23,42,.45); display: flex; align-items: flex-start; justify-content: center; padding: 50px 16px; z-index: 50; overflow: auto; }
.modal { background: #fff; border-radius: 4px; width: 640px; max-width: 100%; box-shadow: 0 10px 40px rgba(0,0,0,.3); }
.modal.wide { width: 900px; }
.modal.narrow { width: 440px; }
.modal-head { padding: 12px 18px; border-bottom: 1px solid var(--border); display: flex; align-items: center; }
.modal-head h2 { margin: 0; flex: 1; }
.modal-close { background: none; border: none; font-size: 18px; cursor: pointer; color: var(--muted); }
.modal-body { padding: 16px 18px; max-height: 70vh; overflow: auto; }
.modal-foot { padding: 10px 18px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 8px; background: #fafbfc; }

#toast-root { position: fixed; right: 16px; bottom: 16px; z-index: 60; display: flex; flex-direction: column; gap: 6px; }
.toast { background: #1f2933; color: #fff; padding: 8px 14px; border-radius: var(--radius); font-size: 12.5px; box-shadow: 0 4px 12px rgba(0,0,0,.25); }
.toast.error { background: var(--danger); }
.toast.success { background: var(--success); }

/* 架電画面 */
.call-layout { display: grid; grid-template-columns: 1fr 380px; gap: 14px; }
@media (max-width: 1000px) { .call-layout { grid-template-columns: 1fr; } }
.call-company h1 { font-size: 20px; }
.call-tel { font-size: 22px; font-weight: 600; font-variant-numeric: tabular-nums; letter-spacing: .02em; }
.result-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px; }
.result-grid .btn { text-align: left; justify-content: flex-start; }
.result-grid .btn.sel { background: var(--primary-light); border-color: var(--primary); color: var(--primary); font-weight: 600; }
.result-grid .btn.ap { border-color: #7fb89a; }
.script-box { white-space: pre-wrap; font-size: 12.5px; line-height: 1.7; max-height: 420px; overflow: auto; background: #fbfcfd; border: 1px solid var(--border-light); padding: 10px 12px; border-radius: var(--radius); }
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { padding: 7px 0; border-bottom: 1px solid var(--border-light); font-size: 12.5px; }
.timeline li .meta { color: var(--faint); font-size: 11px; }

/* 商談ボード */
.board { display: grid; grid-template-columns: repeat(7, minmax(160px, 1fr)); gap: 8px; overflow-x: auto; }
.board-col { background: #e9edf2; border-radius: var(--radius); padding: 6px; min-height: 200px; }
.board-col h3 { display: flex; justify-content: space-between; padding: 2px 4px 6px; margin: 0; color: var(--text); font-size: 12px; }
.board-col h3 .cnt { color: var(--muted); font-weight: normal; }
.card { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 7px 9px; margin-bottom: 6px; font-size: 12px; cursor: pointer; }
.card:hover { border-color: var(--primary); }
.card .t { font-weight: 600; margin-bottom: 2px; }
.card .a { color: var(--muted); display: flex; justify-content: space-between; }

.stage-steps { display: flex; gap: 2px; margin-bottom: 12px; }
.stage-steps span { flex: 1; text-align: center; padding: 5px 4px; background: #e9edf2; font-size: 11px; color: var(--muted); }
.stage-steps span.done { background: #c7d6ee; color: var(--primary); }
.stage-steps span.cur { background: var(--primary); color: #fff; font-weight: 600; }
.stage-steps span.lost { background: var(--danger); color: #fff; }

.drop { border: 2px dashed var(--border); padding: 24px; text-align: center; color: var(--muted); border-radius: var(--radius); background: #fafbfc; }
.drop.over { border-color: var(--primary); background: var(--primary-light); }
code, .mono { font-family: Consolas, "Courier New", monospace; font-size: 12px; word-break: break-all; }
pre.mono { background: #f6f8fa; padding: 8px 10px; border-radius: var(--radius); overflow: auto; }
/* ヒアリング対話 */
.chat { display: flex; flex-direction: column; height: 70vh; min-height: 420px; }
.chat-log { flex: 1; overflow-y: auto; padding: 4px 2px; display: flex; flex-direction: column; gap: 10px; }
.chat-msg { max-width: 85%; padding: 9px 13px; border-radius: 6px; font-size: 13px; line-height: 1.7; }
.chat-msg.assistant { background: #f3f5f8; border: 1px solid var(--border-light); align-self: flex-start; }
.chat-msg.user { background: var(--primary-light); border: 1px solid #c9d8f0; align-self: flex-end; }
.chat-rationale { margin-top: 6px; padding-top: 6px; border-top: 1px dashed var(--border); color: var(--muted); font-size: 12px; }
.chat-count { margin-top: 4px; font-weight: 600; color: var(--primary); }
.chat-choices { display: flex; flex-wrap: wrap; gap: 6px; padding: 10px 0 4px; }
.btn.choice { border-color: #b8c7e0; background: #fff; }
.btn.choice.sel { background: var(--primary-light); border-color: var(--primary); color: var(--primary); }
.chat-input { display: flex; gap: 6px; padding-top: 6px; }
.chat-foot { display: flex; align-items: center; gap: 8px; padding-top: 8px; border-top: 1px solid var(--border-light); margin-top: 8px; }
.chat-foot .spacer { flex: 1; }
.dots { color: var(--faint); letter-spacing: 2px; }

.notice { background: var(--warn-light); border: 1px solid #f0d9a8; padding: 8px 12px; border-radius: var(--radius); font-size: 12px; margin-bottom: 12px; }
.print-hide { }

/* 利用状況バー・セットアップガイド・運営コンソール */
.usage { display: flex; align-items: center; gap: 12px; font-size: 12px; color: var(--muted); margin-bottom: 10px; }
.usage .bar { flex: 0 0 220px; height: 8px; background: #e2e8f0; border-radius: 4px; overflow: hidden; }
.usage .bar > i { display: block; height: 100%; background: var(--primary); }
.wizard { display: flex; flex-direction: column; gap: 8px; }
.wstep { display: flex; align-items: center; gap: 14px; background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 16px; }
.wstep.done { background: #f7fbf8; }
.wnum { width: 30px; height: 30px; border-radius: 50%; background: var(--primary-light); color: var(--primary); display: flex; align-items: center; justify-content: center; font-weight: 600; flex-shrink: 0; }
.wstep.done .wnum { background: var(--success-light); color: var(--success); }
.wbody { flex: 1; }
.wtitle { font-weight: 600; margin-bottom: 2px; }
body.platform .topbar { border-bottom: 3px solid #b8860b; }
body.platform .brand-sub { color: #9a5b00; font-weight: 600; }
@media (max-width: 800px) { .usage .bar { flex-basis: 120px; } .wstep { flex-wrap: wrap; } }

/* ---------- 社内運用（2026-10-13）: 通知・重複の注意・今日の自分・チーム状況 ---------- */
.bell { position: relative; color: var(--muted); text-decoration: none; font-size: 12px; padding: 2px 6px; border: 1px solid var(--border); border-radius: var(--radius); background: #fff; }
.bell:hover { background: #f5f7fa; }
.bell .badge { display: inline-block; min-width: 16px; margin-left: 4px; padding: 0 4px; border-radius: 8px; background: var(--danger); color: #fff; font-size: 10px; line-height: 16px; text-align: center; }
.conflict-box { background: var(--danger-light); border: 1px solid #e4a39d; color: var(--danger); border-radius: var(--radius); padding: 8px 12px; margin-bottom: 12px; font-size: 12.5px; }
.conflict-box ul { margin: 4px 0 0; padding-left: 18px; color: var(--text); }
.last-call { display: flex; gap: 12px; align-items: center; background: var(--primary-light); border-color: #c4d4ef; }
.last-call a { margin-left: 10px; }
.team-notice { background: var(--primary-light); border-color: #c4d4ef; font-size: 13px; }
.my-today .kpis { margin-bottom: 10px; }
.kpi.kpi-alert { border-color: #e4a39d; background: #fffafa; }
.text-danger { color: var(--danger); }
.mini-bar { display: inline-block; width: 70px; height: 6px; background: #e6eaf0; border-radius: 3px; overflow: hidden; vertical-align: middle; margin-right: 6px; }
.mini-bar i { display: block; height: 100%; background: var(--primary); }
.mini-bar i.ok { background: var(--success); }
.queue-list { display: flex; flex-wrap: wrap; gap: 8px; }
.queue-list .btn { display: inline-flex; flex-direction: column; align-items: flex-start; min-height: 40px; padding: 5px 12px; }
.queue-list .q-sub { font-size: 11px; opacity: .8; }
.section-title { font-size: 14px; margin: 18px 0 8px; font-weight: 600; }
.tabs.inline { border-bottom: 0; margin: 0; }
.result-grid kbd { display: inline-block; min-width: 14px; margin-right: 4px; padding: 0 3px; border: 1px solid var(--border); border-radius: 3px; background: #f4f6f9; color: var(--muted); font-size: 10px; font-family: inherit; line-height: 14px; }
.result-grid .btn.sel kbd { background: #fff; }
.inline-form { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.inline-form input[type=date] { width: auto; }

/* ---------- 予定表・今日・スマホ表示（2026-10-13） ---------- */
.cal-filters { align-items: center; }
.cal-filters .checks.inline { max-height: none; border: 0; padding: 0; background: none; }
.cal-filters input[type=date] { width: auto; }
.cal-panel { overflow: hidden; }
.cal-week { width: 100%; border-collapse: collapse; table-layout: fixed; font-size: 12px; }
.cal-week th, .cal-week td { border: 1px solid var(--border-light); padding: 4px; vertical-align: top; }
.cal-week thead th { background: var(--th); font-weight: 600; text-align: center; position: sticky; top: 0; z-index: 1; }
.cal-week th.cal-who { width: 130px; text-align: left; background: #fafbfc; font-weight: 600; }
.cal-week th.weekend { color: var(--danger); }
.cal-week .today { background: #f3f8ff; }
.cal-week td { height: 64px; }
.ev { display: block; border-left: 3px solid var(--faint); background: #f4f6f9; color: var(--text); border-radius: 2px; padding: 1px 5px; margin-bottom: 3px; font-size: 11.5px; line-height: 1.35; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
a.ev:hover { text-decoration: none; filter: brightness(.96); }
.ev .ev-time { color: var(--muted); margin-right: 4px; font-variant-numeric: tabular-nums; }
.ev .ev-user { color: var(--faint); margin-left: 6px; }
.ev-deal { border-left-color: var(--success); background: var(--success-light); }
.ev-task { border-left-color: var(--primary); background: var(--primary-light); }
.ev-task.done { opacity: .55; text-decoration: line-through; }
.ev-ext { border-left-color: #9aa5b4; background: #eceff3; color: var(--muted); }
.cb-badge { display: inline-block; border: 1px solid #f0c674; background: var(--warn-light); color: var(--warn); border-radius: 10px; padding: 0 7px; font-size: 11px; cursor: pointer; margin-top: 2px; }
.cb-badge.late { border-color: #e4a39d; background: var(--danger-light); color: var(--danger); }
.cal-day { font-size: 12px; }
.cal-day-row { display: flex; border-bottom: 1px solid var(--border-light); min-height: 44px; }
.cal-day-row .cal-who { width: 150px; flex-shrink: 0; padding: 6px 8px; font-weight: 600; border-right: 1px solid var(--border-light); }
.cal-day-row .cal-track { position: relative; flex: 1; min-height: 44px; }
.cal-day-head { background: var(--th); min-height: 26px; }
.cal-day-head .cal-track span { position: absolute; top: 5px; transform: translateX(-50%); color: var(--muted); font-size: 11px; }
.cal-track .hr { position: absolute; top: 0; bottom: 0; border-left: 1px dashed var(--border-light); }
.cal-track .blk { position: absolute; top: 4px; bottom: 4px; min-width: 18px; }
.cal-track .blk .ev { height: 100%; margin: 0; white-space: normal; }
.agenda-day { padding: 8px 14px; border-bottom: 1px solid var(--border-light); }
.agenda-date { font-weight: 600; margin-bottom: 6px; }
.agenda-date.today { color: var(--primary); }
.agenda-item { padding: 3px 0; }
.agenda-item .ev { white-space: normal; font-size: 13px; padding: 5px 8px; }
.agenda-item.next .ev { box-shadow: 0 0 0 2px rgba(31,78,154,.35); }
.agenda-item .sub, .next-up .sub { color: var(--faint); font-size: 11px; margin: 0 0 0 11px; }
.agenda-cb { margin-bottom: 4px; }
.today-head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 10px; }
.today-kpis { grid-template-columns: repeat(4, 1fr); }
.next-up .ev { font-size: 14px; padding: 7px 10px; white-space: normal; }
.today-actions { margin-bottom: 20px; }
.raw-pre { white-space: pre-wrap; word-break: break-all; background: #f6f8fa; border: 1px solid var(--border-light); padding: 10px; font-size: 12px; max-height: 50vh; overflow: auto; }
.bottomnav { display: none; }
.nav-mobile-only { display: none !important; }

/* スマホ（幅 800px 以下） */
@media (max-width: 800px) {
  body { font-size: 14px; }
  .topbar { height: 50px; padding: 0 8px; gap: 8px; }
  .nav-toggle { font-size: 18px; line-height: 1; padding: 4px 10px; }
  /* 検索欄は「検索」ボタンに畳み、押すとヘッダーのすぐ下に全幅で開く（2026-10-19: ヘッダーが横に広がりすぎていたため） */
  .gsearch { display: none; }
  .search-toggle { display: inline-flex; align-items: center; padding: 4px 8px; font-size: 13px; }
  body.search-open .gsearch:not(.hidden) { display: flex; position: fixed; top: 50px; left: 0; right: 0; z-index: 55; gap: 6px; padding: 8px; background: #fff; border-bottom: 1px solid var(--border); box-shadow: 0 6px 16px rgba(0,0,0,.12); }
  .gsearch .btn { display: none; }
  body.search-open .gsearch .btn { display: inline-block; }
  .topbar-right { gap: 6px; }
  .bell { padding: 4px 8px; font-size: 13px; }
  /* 左のメニュー（2026-10-20）: メニューの中だけがスクロールし、端まで行っても後ろのページに動きが伝わらないようにする。
     下のメニュー（z-index 45）より手前に出し、背景（nav-backdrop）で後ろのページへの操作を止める */
  /* 高さは「実際に見えている画面」（100dvh）に合わせる。iPhone の Safari は画面下にもツールバーが出るため、下の項目が隠れないように */
  .sidenav { top: 50px; width: 240px; max-width: 82vw; max-height: calc(100dvh - 50px); z-index: 50; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; padding-bottom: calc(48px + env(safe-area-inset-bottom)); }
  body.nav-open .nav-backdrop { display: block; position: fixed; top: 50px; left: 0; right: 0; bottom: 0; z-index: 49; background: rgba(15, 23, 35, .45); touch-action: none; }
  body.nav-open, body.nav-open .main { overflow: hidden; overscroll-behavior: none; }
  .sidenav a { padding: 11px 16px 11px 20px; font-size: 14px; }
  .main { padding: 10px 10px 24px; }
  body.has-bottomnav .main { padding-bottom: 80px; }
  body.has-bottomnav .bottomnav:not(.hidden) { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 45; background: #fff; border-top: 1px solid var(--border); padding-bottom: env(safe-area-inset-bottom); }
  .bottomnav a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 1px; padding: 6px 0 7px; color: var(--muted); font-size: 11px; }
  .bottomnav a:hover { text-decoration: none; }
  .bottomnav a.active { color: var(--primary); font-weight: 600; }
  .bottomnav .bn-ico { font-size: 17px; line-height: 1.1; }
  .page-head { gap: 8px; }
  .page-head h1 { font-size: 16px; }
  .btn { min-height: 36px; padding: 6px 12px; }
  .btn.sm { min-height: 30px; padding: 4px 10px; font-size: 13px; }
  input[type=text], input[type=search], input[type=password], input[type=number], input[type=date], input[type=datetime-local], input[type=email], input[type=url], select, textarea { min-height: 38px; font-size: 16px; } /* 16px 未満だと iPhone で入力時に拡大される */
  .form-grid, .form-grid.c3 { grid-template-columns: 1fr; }
  .filters { gap: 6px; }
  /* タブはチップ型で折り返す（設定画面などで項目が 10 個あっても横にはみ出さない） */
  .tabs { gap: 6px; border-bottom: 0; padding-bottom: 2px; }
  .tabs a { padding: 6px 12px; margin-bottom: 0; border: 1px solid var(--border); border-radius: 999px; background: #fff; font-size: 13px; }
  .tabs a.active { background: var(--primary); border-color: var(--primary); color: #fff; }
  .filters label { min-width: 0; flex: 1 1 140px; }
  .kpis { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .kpi { padding: 10px 12px; }
  .kpi .k-value { font-size: 20px; }
  .today-kpis { grid-template-columns: repeat(2, 1fr); }
  .tbl-wrap { max-height: none; -webkit-overflow-scrolling: touch; }
  .tbl th, .tbl td { padding: 8px; }
  .modal-backdrop { padding: 0; align-items: stretch; }
  .modal, .modal.wide, .modal.narrow { width: 100%; border-radius: 0; min-height: 100%; display: flex; flex-direction: column; }
  .modal-body { max-height: none; flex: 1; }
  .modal-foot { position: sticky; bottom: 0; }
  .call-layout { grid-template-columns: 1fr; }
  .result-grid .btn { min-height: 42px; }
  .result-grid kbd { display: none; }
  /* 項目名の列は幅を固定せず、長い項目名（例「出力（Excel・CSV）」）は折り返す（2026-10-20: 隣の値に重なっていた） */
  dl.props { grid-template-columns: minmax(84px, 34%) 1fr; }
  dl.props dt { white-space: normal; overflow-wrap: anywhere; }
  .cal-week th.cal-who { width: 90px; }
  .cal-week { min-width: 720px; }
  .cal-day-row .cal-who { width: 100px; }
  .cal-day { min-width: 640px; }
  .cal-panel { overflow-x: auto; }
  .nav-mobile-only:not(.hidden) { display: block !important; }
  .queue-list .btn { flex: 1 1 100%; }
  .today-actions .btn { flex: 1 1 30%; }
  .toast { font-size: 14px; }
}
@media (max-width: 420px) {
  .brand .wordmark { font-size: 14px; letter-spacing: .06em; }
  .gsearch input { font-size: 15px; }
}
@media (max-width: 800px) { .cal-filters .checks label { flex: 0 0 auto; } .cal-filters .checks { width: 100%; } }
/* 画面の枠組み（グリッド）が中の表の幅で広がらないように。表は枠の中で横にスクロールする */
.grid > * { min-width: 0; }
@media (max-width: 800px) { .tbl th, .tbl td { min-width: 5.5em; } .tbl td.num, .tbl th.num, .tbl td:has(> input[type=checkbox]) { min-width: 3em; } }
/* ---------- 熱い理由とトスアップのポイント・リストに戻る（2026-10-13） ---------- */
.insight { border-left: 3px solid var(--success); }
.insight .insight-body { padding: 12px 14px 4px; gap: 18px; }
.insight.compact { border-left-color: var(--primary); }
.insight ul.bullets { margin: 0 0 6px; padding-left: 18px; }
.insight ul.bullets li { margin-bottom: 3px; }
.insight .opening { background: var(--success-light); border-radius: var(--radius); padding: 8px 10px; margin-bottom: 8px; }
.insight .opening div { font-weight: 600; font-size: 13.5px; }
.insight.compact .opening { background: var(--primary-light); }
.confirm-list { list-style: none; margin: 0 0 6px; padding: 0; }
.confirm-list li { padding: 3px 0 3px 22px; position: relative; }
.confirm-list li::before { content: ''; position: absolute; left: 2px; top: 6px; width: 11px; height: 11px; border: 1.5px solid var(--muted); border-radius: 2px; }
.insight .conflict-box { margin: 10px 14px 0; }
.back-bar { margin: -2px 0 10px; }
.tbl tr.row-last td { background: #fff8e1; }
.tbl tr.row-last td:first-child { box-shadow: inset 3px 0 0 #f0b429; }
/* ---------- 架電画面: 架電結果の欄を枠に収める（2026-10-13） ----------
   ボタンが折り返さない設定のため、長い結果名（「番号不明・現在使われていない」等）で列が広がり右へはみ出していた */
.call-layout { grid-template-columns: minmax(0, 1fr) minmax(340px, 400px); }
.call-layout > * { min-width: 0; }
.result-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.result-grid .btn { white-space: normal; min-width: 0; line-height: 1.3; padding: 6px 8px; display: flex; align-items: center; gap: 4px; text-align: left; overflow-wrap: anywhere; }
.result-grid .btn kbd { flex-shrink: 0; }
#rf .row > input { min-width: 0; }
#rf .btn-group { flex-wrap: wrap; }
@media (max-width: 1000px) { .call-layout { grid-template-columns: minmax(0, 1fr); } }
