:root {
  --bg: #f4f6f9; --card: #fff; --text: #1d2733; --muted: #667585; --line: #e1e6ec;
  --primary: #1f5fbf; --primary-d: #164a96; --danger: #c0392b; --ok: #1e8e5a; --warn: #b9770e;
  --radius: 10px; --hd: #0b4f5c; /* システム全体のヘッダーの色 */
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); line-height: 1.6;
  font-family: "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic UI", "Meiryo", system-ui, sans-serif; font-size: 15px; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { margin: 0 0 .6em; line-height: 1.35; }
h2 { font-size: 1.1rem; } h3 { font-size: 1rem; }
.muted { color: var(--muted); } .small { font-size: .85rem; } .right { text-align: right; }
.hidden { display: none !important; }

/* header */
.hd { background: var(--hd); color: #fff; position: -webkit-sticky; position: sticky; top: 0; z-index: 10; } /* 常に画面の上に表示する */
.hd-in { max-width: 1200px; margin: 0 auto; padding: 0 16px; display: flex; align-items: center; gap: 14px; min-height: 52px; flex-wrap: wrap; }
.brand { color: #fff; font-weight: 700; letter-spacing: .02em; padding: 8px 0; }
.brand:hover { text-decoration: none; }
.nav { display: flex; gap: 2px; flex: 1; flex-wrap: wrap; }
.nav a { color: #d6e2ff; padding: 14px 10px; font-size: .92rem; border-bottom: 3px solid transparent; }
.nav a:hover { color: #fff; text-decoration: none; }
.nav a.on { color: #fff; border-bottom-color: #7fb0ff; }
.who { font-size: .85rem; color: #d6e2ff; display: flex; gap: 10px; align-items: center; }
/* ポータルと同じ並び: 名前(大きめの太字)→丸い白枠のアイコン→ログアウトボタン を縦に並べる */
.who { flex-direction: column; gap: 5px; padding: 6px 0; }
.who > span { order: -1; font-size: 1.05rem; font-weight: 700; color: #fff; }
.who .who-ph { order: 0; }
.who button { order: 1; }
.who-ph { display: inline-flex; flex: none; border-radius: 50%; }
.who-img { width: 36px; height: 36px; aspect-ratio: 1 / 1; border-radius: 50%; border: 2px solid #fff; background: #e9edf2; box-sizing: border-box; box-shadow: 0 0 0 1px rgba(0,0,0,.15); object-fit: cover; display: block; }
.who-av { width: 36px; height: 36px; aspect-ratio: 1 / 1; border-radius: 50%; border: 2px solid #fff; background: #e9edf2; color: #14316b; box-sizing: border-box; box-shadow: 0 0 0 1px rgba(0,0,0,.15); display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: 1rem; line-height: 1; }
.who button { background: transparent; border: 1px solid #5c78b5; color: #fff; padding: 4px 10px; border-radius: 6px; cursor: pointer; }

main { max-width: 1200px; margin: 0 auto; padding: 18px 16px 60px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; margin-bottom: 16px; }
.card > h2:first-child { margin-top: 0; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.row.between { justify-content: space-between; }
.grow { flex: 1; min-width: 160px; }

/* forms */
label { display: block; font-size: .82rem; font-weight: 600; color: var(--muted); margin: 14px 0 0; }
label > input:not([type=checkbox]):not([type=radio]):not([type=file]):not([type=hidden]), label > select, label > textarea { display: block; margin-top: 6px; font-size: 15px; font-weight: 400; color: var(--text); }
/* 入力欄: 淡い灰色の塗り・角丸・余白広め。クリックすると白地+青い枠+ふちの光(細い枠線の入力欄は使わない) */
input[type=text], input[type=email], input[type=password], input[type=tel], input[type=number], input[type=date],
input[type=datetime-local], input[type=search], input[type=url], input[type=month], input[type=time], select, textarea {
  width: 100%; padding: 11px 14px; border: 1.5px solid transparent; border-radius: 12px; font: inherit; line-height: 1.4; background: #f1f5f9; color: inherit;
  transition: background .12s, border-color .12s, box-shadow .12s; }
input:not([type]) { padding: 11px 14px; border: 1.5px solid transparent; border-radius: 12px; font: inherit; line-height: 1.4; background: #f1f5f9; color: inherit; transition: background .12s, border-color .12s, box-shadow .12s; }
label > input:not([type]) { width: 100%; }
textarea { min-height: 110px; resize: vertical; line-height: 1.6; }
select { appearance: none; -webkit-appearance: none; padding-right: 40px; cursor: pointer;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'><path d='M1 1.5l5 5 5-5' fill='none' stroke='%2364748b' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/></svg>");
  background-repeat: no-repeat; background-position: right 14px center; }
input::placeholder, textarea::placeholder { color: #9aa6b6; }
input:hover:not(:focus):not([readonly]):not([disabled]), select:hover:not(:focus), textarea:hover:not(:focus) { background: #eaf0f6; }
input:focus, select:focus, textarea:focus { outline: none; background-color: #fff; border-color: var(--primary); box-shadow: 0 0 0 4px rgba(31, 95, 191, .15); }
input[readonly], input[disabled], select[disabled], textarea[disabled] { background-color: #e8edf3; color: #64748b; }
.zip-hint { font-size: .8rem; margin: 6px 0 0; color: #15803d; } .zip-hint.err { color: #b91c1c; } .zip-hint.note { color: var(--muted); }
.chk { display: inline-flex; align-items: center; gap: 6px; color: var(--text); font-size: .9rem; margin: 0; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
@media (max-width: 640px) { .grid2 { grid-template-columns: 1fr; } }

button, .btn { font: inherit; border-radius: 7px; border: 1px solid #c9d1da; background: #fff; color: var(--text);
  padding: 7px 14px; cursor: pointer; display: inline-block; }
button:hover, .btn:hover { background: #f1f4f8; text-decoration: none; }
button.primary { background: var(--primary); border-color: var(--primary); color: #fff; }
button.primary:hover { background: var(--primary-d); }
button.danger { color: var(--danger); border-color: #e6b8b2; }
button.sm { padding: 3px 9px; font-size: .85rem; }
button:disabled { opacity: .55; cursor: default; }

.msg { padding: 9px 12px; border-radius: 7px; margin: 10px 0; font-size: .9rem; }
.msg.err { background: #fdecea; color: #8e2a20; } .msg.ok { background: #e8f6ee; color: #14633f; }

/* badges */
.badge { display: inline-block; font-size: .72rem; padding: 1px 8px; border-radius: 99px; background: #e7edf6; color: #36506f; vertical-align: middle; white-space: nowrap; }
.badge.contract { background: #fff1d6; color: #7a5200; }
.badge.gray { background: #e8eaed; color: #555; }
.badge.pin { background: #fde3e1; color: #9a2c22; }
.badge.type-法人 { background: #dfe9ff; color: #1b4a9c; }
.badge.type-部署 { background: #e5f4ea; color: #1d6b41; }
.badge.type-店舗 { background: #fdeede; color: #8a4b0b; }
.badge.type-担当 { background: #efe8fb; color: #5a3a96; }
.badge.type-グループ { background: #fdf1da; color: #8a5a00; }
.badge.type-チーム { background: #dcf3f1; color: #0b6b66; }

/* notices */
.notice { border-top: 1px solid var(--line); padding: 8px 0; }
.notice:first-of-type { border-top: 0; }
.notice summary { cursor: pointer; display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.notice .date { color: var(--muted); font-size: .82rem; min-width: 5.5em; }
.notice .body { white-space: pre-wrap; padding: 8px 0 4px 0; color: #2b3945; overflow-wrap: anywhere; }

/* org tree */
.tree, .tree ul { list-style: none; margin: 0; padding-left: 22px; }
.tree { padding-left: 0; }
.tree li { position: relative; }
.node { display: flex; align-items: center; gap: 8px; padding: 6px 4px; border-radius: 7px; }
.node:hover { background: #f0f4fa; }
.tg { width: 24px; height: 24px; padding: 0; line-height: 1; border-radius: 6px; font-size: .8rem; flex: none; }
.tg.ph { visibility: hidden; }
.node a.nm { font-weight: 600; color: var(--text); overflow-wrap: anywhere; }
.node .cnt { margin-left: auto; font-size: .85rem; color: var(--muted); white-space: nowrap; }
.tree ul { border-left: 2px solid var(--line); margin-left: 11px; }
.node .nmw { flex: 1; min-width: 0; }
.node .nmw .alias { display: inline-block; }
.node .badge { flex: none; white-space: nowrap; }
/* スマホ幅では法人格(株式会社など)を隠す */
@media screen and (max-width: 600px) { .corp { display: none; } }
/* スマホ: 階層の字下げを減らし、名称が縦に折れないようにする(別称は名称の下に表示) */
@media (max-width: 600px) {
  .tree ul { padding-left: 10px; margin-left: 9px; }
  .node { gap: 6px; padding: 7px 2px; align-items: flex-start; }
  .node .tg { width: 28px; height: 28px; }
  .node .badge { font-size: .68rem; padding: 2px 6px; margin-top: 4px; }
  .node a.nm { overflow-wrap: break-word; word-break: normal; line-height: 1.4; }
  .node .nmw { padding-top: 2px; }
  .node .nmw .alias { display: block; font-size: .78rem; line-height: 1.35; }
  .node .cnt { font-size: .78rem; margin-top: 4px; }
}

/* people */
.people { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 10px; }
.person { display: block; background: #fff; border: 1px solid var(--line); border-radius: 9px; padding: 11px 13px; color: var(--text); }
a.person:hover { border-color: #9cb8e6; text-decoration: none; background: #f8faff; }
.person .pn { font-weight: 700; } .person .ps { font-size: .85rem; color: var(--muted); } .person .pd { font-size: .85rem; margin-top: 3px; }
.person.retired { background: #f4f4f5; color: #777; }
.crumb { font-size: .88rem; color: var(--muted); margin-bottom: 6px; }
dl.kv { display: grid; grid-template-columns: 8.5em 1fr; gap: 8px 12px; margin: 0; }
dl.kv dt { color: var(--muted); font-size: .88rem; } dl.kv dd { margin: 0; overflow-wrap: anywhere; }
@media (max-width: 520px) { dl.kv { grid-template-columns: 1fr; gap: 0; } dl.kv dd { margin-bottom: 8px; } }

/* tables */
.tbl-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .9rem; }
th, td { text-align: left; padding: 8px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-weight: 600; font-size: .8rem; white-space: nowrap; }
tr.retired td { color: #888; background: #fafafa; }

/* dialog / toast */
dialog { border: 0; border-radius: 12px; padding: 0; width: min(680px, 94vw); max-height: 92vh; box-shadow: 0 12px 40px rgba(0,0,0,.28); }
dialog::backdrop { background: rgba(20, 30, 50, .45); }
.dlg-in { padding: 20px; max-height: 92vh; overflow: auto; }
.dlg-ft { display: flex; gap: 8px; justify-content: flex-end; margin-top: 16px; flex-wrap: wrap; }
.aff-row { display: grid; grid-template-columns: 1fr 140px auto auto; gap: 6px; align-items: center; margin-bottom: 6px; }
@media (max-width: 560px) { .aff-row { grid-template-columns: 1fr 1fr; } }
#toast { position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%); background: #1d2733; color: #fff; padding: 9px 16px;
  border-radius: 8px; opacity: 0; pointer-events: none; transition: opacity .2s; z-index: 50; max-width: 90vw; }
#toast.show { opacity: .96; }

/* login */
.login { max-width: 400px; margin: 9vh auto 0; }
.login h1 { font-size: 1.25rem; text-align: center; }
.login .card { padding: 24px; }

.suggest { position: absolute; left: 0; right: 0; top: 100%; z-index: 30; margin: 2px 0 0; padding: 4px 0; list-style: none;
  background: var(--card, #fff); border: 1px solid var(--line, #ccd); border-radius: 8px; box-shadow: 0 6px 18px rgba(0,0,0,.15); max-height: 320px; overflow-y: auto; }
.suggest li { padding: 8px 12px; cursor: pointer; display: flex; gap: 8px; flex-wrap: wrap; align-items: baseline; }
.suggest li:hover, .suggest li.on { background: rgba(31,78,121,.1); }
.suggest.hidden { display: none; }
.row.grow-wrap { position: relative; }

/* ---- 組織図(ツリー図) ---- */
.chart-head { display: flex; align-items: baseline; gap: 12px; }
.chart-wrap { overflow: auto; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; }
.oc { display: block; width: max-content; --ln: #7a8794; }
.oc ul { list-style: none; margin: 0; padding: 0; }
.oc .top, .oc .cols { display: flex; justify-content: center; }
.oc .top > li { text-align: center; }
.oc .cols { padding-top: 22px; position: relative; align-items: flex-start; }
.oc .cols::before { content: ''; position: absolute; top: 0; left: 50%; height: 22px; border-left: 1px solid var(--ln); }
.oc .cols > li { position: relative; padding: 22px 6px 0; text-align: center; flex: 0 0 auto; display: flex; flex-direction: column; align-items: stretch; }
.oc .cols > li::before, .oc .cols > li::after { content: ''; position: absolute; top: 0; width: 50%; height: 22px; border-top: 1px solid var(--ln); }
.oc .cols > li::before { right: 50%; }
.oc .cols > li::after { left: 50%; border-left: 1px solid var(--ln); }
.oc .cols > li:first-child::before, .oc .cols > li:last-child::after { border-top: 0; }
.oc .cols > li:last-child::before { border-right: 1px solid var(--ln); }
.oc .cols > li:only-child::before, .oc .cols > li:only-child::after { display: none; }
.oc .cols > li:only-child::after { display: block; border-top: 0; }
.oc .stack { margin: 0 0 0 22px; text-align: left; }
.oc .cols > li > .stack { margin-top: 0; }
.oc .stack > li { position: relative; padding: 8px 0 0 16px; }
.oc .stack > li::before { content: ''; position: absolute; left: 0; top: 24px; width: 16px; border-top: 1px solid var(--ln); }
.oc .stack > li::after { content: ''; position: absolute; left: 0; top: 0; bottom: 0; border-left: 1px solid var(--ln); }
.oc .stack > li:last-child::after { bottom: auto; height: 24px; }
.oc .ob { display: inline-flex; flex-direction: column; gap: 1px; min-width: 128px; max-width: 168px; padding: 6px 10px; border: 1.5px solid #5b6b7a; border-radius: 6px;
  background: #eef3f9; color: #1d2733; text-align: center; font-size: 13px; line-height: 1.35; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.oc .ob:hover { text-decoration: none; border-color: var(--primary); }
.oc .ob-t { font-size: 10px; color: #566676; }
.oc .ob-n { font-weight: 700; overflow-wrap: anywhere; word-break: normal; text-wrap: balance; line-height: 1.35; }
.oc .ob-c { font-size: 11px; color: #3a4a5a; }
.oc .ob-m { font-size: 10px; color: #3a4a5a; border-top: 1px dotted #9aa8b5; margin-top: 3px; padding-top: 2px; }
/* 枠の色は種類(法人・部署など)ではなく階層(深さ)で決める: 同じ階層なら同じ色 */
.oc .ob.lv-0 { background: #fff3d6; border-color: #c9a24a; }
.oc .ob.lv-1 { background: #e3e6f8; border-color: #7f8bc9; }
.oc .ob.lv-2 { background: #d3e5f8; border-color: #5b8fc7; }
.oc .ob.lv-3 { background: #e2f3e8; border-color: #6aa97f; }
.oc .ob.lv-4 { background: #f1e9f8; border-color: #a184c2; }
.oc .ob.lv-5 { background: #f4f4f4; border-color: #8a8a8a; }
.oc .stack .ob { text-align: left; align-items: flex-start; }
@media print {
  .chart-page { break-after: page; page-break-after: always; margin-bottom: 0; }
  .chart-page:last-of-type { break-after: auto; page-break-after: auto; }
  .hd, .no-print, #toast { display: none !important; }
  body { background: #fff; }
  main { padding: 0 !important; max-width: none !important; }
  .chart-wrap { border: 0; padding: 0; overflow: visible; }
  .chart-head { margin-bottom: 6px; }
  .oc .ob:hover { border-color: inherit; }
}

.chart-page { margin-bottom: 18px; }

/* ---- 顔写真・履歴・デバイス ---- */
.ph { display: inline-block; flex: none; aspect-ratio: 3 / 4; background: #e9edf2; border-radius: 4px; overflow: hidden; border: 1px solid var(--line); }
.ph svg, .ph img { display: block; width: 100%; height: 100%; object-fit: cover; }
.ph-sm { width: 45px; } .ph-lg { width: 120px; }
.person.pc { display: flex; gap: 11px; align-items: flex-start; }
.person .pbody { min-width: 0; flex: 1; }
.dhead { display: flex; gap: 16px; align-items: flex-start; flex-wrap: wrap; }
.dhead > div:last-child { flex: 1; min-width: 240px; }
.pcrop { border: 1px solid var(--line); border-radius: 6px; touch-action: none; cursor: grab; max-width: 100%; }
.er { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 6px; align-items: end; padding: 8px 0; border-bottom: 1px dashed var(--line); }
h3 { margin: 18px 0 6px; font-size: 1rem; }
@media print { .ph-sm { width: 30px; } }

.hprompt { border: 1px solid #f0b429; background: #fffbea; border-radius: 6px; margin: 12px 0; padding: 8px 12px; }
.hprompt legend { font-weight: 600; padding: 0 6px; }

/* 組織図: 管理者のドラッグ並べ替え */
.oc .ob[draggable=true] { cursor: grab; }
.oc .ob.dragging { opacity: .35; }
.oc .ob.drop-before { box-shadow: -5px 0 0 0 var(--primary); }
.oc .ob.drop-after { box-shadow: 5px 0 0 0 var(--primary); }
.oc .stack .ob.drop-before { box-shadow: 0 -5px 0 0 var(--primary); }
.oc .stack .ob.drop-after { box-shadow: 0 5px 0 0 var(--primary); }

.alias{color:#666;font-size:.85em}
.oc .ob .ob-a{display:none;font-size:.75em;color:#555}
/* 別称は画面ではマウスを乗せたときだけ(title)。印刷時はボックス内に表示 */
.chart-printing .oc .ob .ob-a{display:block}
@media print{.oc .ob .ob-a{display:block}}

.steps{padding-left:1.3em;margin:0 0 10px}.steps li{margin-bottom:8px}
.badges{display:flex;gap:10px;flex-wrap:wrap;align-items:center;margin-top:6px}
.badge-link{display:inline-block;line-height:0}.badge-link img{height:40px;width:auto}
.badge-text{display:inline-block;line-height:1.4;padding:10px 14px;border:1px solid #888;border-radius:8px;background:#000;color:#fff;font-size:.9em}
.qr{width:200px;height:200px;margin:10px auto;background:#fff;padding:8px;border-radius:8px;border:1px solid #ccc}.qr svg{width:100%;height:100%;display:block}

/* スマホ: ハンバーガーメニュー */
.menu-btn { display: none; }
@media (max-width: 720px) {
  .hd-in { gap: 0; }
  .brand { flex: 1; font-size: .95rem; padding: 14px 0; }
  .menu-btn { display: flex; flex-direction: column; justify-content: center; gap: 5px; width: 44px; height: 44px; padding: 0 10px; background: transparent; border: 0; border-radius: 8px; cursor: pointer; }
  .menu-btn span { display: block; height: 2px; background: #fff; border-radius: 2px; transition: transform .2s, opacity .2s; }
  .menu-open .menu-btn span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  .menu-open .menu-btn span:nth-child(2) { opacity: 0; }
  .menu-open .menu-btn span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
  .nav, .who { display: none; width: 100%; flex: none; }
  .menu-open .nav { display: flex; flex-direction: column; gap: 0; border-top: 1px solid rgba(255,255,255,.2); }
  .nav a { padding: 13px 4px; border-bottom: 1px solid rgba(255,255,255,.12); font-size: 1rem; }
  .nav a.on { border-bottom-color: rgba(255,255,255,.12); background: rgba(255,255,255,.12); padding-left: 10px; }
  /* スマホのメニューは、アイコン・名前・ログアウトを一番上に(横並び) */
  .menu-open .who { display: flex; flex-direction: row; justify-content: space-between; align-items: center; padding: 10px 4px 10px; order: 1; }
  .who > span { order: 0; font-size: 1.15rem; }
  .menu-open .nav { order: 2; }
}
@media print { .menu-btn { display: none !important; } }

.ft{text-align:center;padding:16px 0 24px}
@media print{.ft{display:none}}

.orginfo{background:#fff;border:1px solid var(--line,#dde3ee);border-radius:8px;padding:10px 14px;margin:8px 0 12px}

/* 法人の枠: 法人名を大きく、代表取締役はそれより小さく */
.oc .ob.t-法人 .ob-n { font-size: 14px; }
.oc .ob.t-法人 { max-width: 200px; }
/* 法人の下に法人を横並びにするとき: 親の枠は子の列の中央に置き、親子をつなぐ線は子の列の幅に合わせる */
.oc .stack + .cols.sub, .oc .ob + .cols.sub { margin-top: 0; }
.oc .cols > li > .cols.sub { align-self: stretch; }
.oc .cols > li:has(> .cols.sub) > .ob { align-self: center; }
.oc .stack > li:has(> .cols.sub) > .ob { align-self: flex-start; }
.oc .ob-a { overflow-wrap: anywhere; text-wrap: balance; }
.oc .ob .ob-r { font-size: 11px; font-weight: 400; color: #3a4a5a; margin-top: 1px; }

/* 組織管理: ドラッグで並べ替え・入れ子 */
.node[draggable=true] { cursor: grab; }
.node.dragging { opacity: .4; }
.node.drop-before { box-shadow: 0 -3px 0 0 var(--primary); }
.node.drop-after { box-shadow: 0 3px 0 0 var(--primary); }
.node.drop-in { outline: 2px dashed var(--primary); outline-offset: -2px; background: #eef4ff; }

/* 組織図の拡大縮小・横スライド */
.chart-wrap { overflow-x: auto; overflow-y: hidden; cursor: grab; max-width: 100%; }
.chart-wrap.panning { cursor: grabbing; user-select: none; }
.chart-wrap .ob { cursor: pointer; }
.zoombar .sm { min-width: 2.2em; }
@media print { .chart-wrap { overflow: visible !important; cursor: auto; max-width: none; } }

/* ---- チャット ---- */
.nbadge { display: inline-block; min-width: 18px; padding: 0 6px; margin-left: 6px; border-radius: 99px; background: #e5484d; color: #fff; font-size: .72rem; line-height: 18px; text-align: center; font-weight: 700; vertical-align: middle; }
.nbadge[hidden] { display: none; }
.lnk { background: none; border: 0; padding: 0; color: var(--primary); cursor: pointer; font-size: inherit; }
.lnk:hover { background: none; text-decoration: underline; }
.chat { display: grid; grid-template-columns: 300px 1fr; gap: 14px; align-items: stretch; height: calc(100vh - 300px); min-height: 420px; }
.chat .card { margin: 0; display: flex; flex-direction: column; min-height: 0; padding: 14px; }
.ch-side .ch-list { list-style: none; margin: 10px 0 0; padding: 0; overflow-y: auto; flex: 1; }
.ch-item { display: grid; grid-template-columns: 1fr auto; gap: 0 8px; padding: 9px 8px; border-radius: 8px; color: var(--text); border-bottom: 1px solid var(--line); }
.ch-item:hover { background: #f1f4f8; text-decoration: none; }
.ch-item.on { background: #e7efff; }
.ch-kind { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ch-prev { grid-column: 1; color: var(--muted); font-size: .82rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ch-side-r { grid-column: 2; grid-row: 1 / span 2; display: flex; flex-direction: column; align-items: flex-end; gap: 2px; }
.ch-side-r .nbadge { margin: 0; }
/* LINE風: 上部に相手の名前を固定(会話だけがスクロールする) */
.ch-hd { display: flex; align-items: center; gap: 10px; flex: none; margin: -14px -14px 0; padding: 10px 14px; background: #14316b; color: #fff; border-radius: 10px 10px 0 0; }
.ch-hd .ch-who { min-width: 0; }
.ch-hd .ch-who strong { display: block; font-size: 1.1rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ch-hd .ch-who .small { color: rgba(255,255,255,.75); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ch-hd a:not(.ch-back) { color: #fff; }
.ch-back { display: none; align-items: center; gap: 4px; flex: none; padding: 6px 12px 6px 8px; border: 1.5px solid rgba(255,255,255,.85); border-radius: 99px; color: #fff; font-weight: 700; white-space: nowrap; }
.ch-back:hover { background: rgba(255,255,255,.18); text-decoration: none; }
.ch-back span { font-size: 1.5rem; line-height: .8; }
.ch-main { background-color: #fff; }
.ch-msgs { flex: 1; overflow-y: auto; padding: 10px 2px; display: flex; flex-direction: column; gap: 6px; min-height: 0; }
.ch-day { text-align: center; margin: 8px 0 2px; font-size: .75rem; color: var(--muted); }
.ch-day span { background: #e9eef4; padding: 2px 10px; border-radius: 99px; }
.ch-m { max-width: 78%; align-self: flex-start; }
.ch-m.mine { align-self: flex-end; text-align: right; }
.ch-nm { font-size: .75rem; color: var(--muted); margin: 0 0 1px 6px; }
.ch-b { display: inline-block; text-align: left; background: #eef1f5; padding: 7px 11px; border-radius: 14px; white-space: pre-wrap; word-break: break-word; overflow-wrap: anywhere; }
.ch-m.mine .ch-b { background: var(--primary); color: #fff; }
.ch-m.mine .ch-b a { color: #fff; text-decoration: underline; }
.ch-b.del { background: transparent; border: 1px dashed #c9d1da; color: var(--muted); }
.ch-meta { font-size: .7rem; color: var(--muted); margin: 1px 6px 0; }
.ch-img { display: block; max-width: min(260px, 100%); max-height: 260px; border-radius: 8px; margin-top: 4px; }
.ch-file { display: inline-block; margin-top: 2px; }
.ch-form { border-top: 1px solid var(--line); padding-top: 10px; }
.ch-in { display: flex; gap: 8px; align-items: flex-end; }
.ch-in textarea { min-height: 38px; max-height: 140px; resize: none; flex: 1; }
.ch-chip { display: inline-block; background: #eef1f5; border-radius: 99px; padding: 2px 10px; font-size: .85rem; margin-bottom: 6px; }
.ch-tabs { display: flex; gap: 6px; margin-bottom: 4px; }
.ch-tabs button.on { background: var(--primary); border-color: var(--primary); color: #fff; }
.pk-list, .gp-mem { list-style: none; margin: 8px 0 0; padding: 0; max-height: 260px; overflow-y: auto; border: 1px solid var(--line); border-radius: 8px; }
.gp-mem { max-height: 140px; padding: 6px 10px; }
.pk-row { display: flex; align-items: center; gap: 8px; padding: 7px 10px; margin: 0; color: var(--text); cursor: pointer; border-bottom: 1px solid var(--line); }
.pk-row:hover { background: #f1f4f8; }
@media (max-width: 760px) {
  .chat { grid-template-columns: 1fr; height: calc(100vh - 120px); height: calc(100dvh - 120px); }
  .chat.has-room .ch-side { display: none; }
  .chat:not(.has-room) .ch-main { display: none; }
  .ch-back { display: inline-flex; }
  .ch-m { max-width: 88%; }
}
/* スマホ: ヘッダーのチャットアイコン(常時表示・未読は赤ポチ) */
.hd-chat { display: none; position: relative; width: 44px; height: 44px; align-items: center; justify-content: center; color: #fff; }
.hd-chat svg { width: 28px; height: 28px; display: block; }
.hd-dot { font-size: 0; position: absolute; top: 7px; right: 7px; width: 11px; height: 11px; border-radius: 50%; background: #e5484d; border: 2px solid #14316b; }
.hd-dot[hidden] { display: none; }
@media (max-width: 720px) { .hd-chat { display: flex; } }
/* PC: 右下のチャットボックス・ボタン */
.chat-dock { position: fixed; right: 16px; bottom: 16px; width: 380px; height: min(560px, calc(100vh - 90px)); background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 8px 30px rgba(0,0,0,.28); display: flex; flex-direction: column; z-index: 30; overflow: hidden; }
.cd-hd { display: flex; align-items: center; gap: 4px; padding: 8px 10px; background: #14316b; color: #fff; }
.cd-btn { background: transparent; border: 0; color: #fff; cursor: pointer; font-size: 1.05rem; line-height: 1; padding: 4px 8px; border-radius: 6px; }
.cd-btn:hover { background: rgba(255,255,255,.18); }
.cd-body { flex: 1; min-height: 0; position: relative; }
.chat.embedded { position: absolute; inset: 0; height: auto; min-height: 0; grid-template-columns: 1fr; gap: 0; }
.chat.embedded .card { border: 0; border-radius: 0; box-shadow: none; padding: 10px; }
.chat.embedded.has-room .ch-side { display: none; }
.chat.embedded:not(.has-room) .ch-main { display: none; }
.chat.embedded .ch-back { display: inline-flex; }
.chat.embedded .ch-hd { margin: -10px -10px 0; border-radius: 0; }
.chat.embedded .ch-m { max-width: 88%; }
.chat.embedded .ch-side h2 { font-size: 1rem; }
#chat-fab { position: fixed; right: 20px; bottom: 20px; width: 56px; height: 56px; padding: 0; border: 0; border-radius: 50%; background: var(--primary); color: #fff; box-shadow: 0 4px 14px rgba(0,0,0,.3); cursor: pointer; z-index: 30; display: flex; align-items: center; justify-content: center; }
#chat-fab:hover { background: var(--primary-d); }
#chat-fab svg { width: 38px; height: 38px; display: block; }
#chat-fab .nbadge { position: absolute; top: -4px; right: -4px; margin: 0; }
@media (max-width: 720px) { .chat-dock, #chat-fab { display: none !important; } }
@media print { .chat-dock, #chat-fab { display: none !important; } }
/* 別ウィンドウのチャット */
.popout-wrap { position: fixed; inset: 0; display: flex; flex-direction: column; background: #fff; }
.ch-dot { width: 9px; height: 9px; border-radius: 50%; background: #9aa7b5; display: inline-block; margin-top: 4px; }
.ch-mention { position: absolute; left: 0; right: 0; bottom: 100%; background: #fff; z-index: 5; box-shadow: 0 -4px 14px rgba(0,0,0,.12); margin: 0 0 4px; }
.ch-form { position: relative; }
.ch-mention .pk-row { width: 100%; border: 0; border-radius: 0; text-align: left; background: #fff; }
.ch-mention .pk-row.on, .ch-mention .pk-row:hover { background: #e7efff; }
.ch-mention-tag { background: rgba(31,95,191,.14); color: var(--primary-d); border-radius: 4px; padding: 0 3px; font-weight: 600; }
.ch-mention-tag.me { background: #fff3c4; color: #7a5200; }
.ch-m.mine .ch-mention-tag { background: rgba(255,255,255,.25); color: #fff; }

/* 組織図の枠: 法人格(株式会社など)は小さく1行目、名称は2行目 */
.oc .ob-n .ob-corp { display: block; font-size: 10px; font-weight: 400; line-height: 1.2; opacity: .9; }

/* チャット強化: 返信・リアクション・ピン留め・検索・添付 */
.ch-act { margin-left: 8px; display: inline-flex; gap: 8px; opacity: 0; transition: opacity .12s; }
.ch-m:hover .ch-act, .ch-m:focus-within .ch-act { opacity: 1; }
@media (hover: none) { .ch-act { opacity: 1; } }
.ch-act .lnk { font-size: .72rem; }
.ch-quote { display: block; width: 100%; text-align: left; font-size: .8rem; background: rgba(0,0,0,.07); border: 0; border-left: 3px solid #9aa7b5; border-radius: 6px; padding: 3px 8px; margin: 0 0 4px; color: inherit; cursor: pointer; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ch-quote.missing { cursor: default; font-style: italic; color: var(--muted); }
.ch-m.mine .ch-quote { background: rgba(255,255,255,.2); border-left-color: rgba(255,255,255,.7); }
.ch-rxs { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 3px; }
.ch-m.mine .ch-rxs { justify-content: flex-end; }
.ch-rx { border: 1px solid var(--line); background: #fff; border-radius: 99px; padding: 0 8px; font-size: .8rem; line-height: 22px; cursor: pointer; }
.ch-rx.on { background: #e7efff; border-color: var(--primary); }
.ch-rxpick { display: inline-flex; gap: 2px; background: #fff; border: 1px solid var(--line); border-radius: 99px; padding: 2px 6px; margin-top: 3px; box-shadow: 0 2px 8px rgba(0,0,0,.12); }
.ch-rxpick button { border: 0; background: transparent; cursor: pointer; font-size: 1.05rem; padding: 0 3px; }
.ch-m.hl .ch-b { outline: 3px solid #ffd54f; }
.ch-atts { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 2px; }
.ch-atts .ch-file { display: block; }
.ch-edit { width: 100%; min-width: 220px; min-height: 60px; }
.ch-editbtn { margin-top: 4px; }
.ch-pinbox { background: #fff8e1; border: 1px solid #f0dc9a; border-radius: 8px; padding: 4px 10px; margin: 6px 0 0; font-size: .85rem; }
.ch-pinbox summary { cursor: pointer; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ch-pinbox ul { list-style: none; margin: 4px 0; padding: 0; }
.ch-pinbox li { padding: 2px 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ch-jump { text-align: center; padding: 4px 0; }
.ch-typing { min-height: 1.2em; padding: 0 4px; }
.ch-replying { background: #eef1f5; border-left: 3px solid var(--primary); border-radius: 6px; padding: 3px 8px; margin-bottom: 6px; font-size: .85rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ch-chip { margin-right: 4px; }
.ch-thumb { height: 28px; width: 28px; object-fit: cover; border-radius: 4px; vertical-align: middle; }
.ch-main.dropping { outline: 3px dashed var(--primary); outline-offset: -6px; background: #f3f8ff; }
.sr-res { max-height: 50vh; overflow-y: auto; margin-top: 8px; }
.sr-item { display: block; width: 100%; text-align: left; background: #fff; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; padding: 8px 6px; cursor: pointer; }
.sr-item:hover { background: #f1f4f8; }
.sr-item mark { background: #ffe58a; }
@media print { .ch-act { display: none; } }

/* タスク起票 */
.tk-tbl .tk-row { cursor: pointer; }
.tk-tbl .tk-row:hover { background: #f1f4f8; }
.tk-tbl .tk-row.fin { opacity: .65; }
.tk-due { font-size: .85rem; white-space: nowrap; }
.tk-due.soon { color: #b36200; font-weight: 600; }
.tk-due.today { color: #c0392b; font-weight: 700; }
.tk-due.over { color: #fff; background: #c0392b; border-radius: 99px; padding: 1px 8px; font-weight: 600; }
.tk-5w { width: 100%; border-collapse: collapse; margin: 10px 0; }
.tk-5w th { width: 11em; text-align: left; vertical-align: top; background: #f4f6fa; font-weight: 600; font-size: .85rem; padding: 8px 10px; border-bottom: 1px solid var(--line); }
.tk-5w td { padding: 8px 10px; border-bottom: 1px solid var(--line); word-break: break-word; }
.tk-who { list-style: none; margin: 0; padding: 0; } .tk-who li { padding: 2px 0; }
.ch-tasklink { margin-top: 6px; }
@media (max-width: 640px) { .tk-5w th { width: 7em; } }

/* カレンダー */
.cv-bar { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.cv-title { margin: 0 0 0 6px; font-size: 1.15rem; }
.cv-month { border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.cv-dows, .cv-cells { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.cv-dows div { text-align: center; padding: 4px 0; font-size: .8rem; background: #f4f6fa; border-bottom: 1px solid var(--line); }
.cv-dows .sun, .cv-num.sun { color: #c0392b; } .cv-dows .sat { color: #1b4a9c; }
.cv-cell { min-height: 96px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 2px; cursor: pointer; min-width: 0; }
.cv-cell:nth-child(7n) { border-right: 0; }
.cv-cell.out { background: #fafbfc; color: var(--muted); }
.cv-cell.today { position: relative; }
.cv-cell.today::after, .cv-col.today::after, .cv-gh.today::after, .cv-ad.today::after { content: ""; position: absolute; pointer-events: none; z-index: 4; border: 0 solid var(--primary); }
.cv-cell.today::after { inset: 0; border-width: 3px; }
.cv-gh.today, .cv-ad.today { position: relative; }
.cv-gh.today::after { inset: 0; border-width: 3px 3px 0 3px; }
.cv-ad.today::after { inset: 0; border-width: 0 3px; }
.cv-col.today::after { inset: 0; border-width: 0 3px 3px 3px; }
.cv-cell.today .cv-num { background: var(--primary); color: #fff; border-radius: 99px; }
.cv-num { background: none; border: 0; padding: 1px 7px; font-size: .85rem; cursor: pointer; color: inherit; }
.cv-chip { display: block; width: 100%; text-align: left; font-size: .75rem; padding: 1px 5px; margin: 1px 0; border: 0; border-radius: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer; }
.cv-more { display: block; border: 0; background: none; font-size: .72rem; color: var(--muted); cursor: pointer; padding: 0 5px; }
.cv-ev.mine { background: #dbe7ff; color: #14316b; }
.cv-ev.other { background: #d9f2e3; color: #14502f; }
.cv-ev.declined { text-decoration: line-through; opacity: .55; }
.cv-grid { border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.cv-gead, .cv-body { display: grid; grid-template-columns: 3.4em minmax(0, 1fr); }
.cv-gut { font-size: .7rem; color: var(--muted); text-align: right; padding-right: 4px; }
.cv-row { display: grid; min-width: 0; }
.cv-gh { text-align: center; border-left: 1px solid var(--line); background: #f4f6fa; }
.cv-gh.today { background: #e7efff; }
.cv-ad { border-left: 1px solid var(--line); border-bottom: 1px solid var(--line); min-height: 24px; padding: 1px; cursor: pointer; min-width: 0; }
.cv-scroll { max-height: 62vh; overflow-y: auto; }
.cv-hr { box-sizing: border-box; border-top: 1px solid var(--line); font-size: .7rem; color: var(--muted); text-align: right; padding-right: 4px; }
.cv-col { position: relative; border-left: 1px solid var(--line); background-image: linear-gradient(var(--line) 1px, transparent 1px); background-size: 100% 48px; min-width: 0; cursor: pointer; }
.cv-blk { position: absolute; overflow: hidden; border: 0; border-left: 3px solid rgba(0,0,0,.25); border-radius: 4px; font-size: .75rem; text-align: left; padding: 1px 4px; cursor: pointer; line-height: 1.25; }
.cv-loc { opacity: .75; }
.cv-now { position: absolute; left: 0; right: 0; height: 2px; background: #d93025; pointer-events: none; }
.cv-chips { display: flex; flex-wrap: wrap; gap: 4px; margin: 6px 0; }
@media (max-width: 640px) {
  .cv-cell { min-height: 74px; } .cv-chip { font-size: .68rem; padding: 0 3px; } .cv-chip b { display: none; }
  .cv-gead, .cv-body { grid-template-columns: 2.6em minmax(0, 1fr); }
  .cv-grid[style*="--cols:7"] { overflow-x: auto; } .cv-grid[style*="--cols:7"] > * { min-width: 560px; }
}
.cv-embed .cv-scroll { max-height: 340px; }
.cv-embed .cv-title { font-size: 1rem; }
/* 日曜・祝日=薄いピンク、土曜=薄い水色(今日の強調は数字の丸で表す) */
.cv-cell.hol-day, .cv-gh.hol-day, .cv-ad.hol-day, .cv-col.hol-day { background-color: #fbdde2; }
.cv-cell.sat-day, .cv-gh.sat-day, .cv-ad.sat-day, .cv-col.sat-day { background-color: #e8f3fd; }
.cv-gh.today.hol-day { background-color: #f4c3cd; } .cv-gh.today.sat-day { background-color: #d3e8fa; }
.cv-cell.out.hol-day, .cv-cell.out.sat-day { opacity: .75; }
.cv-hol { font-size: .68rem; color: #b3394a; margin-left: 2px; white-space: nowrap; }
.cv-gh .cv-hol { display: block; margin: 0; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 640px) { .cv-cell .cv-hol { display: block; font-size: .6rem; margin: 0; overflow: hidden; text-overflow: ellipsis; } }
.cv-legend { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: .78rem; margin: 0 0 8px; color: var(--muted); }
.cv-legend i, .cv-dot { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 4px; vertical-align: baseline; }
.cat-row { margin-bottom: 6px; } .cat-color { width: 44px; height: 34px; padding: 2px; flex: none; }

/* ---- シフト ---- */
.linklike { background: none; border: 0; padding: 0; color: var(--primary); font: inherit; cursor: pointer; text-align: left; }
.linklike:hover { text-decoration: underline; }
.sh-card { max-width: none; }
.sh-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; margin-bottom: 8px; }
.sh-nav { display: flex; align-items: center; gap: 8px; }
.sh-org-sel { display: flex; align-items: center; gap: 6px; margin: 0; font-size: .9rem; }
.sh-org-sel select { max-width: 260px; }
.sh-tools { margin-left: auto; display: flex; gap: 6px; }
.sh-legend { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: .78rem; color: var(--muted); margin: 6px 0 8px; }
.sh-lg i { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: 4px; vertical-align: -1px; border: 1px solid #0002; }
.sh-pal { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 6px 0; }
.sh-pen { min-width: 40px; padding: 4px 8px; border: 2px solid transparent; border-radius: 6px; color: #222; cursor: pointer; font-size: .85rem; }
.sh-pen.on { border-color: var(--primary); box-shadow: 0 0 0 2px #1f5fbf55; font-weight: 700; }
.sh-wrap { overflow: auto; max-height: 76vh; border: 1px solid var(--line); border-radius: 6px; }
table.sh { border-collapse: separate; border-spacing: 0; font-size: .8rem; background: #fff; }
table.sh th, table.sh td { border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 2px 3px; text-align: center; white-space: nowrap; }
table.sh thead th { position: sticky; background: #f6f8fb; z-index: 3; }
table.sh thead tr:nth-child(1) th { top: 0; } table.sh thead tr:nth-child(2) th { top: 24px; } table.sh thead tr:nth-child(3) th { top: 48px; }
.sh-org, .sh-title, .sh-name { position: sticky; background: #fff; z-index: 2; text-align: left !important; }
table.sh thead .sh-org, table.sh thead .sh-title, table.sh thead .sh-name { z-index: 5; background: #f6f8fb; }
.sh-org { left: 0; min-width: 84px; } .sh-title { left: 84px; min-width: 78px; } .sh-name { left: 162px; min-width: 112px; border-right: 2px solid #c9d1db !important; }
.sh-sub { font-size: .68rem; color: var(--muted); }
.sh-rq-badge { display: inline-block; background: #e8505b; color: #fff; border-radius: 3px; font-size: .65rem; padding: 0 3px; }
.sh-d, .sh-c { min-width: 34px; width: 34px; }
.sh-h { height: 70px; vertical-align: top; padding: 2px 0 !important; } .sh-h span { writing-mode: vertical-rl; color: #d33; font-weight: 700; font-size: .72rem; }
table.sh .hol-day { background-color: #fbdde2; } table.sh .sat-day { background-color: #e8f3fd; }
table.sh th.today { outline: 2px solid var(--primary); outline-offset: -2px; }
.sh-cnt .sh-org, .sh-cnt .sh-title, .sh-cnt .sh-name { background: #fafafa; } .sh-cnt-l { white-space: normal !important; }
.sh-cnt td { background: #fafafa; color: #555; font-size: .75rem; } .sh-cnt td.hol-day { background: #fbdde2; } .sh-cnt td.sat-day { background: #e8f3fd; }
.sh-c { position: relative; height: 34px; line-height: 1.1; } .sh-c b { display: block; font-size: .82rem; } .sh-c small { display: block; font-size: .62rem; color: #333; }
.sh-c.edit { cursor: pointer; } .sh-c.edit:hover { outline: 2px solid var(--primary); outline-offset: -2px; }
.sh-c.has-note::after { content: ''; position: absolute; top: 0; right: 0; border-top: 7px solid #222; border-left: 7px solid transparent; }
.sh-c.rq { box-shadow: inset 0 0 0 2px #e8505b; }
.sh-sum { min-width: 44px; font-weight: 700; } .sh-sum small { font-weight: 400; color: var(--muted); } .sh-sum.warn { color: #c0392b; background: #fff0ee; }
@media (max-width: 720px) {
  .sh-org, .sh-title { display: none; } .sh-name { left: 0; min-width: 92px; max-width: 112px; white-space: normal !important; }
  .sh-name .sh-sub { white-space: normal; }
  .sh-tools { margin-left: 0; }
}
@media print {
  .hd, .ft, .sh-bar, .sh-pal, .sh-card > p { display: none !important; }
  .sh-wrap { max-height: none; overflow: visible; border: 0; } table.sh { font-size: 7pt; } .sh-card { box-shadow: none; padding: 0; }
  .sh-org, .sh-title, .sh-name, table.sh thead th { position: static; }
}
.rq-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; max-width: 520px; }
.rq-dw { text-align: center; font-size: .8rem; padding: 2px 0; border-radius: 4px; }
.rq-dw.hol-day, .rq-day.hol-day { background: #fbdde2; } .rq-dw.sat-day, .rq-day.sat-day { background: #e8f3fd; }
.rq-day { min-height: 54px; border: 1px solid var(--line); border-radius: 8px; background: #fff; cursor: pointer; padding: 2px; display: flex; flex-direction: column; align-items: center; justify-content: center; color: var(--text); }
.rq-day small { font-size: .62rem; line-height: 1.1; color: var(--muted); }
.rq-day.on { background: #e8505b; border-color: #e8505b; color: #fff; } .rq-day.on small { color: #fff; }
.rq-day:disabled { opacity: .35; cursor: not-allowed; }
main:has(.sh-card) { max-width: 1700px; }
.sh-warnchip { font-size: .72rem; font-weight: 400; padding: 0 6px; border-radius: 10px; background: #eef1f5; color: var(--muted); }
.sh-warnchip.bad { background: #ffd0d0; color: #a11; font-weight: 700; } .sh-warnchip.mid { background: #ffe3b3; color: #8a5200; font-weight: 700; }
.sh-cnt td.short { background: #ffc9c9 !important; color: #a11; font-weight: 700; } .sh-cnt td.over { background: #ffe3b3 !important; color: #8a5200; font-weight: 700; }
.sh-dl { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; margin: 6px 0; font-size: .88rem; } .sh-dl label { margin: 0; }
.sh-unsub { font-size: .8rem; color: var(--muted); } .sh-unsub.bad { color: #a11; font-weight: 700; }
.sh-miss { color: #c07000; margin-left: 2px; } .sh-sum small.warn { color: #c0392b; font-weight: 700; } .sh-sum small { display: block; }

/* システム管理のドロップダウン(システム管理者だけ) */
.nav-dd { position: relative; margin-left: auto; }
.nav-dd-btn { background: transparent; border: 0; border-bottom: 3px solid transparent; color: #d6e2ff; padding: 14px 10px; font: inherit; font-size: .92rem; cursor: pointer; border-radius: 0; }
.nav-dd-btn:hover, .nav-dd-btn.on, .nav-dd.open .nav-dd-btn { color: #fff; } .nav-dd-btn.on { border-bottom-color: #7fb0ff; }
.nav-dd-menu { display: none; position: absolute; right: 0; top: 100%; min-width: 190px; background: #fff; border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 6px 20px #0003; padding: 6px 0; z-index: 30; }
.nav-dd.open .nav-dd-menu { display: block; }
.nav .nav-dd-menu a { display: block; color: var(--text); padding: 9px 16px; border-bottom: 0; font-size: .92rem; white-space: nowrap; }
.nav .nav-dd-menu a:hover, .nav .nav-dd-menu a:focus-visible { background: var(--primary) !important; color: #fff !important; text-decoration: none; }
.nav .nav-dd-menu a:not(:hover):not(:focus-visible) { color: var(--text); } .nav .nav-dd-menu a.on:not(:hover):not(:focus-visible) { color: var(--primary); } .nav .nav-dd-menu a.on { background: #e1ebfb; color: var(--primary); font-weight: 700; }
@media (max-width: 720px) {
  .nav-dd { margin-left: 0; } .nav-dd-btn { width: 100%; text-align: left; padding: 13px 4px; border-bottom: 1px solid rgba(255,255,255,.12); font-size: 1rem; }
  .nav-dd-menu { position: static; box-shadow: none; border: 0; border-radius: 0; background: rgba(255,255,255,.08); padding: 0; }
  .nav .nav-dd-menu a, .nav .nav-dd-menu a:not(:hover):not(:focus-visible) { color: #d6e2ff; padding: 12px 4px 12px 22px; border-bottom: 1px solid rgba(255,255,255,.1); } .nav .nav-dd-menu a.on, .nav .nav-dd-menu a.on:not(:hover):not(:focus-visible) { background: rgba(255,255,255,.14); color: #fff; }
  .nav .nav-dd-menu a:hover { background: rgba(255,255,255,.22) !important; }
}

/* スレッド: 会話の右側に重ねて出すパネル(スマホは全面) */
.ch-main { position: relative; }
.ch-thread { position: absolute; top: 0; right: 0; bottom: 0; width: min(420px, 100%); background: #fff; border-left: 1px solid var(--line); box-shadow: -6px 0 18px rgba(0,0,0,.14); display: flex; flex-direction: column; z-index: 6; border-radius: 0 12px 12px 0; overflow: hidden; }
.th-hd { display: flex; align-items: center; gap: 10px; flex: none; padding: 10px 14px; background: #14316b; color: #fff; }
.th-back { display: inline-flex; align-items: center; gap: 4px; padding: 6px 12px 6px 8px; border: 1.5px solid rgba(255,255,255,.85); border-radius: 99px; background: transparent; color: #fff; font-weight: 700; cursor: pointer; white-space: nowrap; }
.th-back:hover { background: rgba(255,255,255,.18); }
.th-back span { font-size: 1.5rem; line-height: .8; }
.th-msgs { flex: 1; min-height: 0; overflow-y: auto; padding: 10px 14px; display: flex; flex-direction: column; gap: 6px; }
.th-root { padding-bottom: 8px; border-bottom: 1px solid var(--line); }
.th-count { text-align: center; margin: 2px 0; }
.th-form { flex: none; display: flex; gap: 8px; align-items: flex-end; padding: 8px 12px; border-top: 1px solid var(--line); }
.th-form textarea { flex: 1; min-height: 38px; max-height: 120px; resize: none; margin: 0; }
.ch-thr { align-self: flex-start; background: #eef3ff; border: 0; border-radius: 99px; color: var(--primary); font-size: .8rem; font-weight: 700; padding: 3px 10px; cursor: pointer; margin-top: 2px; }
.ch-m.mine .ch-thr { align-self: flex-end; }
.ch-thr:hover { background: #dce7ff; }
@media (max-width: 760px) { .ch-thread { width: 100%; border-radius: 12px; } }
/* 幅の狭いチャット(右下のボックス・スマホ)で、長い見出しが枠を押し広げて右端が切れないようにする */
.chat > * { min-width: 0; }
.ch-main, .ch-side { overflow: hidden; }
.ch-hd { min-width: 0; }
.ch-hd .ch-who { flex: 1 1 0; }
.ch-hd > * { flex-shrink: 0; } .ch-hd > .ch-who { flex-shrink: 1; }
.ch-form, .ch-in { min-width: 0; } .ch-in textarea { min-width: 0; }

/* 出勤場所の行(期間をまとめて表示) */
.sh-loc td { height: 20px; padding: 0 3px; font-size: .72rem; }
.sh-loc .sh-name, .sh-loc .sh-org, .sh-loc .sh-title { background: #f4faf5; }
.sh-loc-c { max-width: 0; overflow: hidden; text-overflow: ellipsis; background: #dff1e3; color: #1b5e20; font-weight: 700; border-left: 2px solid #5fae72 !important; }
.sh-loc-e { background: #fafafa; }
.sh-locbtn { background: #eef6ef; border: 1px solid #b9dcc0; border-radius: 99px; color: #1b5e20; font-size: .68rem; padding: 0 6px; cursor: pointer; }
@media print { .sh-locbtn { display: none; } }
/* スマホ: タスク一覧は表をやめ、1件ずつカードで見せる(件名が1文字ずつ縦に折れないように) */
@media (max-width: 640px) {
  .tk-tbl, .tk-tbl tbody { display: block; width: 100%; }
  .tk-tbl thead { display: none; }
  .tk-tbl .tk-row { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; padding: 12px 4px; border-bottom: 1px solid var(--line); }
  .tk-tbl .tk-row td { display: block; padding: 0; border: 0; width: auto; }
  .tk-tbl .tk-row td:first-child { flex: 1 0 100%; font-size: 1rem; word-break: break-word; overflow-wrap: anywhere; }
  .tk-tbl .tk-row td:nth-child(3) { color: var(--muted); }
  .tk-tbl .tk-row td:nth-child(4) { margin-left: auto; text-align: right; }
}

/* パンくずリスト */
.crumb { max-width: 1200px; margin: 12px auto -8px; padding: 0 16px; font-size: .82rem; color: var(--muted); }
.crumb ol { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 2px 0; }
.crumb li { display: flex; align-items: center; min-width: 0; }
.crumb li + li::before { content: "›"; margin: 0 8px; color: #9aa6b8; }
.crumb a { color: var(--primary); } .crumb a:hover { text-decoration: underline; }
.crumb [aria-current="page"] { color: var(--text); font-weight: 600; }
@media print { .crumb { display: none; } }

/* マニュアル */
.mn-cats { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.mn-chip { border-radius: 99px; padding: 3px 12px; font-size: .85rem; background: #fff; border: 1px solid var(--line); color: var(--text); cursor: pointer; }
.mn-chip.on { background: var(--primary); border-color: var(--primary); color: #fff; }
a.mn-item { display: block; color: inherit; text-decoration: none; }
a.mn-item:hover { border-color: var(--primary); }
.mn-tb { display: flex; flex-wrap: wrap; gap: 4px; padding: 6px; border: 1px solid var(--line); border-bottom: 0; border-radius: 8px 8px 0 0; background: #f3f6fa; position: sticky; top: 0; z-index: 2; }
.mn-tb button { padding: 4px 9px; font-size: .85rem; }
.mn-ed { min-height: 320px; padding: 14px; border: 1px solid var(--line); border-radius: 0 0 8px 8px; background: #fff; outline: none; }
.mn-ed:focus { border-color: var(--primary); }
.mn-body { line-height: 1.8; overflow-wrap: anywhere; }
.mn-body h2 { font-size: 1.25rem; border-left: 5px solid var(--primary); padding-left: 10px; margin: 1.4em 0 .6em; }
.mn-body h3 { font-size: 1.1rem; border-bottom: 1px solid var(--line); padding-bottom: 3px; margin: 1.2em 0 .5em; }
.mn-body h4 { margin: 1em 0 .4em; }
.mn-body p { margin: .6em 0; }
.mn-body ul, .mn-body ol { padding-left: 1.6em; margin: .6em 0; }
.mn-body blockquote { margin: .8em 0; padding: 6px 14px; border-left: 4px solid var(--line); color: var(--muted); background: #f8fafc; }
.mn-body pre, .mn-body code { background: #f1f3f6; border-radius: 4px; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: .9em; }
.mn-body code { padding: 1px 5px; } .mn-body pre { padding: 10px; overflow: auto; }
.mn-body img { max-width: 100%; height: auto; border: 1px solid var(--line); border-radius: 4px; }
.mn-body table { border-collapse: collapse; max-width: 100%; display: block; overflow-x: auto; margin: .8em 0; }
.mn-body th, .mn-body td { border: 1px solid #cfd6df; padding: 6px 10px; min-width: 70px; vertical-align: top; }
.mn-body th { background: #eef2f7; }
.mn-body hr { border: 0; border-top: 1px solid var(--line); margin: 1.2em 0; }
@media print { .hd, .crumb, .ft, .mn-act, .dock, #chat-dock { display: none !important; } .card { border: 0; padding: 0; } body { background: #fff; } }

/* タスク詳細(5W2H)をスマホで右にはみ出さない: 項目名を上、内容を下に積む */
.tk-5w { width: 100%; table-layout: fixed; }
.tk-5w td { overflow-wrap: anywhere; word-break: break-word; }
@media (max-width: 720px) {
  .tk-5w, .tk-5w tbody, .tk-5w tr, .tk-5w th, .tk-5w td { display: block; width: 100%; }
  .tk-5w tr { border-bottom: 1px solid var(--line); padding: 8px 0; }
  .tk-5w th { padding: 0 0 2px; border: 0; background: none; font-size: .8rem; color: var(--muted); font-weight: 600; white-space: normal; }
  .tk-5w td { padding: 0; border: 0; }
}
.notice .body.mn-body { white-space: normal; }

/* トップページ: 未読チャット・タスク */
.top-ch, .top-tk { list-style: none; margin: 8px 0 0; padding: 0; }
.top-ch li + li, .top-tk li + li { border-top: 1px solid var(--line); }
.top-ch a, .top-tk a { display: flex; align-items: center; gap: 8px 10px; padding: 8px 2px; color: inherit; text-decoration: none; flex-wrap: wrap; }
.top-ch a:hover, .top-tk a:hover { background: #f3f6fa; }
.top-ch .ch-prev { flex: 1 1 140px; min-width: 0; color: var(--muted); font-size: .85rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top-tk .tk-t { flex: 1 1 200px; min-width: 0; display: flex; flex-direction: column; overflow-wrap: anywhere; }

/* ---- フォーム(アンケート・申込) ---- */
.nav-badge { display: inline-block; margin-left: 5px; min-width: 18px; padding: 0 5px; border-radius: 99px; background: #e5484d; color: #fff; font-size: .72rem; line-height: 18px; text-align: center; vertical-align: 1px; }
.nav-badge[hidden] { display: none; }
.fm-tabs { display: flex; gap: 4px; margin: 12px 0 8px; border-bottom: 1px solid #dfe4ea; flex-wrap: wrap; }
.fm-tabs button { border: 0; border-bottom: 3px solid transparent; border-radius: 0; background: none; padding: 8px 14px; }
.fm-tabs button.on { border-bottom-color: var(--primary, #1a56c7); font-weight: 700; }
.fm-rows { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; }
.fm-row { display: block; border: 1px solid #dfe4ea; border-radius: 9px; padding: 10px 12px; color: var(--text); background: #fff; }
a.fm-row:hover { background: #f5f8fc; text-decoration: none; }
.fm-row.un { border-left: 5px solid #e5484d; background: #fff9f8; }
.fm-rt { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.fm-meta { margin: 6px 0; display: flex; gap: 6px; flex-wrap: wrap; }
.fm-dl { display: grid; grid-template-columns: minmax(8em, 14em) 1fr; gap: 6px 14px; margin: 12px 0; }
.fm-dl dt { font-weight: 600; color: var(--muted); }
.fm-dl dd { margin: 0; overflow-wrap: anywhere; }
.fm-shot { max-width: 220px; max-height: 220px; border-radius: 6px; border: 1px solid #dfe4ea; margin: 0 8px 8px 0; }
/* 回答画面 */
.fm-wrap { min-height: 100vh; padding: 20px 14px 60px; background: #eef2f7; }
.fm-pubcard { max-width: 680px; margin: 0 auto; }
.fm-pub h2 { margin-top: 0; }
.fm-desc { white-space: normal; }
.fm-prog { position: sticky; top: 0; z-index: 3; background: #fff; padding: 8px 0 6px; margin-bottom: 8px; border-bottom: 1px solid #edf0f4; }
.fm-bar { height: 8px; background: #e5e9ef; border-radius: 99px; overflow: hidden; margin-top: 4px; }
.fm-bar > div { height: 100%; width: 0; background: #2f9e6a; transition: width .25s; }
.fm-f { margin: 16px 0; }
.fm-q { font-weight: 700; display: block; margin-bottom: 4px; }
.fm-req { display: inline-block; font-size: .7rem; font-weight: 600; color: #fff; background: #d9480f; border-radius: 4px; padding: 0 5px; vertical-align: 1px; }
.fm-help { margin: -2px 0 6px; }
.fm-opts { display: flex; flex-direction: column; gap: 6px; }
.fm-f input[type=text], .fm-f input[type=number], .fm-f input[type=date], .fm-f input[type=tel], .fm-f input[type=email], .fm-f select, .fm-f textarea { width: 100%; max-width: 100%; }
.fm-err { color: #b42318; font-size: .85rem; min-height: 0; margin-top: 3px; }
.fm-sec { border-top: 2px solid #dfe4ea; padding-top: 14px; margin-top: 26px; }
.fm-sec h3 { margin: 0 0 4px; }
.fm-note { background: #f3f6fa; border-radius: 8px; padding: 10px 12px; }
.fm-hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.fm-ths { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 8px; }
.fm-th { width: 140px; border: 1px solid #dfe4ea; border-radius: 8px; padding: 6px; display: flex; flex-direction: column; gap: 4px; background: #fff; }
.fm-th img { width: 100%; height: 100px; object-fit: cover; border-radius: 5px; }
.fm-th-ph { height: 100px; border-radius: 5px; background: #eef1f5; }
.fm-bad { color: #b42318; }
.fm-pvbar { margin-top: 0; }
.fm-dlg { min-width: 0; }
dialog:has(.fm-dlg) { width: min(760px, 96vw); }
/* ビルダー */
.fm-build { display: grid; grid-template-columns: 210px 1fr; gap: 14px; align-items: start; }
.fm-pal { position: sticky; top: 8px; margin: 0; }
.fm-pal h3 { margin: 0 0 4px; font-size: 1rem; }
.fm-pg { margin: 10px 0 4px; }
.fm-pgs { display: flex; flex-direction: column; gap: 5px; }
.fm-pi { display: flex; align-items: center; gap: 8px; text-align: left; cursor: grab; padding: 6px 10px; }
.fm-pi span { width: 2.2em; text-align: center; color: var(--primary, #1a56c7); font-weight: 700; }
.fm-canvas { margin: 0; min-width: 0; }
.fm-list { display: flex; flex-direction: column; gap: 8px; margin-top: 14px; min-height: 90px; padding: 6px; border-radius: 10px; }
.fm-list.over { background: #f0f6ff; outline: 2px dashed #7fb0ff; }
.fm-empty { border: 2px dashed #c3ccd8; border-radius: 10px; padding: 28px 10px; text-align: center; color: var(--muted); }
.fm-drop { border: 2px dashed #2f6fe0; background: #e8f0ff; color: #2f6fe0; border-radius: 8px; text-align: center; padding: 8px; font-size: .85rem; }
.fm-card { border: 1px solid #d3dae3; border-radius: 10px; background: #fff; }
.fm-card.sel { border-color: #2f6fe0; box-shadow: 0 0 0 2px #cfe0ff; }
.fm-card.in { margin-left: 18px; }
.fm-card.t-section { background: #f3f6fa; border-left: 5px solid #2f6fe0; }
.fm-card.dragging { opacity: .4; }
.fm-hd { display: flex; align-items: center; gap: 8px; padding: 8px 10px; cursor: pointer; flex-wrap: wrap; }
.fm-grip { cursor: grab; color: #8a97a8; padding: 2px 4px; user-select: none; letter-spacing: -2px; }
.fm-ty { width: 2em; text-align: center; color: var(--primary, #1a56c7); font-weight: 700; }
.fm-lb { font-weight: 600; flex: 1; min-width: 6em; overflow-wrap: anywhere; }
.fm-ops { display: flex; gap: 4px; margin-left: auto; }
.fm-edit { padding: 4px 12px 12px; border-top: 1px solid #edf0f4; }
.fm-in { display: inline-flex; flex-direction: column; gap: 2px; font-size: .85rem; color: var(--muted); }
.fm-condbox { margin-top: 12px; padding: 10px; background: #fafbfd; border: 1px dashed #c9d1da; border-radius: 8px; }
.fm-cond { margin-top: 8px; display: flex; flex-direction: column; gap: 6px; }
.fm-rule select, .fm-rule input { max-width: 100%; }
.fm-ind { margin: 6px 0 6px 22px; display: flex; flex-direction: column; gap: 6px; }
.fm-prm { border: 1px solid #dfe4ea; border-radius: 8px; padding: 8px; margin-bottom: 8px; }
.fm-mk { margin-top: 8px; padding: 8px; background: #f6f8fb; border-radius: 8px; }
.fm-chips { margin-bottom: 4px; }
@media (max-width: 720px) {
  .fm-build { grid-template-columns: 1fr; }
  .fm-pal { position: static; }
  .fm-pgs { flex-direction: row; flex-wrap: wrap; }
  .fm-card.in { margin-left: 8px; }
  .fm-tn { display: none; }
  .fm-dl { grid-template-columns: 1fr; }
  .fm-dl dt { margin-top: 6px; }
  .fm-wrap { padding: 8px 8px 60px; }
}

/* Next CRM: ポータルと見分けがつくよう、ヘッダーの色を変える */
.hd { background: var(--hd); }
.hd .nav a.on, .nav-dd-btn.on { border-bottom-color: #6fd3e0; }
.login h1 { color: #0b4f5c; }

/* 移行用 > 照合用 */
.mg-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0; }
.mg-tabs a { padding: 7px 14px; border: 1.5px solid var(--line); border-radius: 99px; color: var(--text); font-weight: 700; font-size: .9rem; background: #fff; }
.mg-tabs a:hover { text-decoration: none; background: #f1f4f8; } .mg-tabs a.on { background: var(--primary); border-color: var(--primary); color: #fff; }
.mg-quick { border: 1px dashed #9cb8e6; background: #f8faff; border-radius: 8px; padding: 10px 12px; margin-top: 8px; }
.mg-qh { font-weight: 700; font-size: .88rem; margin-bottom: 6px; } .mg-qf { display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-end; } .mg-qf label { margin: 0; flex: 1 1 180px; font-size: .82rem; }
.mg-tbl td, .mg-tbl th { white-space: nowrap; } .mg-act { text-align: left; } .mg-act button { padding: 4px 10px; margin-left: 4px; }
.badge.warn { background: #fff0d6; color: #8a5200; }
.nav-dd-grp { padding: 8px 16px 2px; font-size: .75rem; font-weight: 700; color: var(--muted); }
.nav .nav-dd-menu a.nav-dd-sub { padding-left: 30px; }
@media (max-width: 720px) { .nav-dd-grp { color: #9fb4e6; padding: 10px 4px 2px 22px; } .nav .nav-dd-menu a.nav-dd-sub { padding-left: 38px; } }
/* 右下のチャットボックスに埋め込む、ポータルのチャット */
.cd-frame { display: block; width: 100%; height: 100%; border: 0; background: #fff; }

/* ヘッダーのボタン(チャット・メニュー)は、スマホで触れても背景が白くならないようにする(白い線・アイコンが見えなくなるため) */
.hd-chat, .hd-chat:hover, .hd-chat:active, .hd-chat:focus, .menu-btn:hover, .menu-btn:active, .menu-btn:focus { background: transparent; border: 0; padding: 0; }
.menu-btn:hover, .menu-btn:active, .menu-btn:focus { padding: 0 10px; }
.hd-chat:active, .menu-btn:active { background: rgba(255, 255, 255, .18); }

/* ホーム画面に追加の帯(スマホだけ。ヘッダー直下・赤系) */
.inst-band { display: none; }
@media (max-width: 720px) {
  .inst-band { display: flex; align-items: center; gap: 8px; padding: 8px 10px 8px 14px; background: #c62f3b; color: #fff; font-size: .86rem; line-height: 1.35; }
  .inst-tx { flex: 1; min-width: 0; }
  .inst-btn, .inst-btn:hover { flex: none; padding: 7px 12px; border: 0; border-radius: 7px; background: #fff; color: #a61e2a; font-weight: 700; font-size: .86rem; }
  .inst-x, .inst-x:hover { flex: none; width: 30px; height: 30px; padding: 0; border: 0; border-radius: 50%; background: transparent; color: #fff; font-size: 1.3rem; line-height: 1; }
}
.inst-page .inst-os { margin: 10px 0; border: 1px solid #d8dee6; border-radius: 8px; padding: 8px 12px; }
.inst-page summary { font-weight: 700; cursor: pointer; }
.inst-page ol { margin: 8px 0 4px; padding-left: 1.3em; line-height: 1.8; }

/* スマホ・タブレット(iPhone/iPad など)は、入力欄の文字が16px未満だと、触れたときに画面が勝手に拡大される。全ての入力欄を16pxにして防ぐ(ログイン画面も含む) */
@media (max-width: 800px), (hover: none) and (pointer: coarse) {
  input:not([type=checkbox]):not([type=radio]):not([type=range]):not([type=file]):not([type=button]):not([type=submit]), select, textarea { font-size: 16px; }
}

/* サンクスページ */
.fm-thanks{text-align:center;padding:24px 12px}
.fm-thanks-ic{width:56px;height:56px;border-radius:50%;background:#e6f4ea;color:#1e7e34;font-size:30px;line-height:56px;margin:0 auto 12px}
.fm-thanks h2{margin:0 0 8px}
.fm-thanks p{margin:6px 0;line-height:1.7}
.fm-thanks-btn{display:inline-block;margin-top:8px;padding:10px 20px;border-radius:8px;background:#1a56db;color:#fff;text-decoration:none}

/* プライバシーポリシー(回答画面) */
.fm-pp{margin:16px 0;padding:12px;border:1px solid var(--line,#d0d7de);border-radius:8px;background:#fafbfc}
.fm-pp-body{max-height:200px;overflow:auto;margin:8px 0;padding:8px;background:#fff;border:1px solid var(--line,#d0d7de);border-radius:6px;font-size:13px;line-height:1.7;white-space:normal}

.fm-term{margin:8px 0}
.fm-term-body{margin:12px 0;padding:12px;border:1px solid var(--line,#d0d7de);border-radius:8px;background:#fff;line-height:1.8;font-size:14px}
.mst-res { display: inline-block; margin: 2px 8px 2px 0; white-space: nowrap; } .mst-resc { white-space: normal !important; min-width: 16em; }
.mst-rs { margin: 10px 0; } .mst-r { margin: 4px 0; align-items: center; } .mst-r select { width: auto; }
.aff { border: 1px solid var(--line, #d8dde6); border-radius: 8px; margin: 10px 0; padding: 6px 12px 10px; } .aff legend { font-size: 13px; padding: 0 6px; }
/* スマホではみ出さない: 選択欄・入力欄は画面幅まで。カードの中身が広がっても、ページ全体は広げない */
select, input, textarea { max-width: 100%; } .card { min-width: 0; } .u-basis { width: auto; max-width: 100%; }
@media (max-width: 720px) {
  .u-basis { width: 100%; }
  /* スタッフの一覧: 横に長い表をやめ、1人ずつのカード(ラベル: 値)にする */
  .stf-tbl, .stf-tbl tbody, .stf-tbl tr, .stf-tbl td { display: block; width: 100%; }
  .stf-tbl thead { display: none; }
  .stf-tbl tr { border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; margin: 10px 0; }
  .stf-tbl td { border: 0; padding: 3px 0; display: grid; grid-template-columns: 6em 1fr; gap: 8px; word-break: break-all; }
  .stf-tbl td::before { content: attr(data-l); color: var(--muted); font-size: .85rem; }
  .stf-tbl td[data-l="氏名"] { font-weight: 600; font-size: 1.05rem; }
}

/* スマホの操作: 引っ張って更新 / 端からのスワイプで戻る・進む(gestures.js) */
body { overscroll-behavior-y: contain; }
.g-ptr { position: fixed; left: 50%; top: calc(env(safe-area-inset-top, 0px) + 56px); transform: translate(-50%, -40px); z-index: 90; display: flex; align-items: center; gap: 8px; background: var(--card); color: var(--text); border: 1px solid var(--line); border-radius: 999px; padding: 6px 14px; font-size: .85rem; box-shadow: 0 4px 14px rgba(0,0,0,.15); opacity: 0; pointer-events: none; transition: opacity .15s; }
.g-ptr.on { opacity: 1; } .g-ptr-i { width: 14px; height: 14px; border: 2px solid var(--primary); border-top-color: transparent; border-radius: 50%; } .g-ptr.ready .g-ptr-i { background: var(--primary); } .g-ptr.busy .g-ptr-i { animation: g-spin .7s linear infinite; } .g-ptr.busy { transition: transform .15s, opacity .15s; }
@keyframes g-spin { to { transform: rotate(360deg); } }
.g-sw { position: fixed; top: 50%; width: 36px; height: 56px; margin-top: -28px; z-index: 90; display: none; align-items: center; justify-content: center; background: rgba(20,30,45,.7); color: #fff; font-size: 28px; line-height: 1; pointer-events: none; }
.g-sw.on { display: flex; } .g-sw-l { left: 0; border-radius: 0 28px 28px 0; } .g-sw-r { right: 0; border-radius: 28px 0 0 28px; }
@media print { .g-ptr, .g-sw { display: none !important; } }

/* 広告費・送客費 */
.cs-hd{display:flex;flex-wrap:wrap;gap:8px;align-items:baseline;justify-content:space-between;margin-bottom:8px}
.cs-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(150px,1fr));gap:8px;margin-bottom:8px}
.cs-f{display:flex;flex-direction:column;gap:2px;font-size:.85rem}
.cs-f input{width:100%;min-width:0}
.cs-sum{margin:8px 0}
.cs-resrow{display:flex;flex-wrap:wrap;align-items:baseline;gap:4px 12px;padding:6px 0;border-bottom:1px solid var(--line,#e5e7eb)}
.cs-reslbl{min-width:6em;font-weight:600}
.cs-resamt{min-width:7em;text-align:right}
.cs-shares{display:flex;flex-wrap:wrap;gap:2px 12px;font-size:.85em;color:var(--muted,#6b7280)}
.cs-restotal{border-bottom:0}
.cs-bars{display:grid;gap:8px;margin:6px 0}
.cs-barrow{display:grid;grid-template-columns:8em 1fr;gap:2px 10px;align-items:center}
.cs-barname{font-weight:600;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.cs-bar{height:16px;border-radius:8px;background:var(--line,#e5e7eb);overflow:hidden}
.cs-bar i{display:block;height:100%;width:0;border-radius:8px;background:#16a34a;transition:width .3s}
.cs-bar.warn i{background:#f59e0b}
.cs-bar.over i{background:#dc2626}
.cs-bartxt{grid-column:2;color:var(--muted,#6b7280)}
.cs-barall{border-top:1px solid var(--line,#e5e7eb);padding-top:8px}
@media(max-width:600px){.cs-barrow{grid-template-columns:1fr}.cs-bartxt{grid-column:1}}
.cs-barrow[hidden]{display:none}
.cs-sumtbl tr.cs-tot td{background:var(--soft,#f6f7f9);border-top:2px solid var(--line,#e5e7eb)}
.cs-sumtbl tr.cs-sub td{font-size:.92em;color:var(--muted,#4b5563)}
.cs-sumtbl tr.cs-sub td:first-child{padding-left:1.4em}
.cs-dm{font-size:1em}
.cs-dgrid{display:grid;grid-template-columns:11em 1fr;gap:6px 12px}
.cs-dk{color:var(--muted,#6b7280);font-size:.88em}
.cs-dv{word-break:break-all}
.cs-dq{margin:8px 0;padding:8px 12px;border-left:3px solid var(--primary,#1f5fbf);background:var(--soft,#f6f7f9)}
.cs-da{font-size:1.2em;font-weight:600;word-break:break-all}
@media(max-width:600px){.cs-dgrid{grid-template-columns:1fr;gap:0}.cs-dv{margin-bottom:6px}}
.cs-no{font-family:ui-monospace,Menlo,Consolas,monospace;white-space:nowrap}
a.cs-duphit{cursor:pointer;text-decoration:underline dotted}
a.badge.cs-duphit{text-decoration:none}
button.warn{background:#fff0d6;color:#8a5200;border-color:#e6c68a}
details.cs-acc{border:1px solid #e3e7ec;border-radius:8px;margin:8px 0;background:#fff}
details.cs-acc>summary{cursor:pointer;padding:10px 12px;list-style:none}
details.cs-acc>summary::-webkit-details-marker{display:none}
details.cs-acc>summary::before{content:"▶";display:inline-block;margin-right:8px;font-size:.75em;color:#667;transition:transform .15s}
details.cs-acc[open]>summary::before{transform:rotate(90deg)}
details.cs-acc>.tbl-wrap{padding:0 12px 10px}
table.cs-quota{table-layout:fixed;width:100%}
table.cs-quota th:nth-child(1),table.cs-quota td:nth-child(1){width:40%}
table.cs-quota th:nth-child(n+2),table.cs-quota td:nth-child(n+2){width:20%;text-align:right}
/* 案件一覧: コンテンツ幅の中に、全項目を収める(列の幅を割り当て、長い文字は折り返す) */
.cs-list .tbl-wrap { overflow-x: visible; }
table.cs-tbl { table-layout: fixed; width: 100%; font-size: .8rem; }
table.cs-tbl th, table.cs-tbl td { padding: 6px 4px; overflow-wrap: anywhere; word-break: break-word; vertical-align: top; }
table.cs-tbl .c-sel { width: 3%; } table.cs-tbl .c-no { width: 9%; } table.cs-tbl .c-st { width: 10%; } table.cs-tbl .c-at { width: 9%; }
table.cs-tbl .c-src { width: 13%; } table.cs-tbl .c-nm { width: 11%; } table.cs-tbl .c-kn { width: 10%; }
table.cs-tbl .c-tel { width: 10%; } table.cs-tbl .c-pf { width: 7%; } table.cs-tbl .c-bt { width: 6%; } table.cs-tbl .c-dp { width: 8%; }
table.cs-tbl td .badge { white-space: normal; }
table.cs-tbl td button.sm { padding: 2px 6px; font-size: .75rem; }
table.cs-tbl td select { max-width: 100%; }
.cs-fl { display: inline-flex; align-items: center; gap: 4px; font-size: .85rem; }
.cs-pager { flex-wrap: wrap; gap: 4px; }
.nt-row { border: 1px solid var(--line, #e3e7ec); border-radius: 8px; padding: 10px 12px; margin: 8px 0; background: #fff; }
.nt-row.un { border-color: #e6b45e; background: #fffaf0; }
.nt-h { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.nt-t { margin-left: auto; }
.nt-b { display: flex; flex-wrap: wrap; gap: 4px 16px; margin: 6px 0; font-size: .9rem; }
table.cs-tbl th { white-space: normal; line-height: 1.25; }
table.cs-tbl td .badge { display: inline-block; max-width: 100%; box-sizing: border-box; overflow-wrap: anywhere; white-space: normal; margin-top: 2px; }
table.cs-tbl td, table.cs-tbl th { overflow: hidden; }
/* 案件一覧の絞り込み: 見出しの下に、項目ごとの入力欄(スマホでは見出しが無いので、上にまとめて出す) */
.cs-frow th { padding: 2px 3px 6px; font-weight: normal; background: transparent; text-transform: none; }
.cs-frow input, .cs-frow select { width: 100%; min-width: 0; box-sizing: border-box; font-size: .75rem; padding: 3px 4px; height: auto; }
.cs-frow .c-atf input[type="date"] { margin-top: 2px; }
.cs-sortable { cursor: pointer; user-select: none; }
.cs-sortable:hover { background: #eaf0f7; }
.cs-sortable .cs-sm { margin-left: 4px; font-size: .75em; color: #0b4f5c; }
.cs-sortable .cs-sm.off { color: #9aa7b4; }
.cs-search { display: inline-flex; gap: 4px; flex: 1 1 18em; max-width: 34em; }
.cs-search input { flex: 1; min-width: 0; }
.cs-fbar { display: none; }

/* 詳細: 対応店舗・お名前・電話番号だけ太字。あとは同じ大きさ・同じ太さで、場所を取らない */
.cs-dgrid{gap:3px 12px}
.cs-dv.cs-b{font-weight:700}
.cs-sec{grid-column:1/-1;margin-top:6px;padding-top:4px;border-top:1px solid var(--line,#e3e7ec);color:var(--muted,#6b7280);font-size:inherit;font-weight:normal}
.cs-dv.cs-wide{grid-column:1/-1}
.cs-dgrid .cs-dk{font-size:inherit}
.cs-dtop{margin:0 0 8px}
@media(max-width:600px){.cs-dgrid{gap:0}.cs-dv.cs-b{margin-bottom:6px}}

.cs-dl { display: none; }
.cs-fbar { display: none; }
/* スマホ(720px以下): 案件の一覧は、横に長い表をやめて、1件ずつのカードにする。絞り込みは、表の上の「絞り込み」(開閉)にまとめる */
@media (max-width: 720px) {
  .cs-dl { display: block; font-size: .75rem; color: var(--muted, #6b7280); }
  .cs-search { flex: 1 1 100%; max-width: none; }
  .cs-pager button { min-width: 2.2em; }
  table.cs-tbl, table.cs-tbl tbody { display: block; width: 100%; table-layout: auto; }
  table.cs-tbl thead { display: none; }
  table.cs-tbl tr { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 2px 0; border: 1px solid var(--line, #e3e7ec); border-radius: 10px; padding: 8px 12px; margin: 10px 0; background: #fff; }
  /* スマホのカード: 管理番号・源泉 / 対応店舗・問い合わせ日時 / お名前・電話番号 の3段(2列)。ほかの項目は「詳細」の中 */
  table.cs-tbl td { display: block; width: 50%; border: 0; padding: 4px 0; overflow: visible; min-width: 0; font-size: .92rem; box-sizing: border-box; padding-right: 8px; }
  table.cs-tbl td::before { content: attr(data-l); display: block; color: var(--muted, #6b7280); font-size: .75rem; font-weight: normal; line-height: 1.3; }
  table.cs-tbl tr { position: relative; }
  table.cs-tbl td[data-l="選択"] { position: absolute; top: 8px; right: 10px; width: auto; padding: 0; }
  table.cs-tbl td[data-l="選択"]::before { content: none; }
  table.cs-tbl td[data-l="店舗"]::before { content: "対応店舗"; }
  table.cs-tbl td[data-l="源泉"] { padding-right: 34px; }
  table.cs-tbl td[data-l="店舗"]:has(select) { width: 100%; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; }
  table.cs-tbl td[data-l="店舗"]:has(select)::before { flex: 0 0 100%; }
  table.cs-tbl td[data-l="店舗"] select { flex: 1 1 9em; width: auto; min-width: 0; max-width: 100%; margin: 0; font-weight: 400; }
  table.cs-tbl td[data-l="フリガナ"], table.cs-tbl td[data-l="都道府県"] { display: none; }
  table.cs-tbl td:empty { display: none; }
  table.cs-tbl td[data-l="選択"] { order: 0; }
  table.cs-tbl td[data-l="管理番号"] { order: 1; }
  table.cs-tbl td[data-l="源泉"] { order: 2; }
  table.cs-tbl td[data-l="店舗"] { order: 3; font-weight: 700; }
  table.cs-tbl td[data-l="問い合わせ日時"] { order: 4; }
  table.cs-tbl td[data-l="お名前"] { order: 5; font-weight: 700; }
  table.cs-tbl td[data-l="電話番号"] { order: 6; font-weight: 700; }
  table.cs-tbl td[data-l="詳細"], table.cs-tbl td[data-l="重複"], table.cs-tbl td[data-l="削除"] { order: 9; display: block; width: auto; margin: 6px 8px 0 0; padding: 0; }
  table.cs-tbl td[data-l="詳細"]::before, table.cs-tbl td[data-l="重複"]::before, table.cs-tbl td[data-l="削除"]::before { content: none; }
  table.cs-tbl td[data-l="詳細"] button, table.cs-tbl td[data-l="重複"] button, table.cs-tbl td[data-l="削除"] button { padding: 8px 14px; font-size: .9rem; }
  table.cs-tbl td[data-l="源泉"] .badge { margin: 2px 4px 0 0; }
  /* 割り振り状況の店舗別の表は、数字が4つなので、そのまま表で見せる(幅いっぱい) */
  table.cs-quota { font-size: .88rem; }
  table.cs-quota th, table.cs-quota td { padding: 6px 4px; }
  table.cs-quota th:nth-child(1), table.cs-quota td:nth-child(1) { width: 34%; }
  table.cs-quota th:nth-child(n+2), table.cs-quota td:nth-child(n+2) { width: 22%; }
  .nt-t { margin-left: 0; width: 100%; }
}

/* 営業スタッフの案件一覧(見るだけ) */
.cs-ro th.c-sel, .cs-ro td[data-l="選択"], .cs-ro td[data-l="削除"], .cs-ro thead th:last-child { display: none; }
.cs-newbar { display: flex; align-items: center; justify-content: space-between; gap: 10px; background: #fff7e0; border: 1px solid #f0d58c; color: #6b4e00; border-radius: 10px; padding: 10px 14px; margin: 0 0 10px; font-weight: 600; }
.cs-newbar[hidden] { display: none; }

/* 詳細の上のボタン(架電・審査提出・審査結果) */
.cs-acts { display: flex; gap: 8px; margin: 0 0 10px; }
.cs-acts .cs-act { flex: 1 1 0; min-width: 0; padding: 10px 4px; font-size: .95rem; font-weight: 700; white-space: nowrap; }

/* LINE誘導リンク(詳細) */
.cs-line { margin: 0 0 10px; }
.cs-line .row { flex-wrap: nowrap; gap: 6px; margin-top: 4px; }
.cs-line input { flex: 1 1 auto; min-width: 0; font-size: .8rem; }

.cs-fc { margin: 6px 12px 4px; line-height: 1.6; }

.cs-tel,.cs-mail{color:var(--accent,#2563eb);text-decoration:underline;word-break:break-all}
/* 案件一覧: 1行おきに、薄いみどり色の背景(行を見分けやすく。スマホのカード表示も同じ) */
table.cs-tbl tbody tr:nth-child(even) > td { background: rgba(34,197,94,.10); }
@media(max-width:600px){ table.cs-tbl tbody tr:nth-child(even) { background: rgba(34,197,94,.10); } table.cs-tbl tbody tr:nth-child(even) > td { background: transparent; } }

/* 列の幅を変える取っ手(見出しの右端)。スマホのカード表示では出さない */
table.cs-tbl th { position: relative; }
.cs-rz { position: absolute; top: 0; right: -3px; width: 8px; height: 100%; cursor: col-resize; user-select: none; touch-action: none; z-index: 2; }
.cs-rz:hover, .cs-rz:active { background: rgba(37,99,235,.25); }
@media(max-width:600px){ .cs-rz, .cs-colreset { display: none; } }

/* 案件一覧の見出しと絞り込み欄は、スクロールしても、ヘッダーの下に固定(一覧の上に残る) */
@media(min-width:601px){
  table.cs-tbl thead tr.cs-hrow th { position: sticky; top: var(--cs-top, 0px); background: #f6f8fb; z-index: 6; }
}

/* 案件の一覧: 余白を広げて、見やすく・押しやすく(PC) */
main:has(.cs-list) { max-width: 1500px; }
.cs-list { padding: 22px 24px; }
.cs-list .row { gap: 12px; margin-bottom: 12px; }
.cs-list button.sm { padding: 7px 14px; font-size: .9rem; }
.cs-list input[type=search], .cs-list input[type=date], .cs-list select, .cs-list input[type=text] { padding: 8px 10px; }
@media(min-width:601px){
  table.cs-tbl { font-size: .9rem; line-height: 1.6; }
  table.cs-tbl th, table.cs-tbl td { padding: 14px 12px; }
  table.cs-tbl thead tr.cs-frow th { padding: 10px 12px 6px; background: #fff; }
  table.cs-tbl tbody tr:hover > td { background: rgba(37,99,235,.07); }
  table.cs-tbl td button.sm { padding: 6px 12px; font-size: .85rem; }
  table.cs-tbl td .badge { margin: 2px 2px 2px 0; display: inline-block; }
  .cs-list .tbl-wrap { margin-top: 12px; }
}
button.sm { padding: 5px 11px; }
@media(min-width:601px){
  table.cs-tbl .c-no { width: 9%; } table.cs-tbl .c-st { width: 15%; } table.cs-tbl .c-at { width: 8%; } table.cs-tbl .c-src { width: 10%; } table.cs-tbl .c-nm { width: 11%; }
  table.cs-tbl .c-kn { width: 9%; } table.cs-tbl .c-tel { width: 10%; } table.cs-tbl .c-pf { width: 6%; } table.cs-tbl .c-sel { width: 3%; }
  table.cs-tbl th.c-bt { width: 6%; } table.cs-tbl th.c-dp { width: 9%; } table.cs-tbl th.c-bt:last-child { width: 7%; }
  table.cs-tbl td select { width: 100%; }
  table.cs-tbl td .cs-assign { display: block; margin-top: 6px; }
  table.cs-tbl td .warn { white-space: normal; }
}
@media(min-width:601px){
  table.cs-tbl .c-st { width: 14%; } table.cs-tbl .c-at { width: 9%; }
  table.cs-tbl td select { display: block; margin-top: 6px; }
}

table.cs-tbl tbody tr.cs-rowd { cursor: pointer; }
table.cs-tbl tbody tr.cs-rowd:focus-visible { outline: 2px solid #9cc0ff; outline-offset: -2px; }

/* ダイアログ: 右上の×で閉じる。下のボタン(閉じる・キャンセル・保存など)は、右に寄せる */
/* (dialog の position は、変えない: relative にすると、スマホでモーダルが画面の上に出てしまう) */
.dlg-x { position: absolute; top: 8px; right: 10px; z-index: 5; width: 38px; height: 38px; padding: 0; border: 0; border-radius: 50%; background: transparent; font-size: 1.7rem; line-height: 1; color: var(--muted, #6b7280); cursor: pointer; }
.dlg-x:hover { background: #eef1f5; color: var(--text, #1f2933); }
.dlg-in { padding-top: 48px; }
.dlg-in .row.end, .dlg-in .dlg-ft, .dlg-in form > .row:last-child, .dlg-in > .row:last-child { justify-content: flex-end; }

/* スマホ: カードの中は、お名前の下に電話番号。選択(チェックボックス)と削除ボタンは出さない */
.cs-sortbar { display: none; }
@media (max-width: 720px) {
  .cs-sortbar { display: flex; align-items: center; gap: 6px; margin: 6px 0; }
  .cs-sortbar select { flex: 1; min-width: 0; }
  table.cs-tbl td[data-l="お名前"], table.cs-tbl td[data-l="電話番号"] { width: 100%; }
  table.cs-tbl td[data-l="選択"], table.cs-tbl td[data-l="削除"], .cs-bulk { display: none !important; }
}

/* スマホ: メニューを開いたとき、項目が画面より多くても、メニューの中でスクロールして、最後(システム管理の中)まで選べる */
@media (max-width: 720px) {
  .hd.menu-open { max-height: 100vh; max-height: 100dvh; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
  .hd.menu-open .hd-in { padding-bottom: 24px; }
}

/* スマホ: 案件一覧が、横にずれて動かないようにする(はみ出した分は、切り取る)。カードの余白も、スマホでは狭くして、中身が広く使えるようにする */
@media (max-width: 720px) {
  html, body { overflow-x: clip; max-width: 100%; } /* hiddenだと、ヘッダーの固定(sticky)が効かなくなるので、clipにする */
  main { overflow-x: clip; }
  .cs-list { padding: 14px 12px; max-width: 100%; box-sizing: border-box; overflow-x: hidden; }
  .cs-list .tbl-wrap { overflow-x: hidden; max-width: 100%; }
  table.cs-tbl, table.cs-tbl tbody { max-width: 100%; box-sizing: border-box; }
  table.cs-tbl tr { box-sizing: border-box; max-width: 100%; }
  table.cs-tbl td { min-width: 0; max-width: 100%; overflow-wrap: anywhere; }
  .cs-list .row { gap: 8px; }
  .cs-search { min-width: 0; }
  .cs-search input { min-width: 0; width: 100%; }
}

/* 案件の詳細: 活動のボタン・入力の欄・履歴 */
.cs-acts { flex-wrap: wrap; }
.ac-more { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 10px; }
.ac-panel { border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 12px; margin: 0 0 12px; background: #f8fafc; }
.ac-panel[hidden] { display: none; }
.ac-panel label:not(.chk) { display: block; margin: 6px 0; font-size: .9rem; }
.ac-panel input[type="text"], .ac-panel input[type="datetime-local"], .ac-panel select, .ac-panel textarea { width: 100%; box-sizing: border-box; }
.ac-num { font-size: 1.3rem; margin: 8px 0; letter-spacing: .03em; }
.ac-cr { display: grid; gap: 4px; max-height: 40vh; overflow: auto; margin: 6px 0; }
.ac-hist { display: grid; gap: 6px; margin-bottom: 10px; }
.ac-row { border-left: 3px solid var(--primary); padding: 4px 8px; background: #fff; border-radius: 0 6px 6px 0; }
.ac-row.ac-fixed { border-left-color: var(--warn); }
.ac-h { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; font-size: .9rem; }
.ac-fix { margin-left: auto; opacity: .7; }
.ac-aud audio { width: 100%; max-width: 420px; margin-top: 4px; }
/* PCの案件の詳細(画面遷移): 3分割 左30% 問い合わせ情報 / 中30% 取得情報 / 右40% 履歴。それぞれ別にスクロール */
.cs-pagebar { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.cs-page { display: grid; grid-template-columns: 4fr 4fr minmax(260px, 2fr); gap: 12px; height: calc(100vh - var(--cs-used, 300px)); min-height: 420px; }
.cs-pane { background: #fff; border: 1px solid var(--line, #e5e7eb); border-radius: 10px; padding: 12px 14px; overflow: auto; min-width: 0; }
.cs-ph { margin: 0 0 8px; font-size: 1em; position: sticky; top: -12px; background: #fff; padding: 4px 0; z-index: 1; }
.cs-ph2 { position: static; margin-top: 16px; padding-top: 12px; border-top: 2px solid var(--line, #e5e7eb); }
.cs-pane .cs-dgrid { grid-template-columns: 9em 1fr; }
.cs-imgs { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px; }
.cs-imgs img { width: 100%; height: 110px; object-fit: cover; border-radius: 6px; border: 1px solid var(--line, #e5e7eb); }
.cs-tabs { margin: 10px 0 6px; } .cs-tab.on { background: var(--primary, #2563eb); color: #fff; }
/* 友だち追加・コールセンター対応のカード: ラベルを左、値を右にそろえる(文字の長さで改行位置がずれない) */
.nt-kv { display: grid; grid-template-columns: 9.5em 1fr; gap: 3px 10px; margin: 6px 0; font-size: .9rem; }
.nt-k { color: var(--muted, #6b7280); }
.nt-v { word-break: break-all; overflow-wrap: anywhere; }
/* エルメのトーク(左=お客様、右=こちら) */
.lc-box { margin: 0 0 12px; }
.lc-phone { border: 2px solid #06c755; border-radius: 14px; overflow: hidden; box-shadow: 0 2px 10px rgba(6,199,85,.18); background: #fff; }
.lc-head { display: flex; align-items: center; gap: 8px; background: #06c755; color: #fff; padding: 8px 12px; }
.lc-ttl { font-weight: 700; } .lc-who { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; opacity: .95; }
.lc-mode { font-size: .72rem; background: rgba(255,255,255,.25); border-radius: 999px; padding: 1px 8px; white-space: nowrap; }
.lc-rl { background: #fff; color: #058a3c; border: 0; border-radius: 999px; padding: 3px 12px; font-size: .8rem; cursor: pointer; }
.lc-list { height: min(52vh, 460px); min-height: 220px; overflow: auto; background: #7a9cc6; padding: 10px 8px; display: flex; flex-direction: column; gap: 8px; }
.lc-d { align-self: center; margin: 4px 0; } .lc-d span { background: rgba(0,0,0,.28); color: #fff; font-size: .72rem; border-radius: 999px; padding: 2px 12px; }
.lc-m { max-width: 88%; display: flex; align-items: flex-end; gap: 5px; }
.lc-f { align-self: flex-start; } .lc-o { align-self: flex-end; }
.lc-av { flex: none; width: 32px; height: 32px; border-radius: 50%; background: #e5e7eb; color: #475569; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: .85rem; align-self: flex-start; }
.lc-b { position: relative; padding: 8px 12px; border-radius: 18px; white-space: pre-wrap; word-break: break-word; font-size: .92rem; line-height: 1.45; color: #111; }
.lc-f .lc-b { background: #fff; border-top-left-radius: 4px; } .lc-o .lc-b { background: #8de055; border-top-right-radius: 4px; }
.lc-b img { max-width: 100%; max-height: 180px; border-radius: 8px; display: block; }
.lc-t { flex: none; font-size: .68rem; color: #eef2f7; margin-bottom: 2px; }
.lc-empty { align-self: center; color: #fff; font-size: .85rem; }
.lc-note { background: #f1f5f9; color: #64748b; font-size: .72rem; padding: 3px 10px; }
.lc-send { background: #f8fafc; border-top: 1px solid #e2e8f0; padding: 8px; }
.lc-inp { display: flex; gap: 6px; align-items: flex-end; }
.lc-inp textarea { flex: 1; min-width: 0; box-sizing: border-box; border-radius: 16px; resize: none; }
.lc-go { background: #06c755; color: #fff; border: 0; border-radius: 999px; padding: 8px 16px; font-weight: 700; cursor: pointer; }
.lc-role { display: block; margin-top: 4px; font-size: .8rem; color: #475569; }
.lc-pre { white-space: pre-wrap; background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 8px; padding: 8px; margin: 6px 0; }
.lc-staff { max-height: 300px; overflow: auto; margin: 6px 0; }
/* 新着トークのアイコン(吹き出し+赤い点) */
.cs-new { position: relative; display: inline-flex; vertical-align: middle; color: #16a34a; }
.cs-new-dot { position: absolute; top: -2px; right: -3px; width: 8px; height: 8px; border-radius: 50%; background: #dc2626; border: 1.5px solid #fff; }
.cs-unread { margin: 0 0 8px; }

/* 審査情報(右ペイン・スマホの「審査情報」) */
.sc-top { margin-bottom: 6px; }
.sc-g { margin: 14px 0 6px; padding: 3px 8px; background: #eef2ff; border-left: 4px solid #4f46e5; font-size: .88rem; }
.sc-f { margin: 0 0 8px; } .sc-f label { display: block; font-size: .78rem; color: #475569; margin-bottom: 2px; }
.sc-f input, .sc-f select { width: 100%; box-sizing: border-box; }
.sc-auto { background: #fef9c3 !important; } .sc-tag { background: #fde68a; color: #92400e; border-radius: 999px; padding: 0 6px; font-size: .68rem; }
.sc-lic { display: flex; gap: 4px; } .sc-lic input { flex: 1; min-width: 0; }
.sc-bar { position: sticky; bottom: -12px; background: #fff; padding: 8px 0; display: flex; align-items: center; gap: 8px; border-top: 1px solid #e5e7eb; }
.sc-slot { border: 1px dashed #cbd5e1; border-radius: 8px; padding: 8px; margin: 0 0 8px; } .sc-sl { font-size: .82rem; font-weight: 600; margin-bottom: 4px; }
.sc-doc { margin: 4px 0; font-size: .85rem; word-break: break-all; } .sc-prev img { max-width: 100%; border-radius: 6px; margin-top: 4px; }
.sc-file { cursor: pointer; } .sc-file.busy { opacity: .5; pointer-events: none; }
.sc-label { flex: 1; min-width: 0; }
.sc-f input, .sc-f select { padding: 5px 8px; font-size: .9rem; min-height: 0; }
.cs-chatpane { padding: 8px; } .cs-chatpane .lc-box { margin: 0; } .cs-chatpane .lc-list { height: auto; min-height: 80px; max-height: max(180px, calc((100vh - 330px) * .5)); } /* トーク画面の高さ(以前の6割)。下の入力欄まで、見切れずに入る */
.cs-chatpane .lc-multi .lc-list { max-height: max(140px, calc((100vh - 330px) * .35)); }

/* 案件一覧のヘッダー(表の見出し・絞り込みの行): システム全体のヘッダーと同じ色、文字は白 */
table.cs-tbl thead tr.cs-hrow th, table.cs-tbl thead tr.cs-frow th { background: var(--hd); color: #fff; }
table.cs-tbl thead .cs-sortable:hover { background: #12697a; }
table.cs-tbl thead .cs-sortable .cs-sm { color: #bfe9ef; } table.cs-tbl thead .cs-sortable .cs-sm.off { color: #8cc3cc; }
table.cs-tbl thead tr.cs-frow th label { color: #fff; }

/* トークのタブ(チェックボックスつき) */
.lc-tabs { display: flex; flex-wrap: wrap; gap: 4px 8px; margin: 0 0 4px; }
.lc-tab { display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px 3px 6px; border: 1px solid #cbd5e1; border-radius: 999px; background: #fff; font-size: .8rem; cursor: pointer; }
.lc-tab:has(input:checked) { border-color: #06c755; background: #ecfdf3; font-weight: 600; }
.lc-tab input { margin: 0; }
.lc-tabhint { margin: 0 0 6px; font-size: .72rem; }
.lc-panel + .lc-panel { margin-top: 10px; }
.lc-linkbox { padding: 10px 12px; background: #f8fafc; } .lc-linkbox .row { margin: 4px 0; } .lc-guide { flex: 1; min-width: 0; font-size: .75rem; }
.lc-unlink { background: none; border: 0; color: #b91c1c; text-decoration: underline; cursor: pointer; font-size: .72rem; padding: 0; }
.lc-err { padding: 8px; }
.ly-prev { display: flex; gap: 4px; margin: 8px 0; max-width: 520px; }
.ly-prev span { background: var(--hd, #0b4f5c); color: #fff; border-radius: 4px; padding: 6px 4px; text-align: center; font-size: .85em; min-width: 0; }
.sc-xl { margin: 0 0 8px; }
.sc-pvbox { margin: 8px 0; padding: 8px; border: 1px solid var(--line, #e5e7eb); border-radius: 8px; background: #fafafa; }
.sc-pvt { width: 100%; border-collapse: collapse; font-size: .9em; } .sc-pvt th { width: 9em; text-align: left; font-weight: 600; color: #475569; padding: 3px 6px; border-bottom: 1px solid #e5e7eb; vertical-align: top; } .sc-pvt td { padding: 3px 6px; border-bottom: 1px solid #e5e7eb; word-break: break-all; }

/* 営業ダッシュボード(CRMのデータ版) */
.cd-head { display: flex; flex-wrap: wrap; gap: 10px 18px; align-items: center; justify-content: space-between; padding: 10px 16px; }
.cd-tabs { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.cd-tab { border: 1px solid var(--line); background: #fff; border-radius: 99px; padding: 3px 14px; cursor: pointer; font-size: .85rem; }
.cd-tab.on { background: #2563eb; border-color: #2563eb; color: #fff; }
.cd-ctl { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; } .cd-ctl label { margin: 0; }
.cd-kpis { display: flex; flex-direction: column; gap: 10px; margin-bottom: 10px; }
.cd-krow { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px; } /* 3行: 反響・案件化 / 架電〜商談アポ / 商談・成約 */
@media (max-width: 900px) { .cd-krow { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.cd-ctl .cd-pr { display: flex; align-items: center; gap: 6px; } .cd-ctl input.ie[type="date"] { width: auto; min-width: 0; flex: 1 1 9em; }
@media (max-width: 720px) { .cd-ctl { gap: 8px 10px; } .cd-ctl .cd-per { flex: 1 1 100%; } .cd-ctl .cd-per .cd-pr { width: 100%; } }
.cd-kpi { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; }
.cd-kl { font-size: .78rem; color: var(--muted); } .cd-kv { font-size: 1.35rem; font-weight: 700; line-height: 1.3; }
.cd-mom { font-size: .72rem; color: var(--muted); } .cd-mom.up { color: #0f766e; } .cd-mom.down { color: #b45309; }
.cd-rates { font-size: .85rem; margin: 0 0 12px; color: var(--muted); } .cd-rates b { color: var(--text); }
.cd-two { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); gap: 12px; } @media (max-width: 800px) { .cd-two { grid-template-columns: 1fr; } }
.cd-card h3 { margin: 0 0 8px; font-size: .95rem; } .cd-scroll { overflow-x: auto; }
.cd-tbl { border-collapse: collapse; width: 100%; font-size: .85rem; } .cd-tbl th, .cd-tbl td { padding: 4px 8px; border-bottom: 1px solid var(--line); white-space: nowrap; text-align: left; } .cd-tbl th.right, .cd-tbl td.right { text-align: right; }
.cd-tbl .cd-now td { background: #eef4ff; font-weight: 600; }
.cd-fn { display: flex; align-items: center; gap: 8px; margin: 5px 0; font-size: .85rem; } .cd-fl { width: 6.5em; flex: none; } .cd-fv { width: 4em; text-align: right; flex: none; }
.cd-fb { flex: 1; background: #eef1f5; border-radius: 4px; height: 14px; overflow: hidden; } .cd-fb i { display: block; height: 100%; background: #2563eb; }
.cd-days { display: flex; gap: 2px; align-items: flex-end; height: 120px; } .cd-day { flex: 1; display: flex; flex-direction: column; align-items: center; min-width: 0; height: 100%; }
.cd-dbars { flex: 1; display: flex; gap: 1px; align-items: flex-end; width: 100%; } .cd-dbars i { flex: 1; display: block; min-height: 0; } .cd-dbars .a { background: #2563eb; } .cd-dbars .b { background: #c7d2fe; }
.cd-dl { font-size: .62rem; color: var(--muted); }

/* 保証人(審査結果の履歴から開く入力欄) */
.gr-docs { margin: 8px 0; } .gr-slot { margin: 6px 0; padding: 6px 8px; border: 1px solid var(--line, #ddd); border-radius: 6px; } .gr-file { cursor: pointer; } .gr-prev img { max-width: 100%; margin-top: 6px; }

/* フェーズ(今どこか): 未着手=赤っぽい / 着手中=オレンジ(点滅) / 完了=薄いブルー。文字は、どの背景でもコントラスト比 6.9 以上(濃い色の文字)。状態は文字でも書く */
.ph-wrap { margin: 0 0 10px; }
.ph-bar { list-style: none; margin: 0; padding: 0 0 2px; display: flex; flex-wrap: nowrap; overflow-x: auto; }
/* 矢羽(右向きの山形)の形で、手順の流れを見せる */
.ph-bar > .ph { aspect-ratio: auto; overflow: visible; border-radius: 0; --pt: 14px; flex: 1 0 auto; display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center; min-width: 96px; min-height: 46px; padding: 6px calc(var(--pt) + 6px) 6px calc(var(--pt) + 4px); margin-left: calc(4px - var(--pt)); font-size: .82rem; line-height: 1.25;
  clip-path: polygon(0 0, calc(100% - var(--pt)) 0, 100% 50%, calc(100% - var(--pt)) 100%, 0 100%, var(--pt) 50%); }
.ph-bar > .ph:first-child { margin-left: 0; padding-left: 12px; clip-path: polygon(0 0, calc(100% - var(--pt)) 0, 100% 50%, calc(100% - var(--pt)) 100%, 0 100%); }
.ph-l { font-weight: 700; } .ph-l small { font-weight: 400; } .ph-s { font-size: .75rem; }
.ph-todo { background: #fecaca; color: #6e1414; }
.ph-doing { background: #fbbf24; color: #3b2300; animation: ph-blink 1.2s ease-in-out infinite; }
.ph-done { background: #dbeafe; color: #1e3a8a; }
.ph-now { box-shadow: inset 0 -5px 0 #111827; }
@keyframes ph-blink { 0%, 100% { background: #fbbf24; } 50% { background: #fde68a; } }
@media (prefers-reduced-motion: reduce) { .ph-doing { animation: none; } }
.ph-tag { display: inline-block; padding: 1px 6px; margin-bottom: 2px; border-radius: 4px; font-size: .75rem; font-weight: 700; line-height: 1.3; }
.ph-tag.ph-todo { background: #fecaca; color: #6e1414; } .ph-tag.ph-doing { background: #fbbf24; color: #3b2300; } .ph-tag.ph-done { background: #dbeafe; color: #1e3a8a; }
.ph-tag-s { margin-left: 4px; font-weight: 400; }
.cs-nm { display: block; }
/* 履歴: 番号と、ダッシュボードで数える記録の赤い棒 */
.ac-no { font-weight: 700; color: #374151; font-variant-numeric: tabular-nums; }
.ac-row.ac-kpi { border-left: 5px solid #c62828; }
.ac-legend { display: flex; align-items: center; gap: 6px; margin: 0 0 4px; } .ac-sw { display: inline-block; width: 5px; height: 14px; background: #c62828; }

.cs-editwrap { margin: 0 0 10px; } .cs-editgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 6px 10px; margin: 8px 0; } .cs-editgrid input, .cs-editgrid select, .cs-editgrid textarea { width: 100%; box-sizing: border-box; }
/* 案件詳細: 管理者の編集(項目の右の鉛筆)と、取得情報のアコーディオン */
.cs-pen { margin-left: 6px; padding: 0 6px; border: 1px solid transparent; background: transparent; color: #6b7280; cursor: pointer; font-size: 1em; line-height: 1.4; border-radius: 4px; }
.cs-pen:hover, .cs-pen:focus-visible { color: #1d4ed8; border-color: #bfdbfe; background: #eff6ff; }
.cs-inl { display: grid; gap: 6px; } .cs-inl input, .cs-inl select, .cs-inl textarea { width: 100%; box-sizing: border-box; }
details.cs-acc > summary { cursor: pointer; list-style: none; margin: 16px 0 8px; display: flex; align-items: center; gap: 6px; }
details.cs-acc > summary::-webkit-details-marker { display: none; }
details.cs-acc > summary::before { content: '▶'; font-size: .75em; color: #6b7280; transition: transform .15s; }
details.cs-acc[open] > summary::before { transform: rotate(90deg); }

/* 納車待ち案件 */
.dw-row { cursor: pointer; }
.dw-wrap { max-width: none; }
.dw-kvs { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 6px 16px; }
.dw-kv span { display: block; font-size: 12px; color: #6b7280; }
.dw-lane { margin: 14px 0; }
.dw-lane h3 { margin: 0 0 6px; font-size: 16px; }
.dw-cols { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.dw-col { background: #f3f4f6; border-radius: 8px; padding: 8px; min-height: 90px; }
.dw-col h4 { margin: 0 0 6px; font-size: 13px; }
.dw-col.dw-over { outline: 2px dashed #2563eb; background: #eff6ff; }
.dw-card { background: #fff; border: 1px solid #d1d5db; border-radius: 6px; padding: 7px 9px; margin-bottom: 6px; cursor: grab; }
.dw-card.dw-drag { opacity: .5; }
.dw-t { font-weight: 600; font-size: 13px; }
.dw-m { display: flex; justify-content: space-between; gap: 6px; font-size: 12px; color: #4b5563; margin-top: 3px; }
.dw-c { font-size: 12px; margin-top: 2px; }
.dw-cm { border-left: 3px solid #d1d5db; padding: 2px 8px; margin: 6px 0; }
@media (max-width: 720px) { .dw-cols { grid-template-columns: 1fr; } }
/* 成約引継の項目(画面・編集) */
.ho-sec { margin: 18px 0 6px; padding: 5px 10px; background: #e8eef9; border-radius: 4px; font-size: 14px; color: #1e3a8a; }
.ho-wrap .wide { grid-column: 1 / -1; }
.ho-req { font-size: 10px; color: #b91c1c; border: 1px solid #fecaca; border-radius: 3px; padding: 0 3px; }
.ho-opts { border: 0; padding: 0; margin: 0 0 10px; } .ho-opts legend { font-size: 13px; padding: 0; margin-bottom: 2px; }
.ho-opts .inl { display: inline-flex; align-items: center; gap: 4px; margin-right: 14px; font-size: 14px; }
.hof-row { border: 1px solid #e5e7eb; border-radius: 6px; margin-bottom: 6px; background: #fff; }
.hof-row.sec { background: #eef2ff; }
.hof-main { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; padding: 6px 8px; }
.hof-main input[data-k="label"] { flex: 1 1 200px; min-width: 140px; margin: 0; }
.hof-ty { font-size: 11px; color: #6b7280; min-width: 76px; }
.hof-detail { padding: 6px 10px 10px; border-top: 1px dashed #e5e7eb; display: grid; gap: 6px; }

.lo-wrap { display: flex; gap: 16px; align-items: flex-start; flex-wrap: wrap; }
.lo-paper { position: relative; background: #fff; border: 1px solid #94a3b8; box-shadow: 0 2px 8px rgba(0,0,0,.15); flex: none; touch-action: none; overflow: hidden; }
.lo-box { position: absolute; box-sizing: border-box; border: 1px solid #94a3b8; overflow: hidden; cursor: move; padding: 1px 3px; line-height: 1.25; user-select: none; background: rgba(255,255,255,.6); }
.lo-box.on { border-color: #2563eb; outline: 1px solid #2563eb; background: rgba(219,234,254,.5); } .lo-box.bad { border-color: #dc2626; }
.lo-l { display: block; font-size: .7em; color: #6b7280; white-space: nowrap; overflow: hidden; } .lo-v { display: block; }
.lo-rs { position: absolute; right: 0; bottom: 0; width: 10px; height: 10px; background: #2563eb; cursor: nwse-resize; }
.lo-side { flex: 1 1 260px; min-width: 240px; max-width: 360px; } .lo-free { display: flex; flex-wrap: wrap; gap: 4px; } .lo-prop { display: grid; gap: 6px; }

/* 「その他」: マウスを乗せると開く(パソコン)。スマホでは、タップで開く */
.nav-dd.hov { margin-left: 0; } .nav-dd.hov .nav-dd-menu { left: 0; right: auto; }
.nav-more-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #ff5a5f; margin: 0 2px 1px; vertical-align: middle; } .nav-more-dot[hidden] { display: none; }
.nav-dd-menu .nav-badge { margin-left: 6px; }
@media (hover: hover) and (min-width: 721px) { .nav-dd.hov:hover .nav-dd-menu, .nav-dd.hov:focus-within .nav-dd-menu { display: block; } .nav-dd.hov:hover .nav-dd-btn { color: #fff; } }
.nav-dd-menu .nav-dd-grp:first-child { padding-top: 4px; }
.nav-dd-menu .nav-dd-grp:not(:first-child) { border-top: 1px solid var(--line); margin-top: 4px; padding-top: 8px; }
@media (max-width: 720px) { .nav-dd-menu .nav-dd-grp:not(:first-child) { border-top-color: rgba(255,255,255,.15); } }

.wc-list { max-height: 220px; overflow: auto; border: 1px solid var(--line, #dde3ea); border-radius: 6px; padding: 6px 8px; display: grid; gap: 2px; }
.dw-fin { margin: 10px 0; }

/* 源泉・対応店舗の絞り込み(案件一覧・友だち追加)。PCは横に並べ、スマホは1列・全幅・指で押しやすい高さ */
.cs-filters { display: flex; flex-wrap: wrap; align-items: end; gap: 8px 12px; margin: 6px 0 8px; }
.cs-fl { display: grid; gap: 2px; font-size: .8rem; color: var(--muted, #5b6573); min-width: 200px; }
.cs-fl select { width: 100%; min-width: 0; text-overflow: ellipsis; }
.cs-filters .small { align-self: center; }
@media (max-width: 720px) {
  .cs-filters { display: grid; grid-template-columns: 1fr; gap: 8px; }
  .cs-fl { min-width: 0; font-size: .85rem; }
  .cs-fl select { min-height: 44px; font-size: 16px; } /* 16px未満だと、iPhoneで選ぶたびに画面が拡大される */
  .cs-filters .cs-clr { width: 100%; min-height: 40px; }
  #cf-store, #cf-src, #cf-route, #cf-car { min-height: 44px; font-size: 16px; }
}
.cs-f select{width:100%;min-width:0}

/* その場で直接直せる文字(細い入力欄の代わり): ふだんは枠なし。さわると下線と薄い背景が出る */
input.ie, textarea.ie { border: 0; border-bottom: 2px solid transparent; border-radius: 4px; background: transparent; box-shadow: none; padding: 6px 6px; font: inherit; color: inherit; min-width: 0; width: 100%; }
input.ie:hover, textarea.ie:hover { background: #f1f5fb; }
input.ie:focus, textarea.ie:focus { background: #fff; border-bottom-color: var(--primary, #1a56c7); outline: none; }
input.ie::placeholder, textarea.ie::placeholder { color: #98a4b3; }
/* 空のときは、ここに入力できると分かるよう、うすい下線と背景を出す(枠線の細い入力欄は使わない) */
input.ie:placeholder-shown, textarea.ie:placeholder-shown { background: #f4f7fb; border-bottom: 2px dashed #b8c4d6; }
input.ie:placeholder-shown:focus, textarea.ie:placeholder-shown:focus { background: #fff; border-bottom: 2px solid var(--primary, #1a56c7); }
textarea.ie { resize: none; overflow: hidden; line-height: 1.5; display: block; }
.fm-lb-in { flex: 1; min-width: 8em; font-weight: 600; }
.fm-lb-in.big { font-size: 1.1rem; font-weight: 700; }
.ho-chips { display: flex; flex-wrap: wrap; gap: 4px; padding: 0 12px 8px 44px; }
.ho-places { display: flex; flex-wrap: wrap; gap: 4px 16px; margin-top: 6px; }
.ho-matrix th, .ho-matrix td { text-align: center; } .ho-matrix td:first-child, .ho-matrix th:first-child { text-align: left; }
.ho-pv-sec { margin: 14px 0 4px; padding-left: 8px; border-left: 5px solid #2f6fe0; }
.ho-pv-f { margin: 8px 0; } .ho-pv-f input:not([type=checkbox]):not([type=radio]), .ho-pv-f textarea, .ho-pv-f select { width: 100%; }
@media (max-width: 720px) { .ho-chips { padding-left: 12px; } .fm-lb-in { flex-basis: 100%; } .ho-matrix th { font-size: .7rem; } }

/* 表の中の文字入力も、細い枠でなく、その場で直せる文字にする(数値・日付・ファイル・チェックなどは、いままでどおり) */
.mg-tbl td > input:not([type]), .mg-tbl td > input[type=text], .mg-tbl td > input[type=search] { border: 0; border-bottom: 1px dashed #cfd6df; border-radius: 4px; background: transparent; box-shadow: none; padding: 6px 6px; font: inherit; color: inherit; min-width: 0; width: 100%; }
.mg-tbl td > input:not([type]):hover, .mg-tbl td > input[type=text]:hover, .mg-tbl td > input[type=search]:hover { background: #f1f5fb; }
.mg-tbl td > input:not([type]):focus, .mg-tbl td > input[type=text]:focus, .mg-tbl td > input[type=search]:focus { background: #fff; border-bottom: 2px solid var(--primary, #1a56c7); outline: none; }

/* 返信案(AI)のカード: 右ペイン「返信サポート」と、未紐付けのLINEで共通 */
.lc-sg { background: #f0fdf4; border-bottom: 1px solid #bbf7d0; padding: 8px; }
.lc-sgc { background: #fff; border: 1px solid #86efac; border-radius: 10px; padding: 8px 10px; }
.lc-sgh { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 4px; } .lc-sgh .lc-sgre { margin-left: auto; }
.lc-sgtag { font-size: .7rem; background: #dcfce7; color: #166534; border-radius: 999px; padding: 1px 8px; } .lc-sgtag.gray { background: #f1f5f9; color: #64748b; }
.lc-sgs { margin: 2px 0 6px; font-size: .84rem; color: #334155; }
.lc-sgr { border-top: 1px dashed #d1d5db; padding: 6px 0; } .lc-sgr:first-of-type { border-top: 0; }
.lc-sgl { font-size: .72rem; color: #64748b; } .lc-sgt { white-space: pre-wrap; word-break: break-word; font-size: .92rem; line-height: 1.5; margin: 2px 0 6px; }
.lc-sgw { background: #fffbeb; border: 1px solid #fde68a; border-radius: 6px; padding: 4px 8px; font-size: .8rem; color: #92400e; margin: 4px 0; } .lc-sgw2 { margin: 0; font-size: .85rem; color: #166534; }
.lc-sgf { margin: 6px 0 0; font-size: .7rem; color: #64748b; }
.lc-more { display: block; width: 100%; border: 0; background: #e2e8f0; color: #334155; font-size: .8rem; padding: 5px; cursor: pointer; }
.lc-sgc .row .sm { min-height: 40px; }
/* 未紐付けのLINE(一覧) */
.ri-list { display: grid; gap: 10px; } .ri-card { border: 1px solid #e2e8f0; border-radius: 10px; padding: 10px 12px; background: #fff; }
.ri-top { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; } .ri-top .ri-ch { font-size: .72rem; background: #e0f2fe; color: #075985; border-radius: 999px; padding: 1px 8px; } .ri-top .ri-at { margin-left: auto; font-size: .75rem; color: #64748b; }
.ri-last { margin: 4px 0 8px; white-space: pre-wrap; word-break: break-word; color: #334155; }
.ri-link { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 8px; } .ri-link input.ie { flex: 1; min-width: 180px; }
.ri-sg { margin-top: 8px; } .ri-hist { margin: 6px 0; font-size: .82rem; color: #475569; border-left: 3px solid #cbd5e1; padding-left: 8px; }
@media (max-width: 720px) { .ri-card .row .sm, .ri-link .sm { min-height: 44px; } .ri-link input.ie { font-size: 16px; min-height: 44px; } }

/* 案件詳細の見出し(上に固定): 1行目 管理番号+Lステップ対応マーク / 2行目 源泉・対応店舗・最新の履歴の担当名 */
.cs-head { position: static; background: #f4f6fa; padding: 8px 0 6px; margin-bottom: 8px; border-bottom: 2px solid var(--line, #e5e7eb); }
.cs-head .cs-pagebar { margin-bottom: 6px; flex-wrap: wrap; align-items: center; gap: 8px 14px; }
.cs-hinfo { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.cs-hnm { display: flex; flex-direction: column; gap: 0; padding-right: 14px; border-right: 2px solid #b8c4d6; min-width: 0; }
.cs-hname { font-size: 1.5em; font-weight: 800; line-height: 1.25; color: #14213d; }
.cs-hkana { font-size: 0.9em; font-weight: 700; color: #475569; min-height: 1.2em; }
.cs-hl1, .cs-hl2 { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 18px; font-weight: 800; font-size: 1.3em; line-height: 1.35; color: #14213d; }
.cs-hl2 { font-size: 1.2em; color: #1f3a5f; }
.cs-hl2 span + span::before { content: ''; display: inline-block; width: 1px; height: 0.95em; background: #b8c4d6; margin-right: 18px; vertical-align: -0.1em; }
.cs-mark { background: #7c3aed; color: #fff; border-radius: 999px; padding: 1px 14px; font-size: 0.85em; }
/* ボタンの色(役割ごと) */
.btn.cs-b-back { background: #64748b; border-color: #64748b; color: #fff; }
.cs-rtabs .cs-t-ask { background: #7c3aed; border-color: #7c3aed; color: #fff; }
.cs-rtabs .cs-t-talk, .cs-rtabs .cs-t-talk.on { background: #06c755; border-color: #06c755; color: #fff; } /* 実際のLINEの色 */
.cs-rtabs button.on { box-shadow: inset 0 -3px 0 rgba(0,0,0,.25); }
.cs-rtabs .cs-t-ask:not(.on) { background: #f1ecfe; color: #5b21b6; border-color: #c4b5fd; }
.cs-act[data-ac="normal"] { background: #fff; border-color: #64748b; color: #334155; }
.cs-act[data-ac="initial"] { background: #2563eb; border-color: #2563eb; color: #fff; }
.cs-act[data-ac="screen"] { background: #f59e0b; border-color: #f59e0b; color: #fff; }
.cs-act[data-ac="appt"] { background: #0d9488; border-color: #0d9488; color: #fff; }
.cs-act[data-ac="talk"] { background: #7c3aed; border-color: #7c3aed; color: #fff; }
.cs-act:disabled, .cs-act[data-ac="appt"]:disabled { background: #e5e7eb; border-color: #d1d5db; color: #9ca3af; cursor: not-allowed; }
.cs-act-w { background: #fff; color: inherit; }
.ac-apphint { margin: 0 0 6px; }
.ac-co { padding: 10px 14px; font-weight: 700; } .ac-co.done { background: #eef3fb; }
.ac-co .small { margin-left: 4px; font-weight: 400; }
.ac-close { margin: 8px 0; padding: 8px 10px; border-radius: 8px; background: #fff7e6; }
.ac-veh { gap: 8px; }
.ask-copy-btn, .lc-sgcp { background: #0ea5e9; border-color: #0ea5e9; color: #fff; }
.ask-embed { padding: 2px 0; } .ask-embed textarea { width: 100%; }
@media (max-width: 1023px) { .cs-head { top: 0; } .cs-hl1, .cs-hl2 { font-size: 1.1em; } }

/* 案件一覧: 上の部分(タイトル・月・検索・ページ・まとめて選ぶ・絞り込み)は動かさず、表の中だけをスクロールする(見出しが動いて見えない) */
@media(min-width:601px){
  .cs-list { display: flex; flex-direction: column; height: calc(100vh - var(--cs-hd, 56px) - 44px); min-height: 460px; overflow: hidden; }
  .cs-lhead { flex: none; position: static; background: #fff; padding: 0 0 4px; margin-bottom: 4px; border-bottom: 2px solid var(--line, #e5e7eb); }
  .cs-lhead .row { margin-bottom: 6px; }
  .cs-list .tbl-wrap { flex: 1 1 auto; min-height: 0; overflow: auto; margin-top: 0; }
  table.cs-tbl thead tr.cs-hrow th { top: 0; }
  .cs-list > .cs-pager, .cs-list > .row { flex: none; }
}

.cs-filters .cs-unread { margin: 0 0 0 auto; align-self: end; }
@media(max-width:600px){ .cs-filters .cs-unread { margin: 0; } }

/* 友だち追加: 上の部分(説明・月・人数・絞り込み・まとめて消す)は動かさず、回答待ちの人の一覧だけをスクロールする */
@media(min-width:601px){
  .fr-page { display: flex; flex-direction: column; gap: 10px; height: calc(100vh - var(--cs-hd, 56px) - 44px); min-height: 460px; }
  .fr-top { flex: none; margin-bottom: 0; }
  .fr-card { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; margin-bottom: 0; overflow: hidden; }
  .fr-head { flex: none; border-bottom: 2px solid var(--line, #e5e7eb); padding-bottom: 4px; margin-bottom: 6px; }
  .fr-list { flex: 1 1 auto; min-height: 0; overflow: auto; }
}
/* 絞り込みの行: チェックと文字は、源泉のドロップダウンの箱と、下をそろえる(箱の高さの中で、上下の真ん中に置く) */
.fr-head .cs-filters { align-items: flex-end; }
.fr-head .cs-fl { margin: 0; }
.fr-head .cs-fl select { height: auto; min-height: 38px; line-height: 1.4; padding-top: 6px; padding-bottom: 6px; box-sizing: border-box; display: block; margin: 0; } /* 高さを固定すると、文字の下が切れる */
.fr-head .cs-filters > .chk, .fr-head .cs-filters > .small { display: inline-flex; align-items: center; min-height: 38px; margin: 0; align-self: flex-end; }
.fr-replied{font-weight:700;color:#b3261e;padding:0 2px}
.fr-rchk{white-space:nowrap}
@media (max-width: 720px) { .fr-head .cs-fl select { min-height: 44px; font-size: 16px; } .fr-head .cs-filters > .chk { min-height: 44px; } }
.fr-seen{display:inline-flex;align-items:center;gap:4px;margin-right:6px;vertical-align:middle}
.fr-seen input{pointer-events:none;margin:0}
.fr-seen.on{background:#e6f4ea;border-color:#1e8e3e;color:#137333;font-weight:700}

/* 権限設定(ポータルと同じ見た目) */
.menu-off { display: none !important; }
.pm-wrap { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 16px; align-items: start; }
.pm-side { position: sticky; top: 8px; display: flex; flex-direction: column; gap: 6px; }
.pm-list { max-height: calc(100vh - 220px); min-height: 200px; overflow-y: auto; border: 1px solid var(--line); border-radius: 8px; }
.pm-u { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1px; width: 100%; text-align: left; background: #fff; border: 0; border-bottom: 1px solid #e8edf3; border-radius: 0; padding: 6px 10px; cursor: pointer; color: inherit; font: inherit; }
.pm-u:hover { background: #f3f7fc; } .pm-u.on { background: #e3edfb; box-shadow: inset 4px 0 0 var(--primary); }
.pm-un { font-weight: 700; } .pm-ub .badge { font-size: .65rem; margin-right: 2px; }
.pm-h { margin: 0 0 8px; font-size: 1.15rem; }
.pm-sec { border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px 10px; margin: 0 0 12px; background: #fff; }
.pm-sec h4 { margin: 0 0 6px; font-size: .95rem; border-left: 4px solid var(--primary); padding-left: 8px; }
.pm-row { padding: 6px 0; border-bottom: 1px dashed #e3e8ef; } .pm-row:last-child { border-bottom: 0; }
.pm-row .chk { margin: 0; } .pm-row > .small { display: block; margin: 0 0 0 26px; }
.pm-row.off { opacity: .6; }
.pm-orgs { margin: 6px 0 2px 26px; }
.pm-menus { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 4px 12px; }
.pm-menus .chk { align-items: flex-start; } .pm-menus .chk.off { opacity: .6; }
.pm-bar { position: sticky; bottom: 0; background: rgba(255, 255, 255, .96); border-top: 1px solid var(--line); padding: 8px 0; display: flex; gap: 10px; align-items: center; }
@media (max-width: 800px) {
  .pm-wrap { grid-template-columns: minmax(0, 1fr); }
  .pm-side { position: static; } .pm-list { max-height: 240px; min-height: 120px; }
}

/* 権限設定: 機能ごとの権限(閲覧・作成・編集・削除)の表 */
.pm-mx { overflow-x: auto; }
.pm-tb { width: 100%; border-collapse: collapse; }
.pm-tb th, .pm-tb td { padding: 8px 6px; border-bottom: 1px solid var(--line, #e5e7eb); vertical-align: top; text-align: left; }
.pm-tb thead th { font-size: .82rem; color: var(--muted, #6b7280); font-weight: 600; }
.pm-tb .pm-c { width: 3.6em; text-align: center; }
.pm-tb tbody th { font-weight: 400; }
.pm-fn { display: block; margin-top: 2px; }
.pm-cb { display: inline-flex; align-items: center; justify-content: center; min-width: 32px; min-height: 32px; cursor: pointer; }
.pm-cb input { width: 18px; height: 18px; }
.pm-tb td.na { vertical-align: middle; }
@media (max-width: 700px) { .pm-tb .pm-c { width: 2.9em; } .pm-tb th, .pm-tb td { padding: 8px 3px; } }
.pm-tb { table-layout: fixed; }
.pm-tb th, .pm-tb td { white-space: normal; word-break: break-word; }
.pm-tb thead th:first-child, .pm-tb tbody th { width: auto; text-align: left; }
.pm-tb .pm-c { width: 3.6em; }
.pm-mx { overflow-x: visible; }

/* ---- フロー設計 ---- */
.fl-list { display: grid; gap: 10px; margin-top: 10px; }
.fl-card { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 14px; border: 1px solid var(--line, #e5e7eb); border-radius: 12px; text-decoration: none; color: inherit; background: #fff; }
.fl-card:hover { background: #f4f7fb; }
.fl-top { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 8px; }
.fl-name { font-size: 1.15rem; font-weight: 700; min-width: 180px; flex: 1; max-width: 360px; }
.fl-btns { display: flex; gap: 6px; flex-wrap: wrap; margin-left: auto; }
.fl-body { display: grid; grid-template-columns: 170px minmax(0, 1fr) 270px; gap: 10px; align-items: start; }
.fl-pal { display: grid; gap: 6px; position: sticky; top: 8px; }
.fl-p { text-align: left; border: 0; border-left: 5px solid var(--c, #94a3b8); background: #f4f7fb; border-radius: 8px; padding: 8px 10px; cursor: grab; display: grid; gap: 2px; font: inherit; color: inherit; }
.fl-p:hover { background: #e8eef8; } .fl-p span { color: #66758a; font-size: .74rem; line-height: 1.3; }
.fl-cv { overflow: auto; height: min(70vh, 680px); border: 1px solid var(--line, #e5e7eb); border-radius: 12px; background-color: #fbfcfe; background-image: radial-gradient(#d5dcea 1px, transparent 1px); background-size: 20px 20px; }
.fl-in { position: relative; }
.fl-svg { position: absolute; left: 0; top: 0; pointer-events: none; }
.fl-e { pointer-events: stroke; cursor: pointer; } .fl-ep { fill: none; stroke: #7b8aa0; stroke-width: 2; } .fl-eh { fill: none; stroke: transparent; stroke-width: 16; pointer-events: stroke; }
.fl-e.on .fl-ep { stroke: var(--primary, #1a56c7); stroke-width: 3; } .fl-el { font-size: 12px; fill: #475569; font-weight: 700; paint-order: stroke; stroke: #fbfcfe; stroke-width: 4px; }
.fl-tmp { fill: none; stroke: var(--primary, #1a56c7); stroke-width: 2; stroke-dasharray: 5 4; }
.fl-n { position: absolute; box-sizing: border-box; background: #fff; border: 2px solid var(--c, #94a3b8); border-radius: 10px; padding: 6px 10px; cursor: grab; touch-action: none; user-select: none; overflow: visible; }
.fl-n.sel { box-shadow: 0 0 0 3px rgba(26, 86, 199, .35); } .fl-n.bad { border-color: #d92d20; background: #fff5f4; }
.fl-nt { font-size: .68rem; color: var(--c, #64748b); font-weight: 700; } .fl-nl { font-size: .86rem; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } .fl-ns { font-size: .7rem; color: #66758a; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fl-po, .fl-pi { position: absolute; top: 50%; width: 16px; height: 16px; margin-top: -8px; border-radius: 50%; background: #fff; border: 3px solid var(--c, #94a3b8); box-sizing: border-box; }
.fl-po { right: -9px; cursor: crosshair; touch-action: none; } .fl-pi { left: -9px; } .fl-po:hover { background: var(--c, #94a3b8); }
.t-start { --c: #16a34a; } .t-step { --c: #1a56c7; } .t-action { --c: #d97706; } .t-branch { --c: #7c3aed; } .t-wait { --c: #64748b; } .t-handoff { --c: #0d9488; } .t-end { --c: #475569; }
.fl-pr { border: 1px solid var(--line, #e5e7eb); border-radius: 12px; padding: 10px 12px; background: #fff; display: grid; gap: 8px; max-height: min(70vh, 680px); overflow: auto; }
.fl-pr h3 { margin: 0; font-size: 1rem; } .fl-pr label { display: grid; gap: 2px; font-size: .8rem; color: #475569; } .fl-pr label.pr-ck { display: flex; gap: 6px; align-items: center; }
.fl-pr select { font: inherit; padding: 8px; border-radius: 8px; border: 0; background: #f1f5fb; }
.fl-sim { padding-left: 20px; display: grid; gap: 4px; } .fl-vers { list-style: none; padding: 0; display: grid; gap: 10px; }
@media (max-width: 900px) { .fl-body { grid-template-columns: 1fr; } .fl-pal { position: static; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); } .fl-ph { grid-column: 1 / -1; } .fl-cv { height: 60vh; } .fl-pr { max-height: none; } .fl-p span { display: none; } .fl-btns .btn { min-height: 44px; } }
.fl-info { background: #eef4ff; color: #1e3a8a; border: 0; margin: 6px 0; font-size: .85rem; }
.fl-cw { position: relative; min-width: 0; } .fl-zm { display: flex; gap: 4px; align-items: center; justify-content: flex-end; margin-bottom: 6px; flex-wrap: wrap; } .fl-zm .small { min-width: 42px; text-align: center; }
#fl-scw { position: relative; overflow: hidden; } .fl-in { transform-origin: 0 0; }
@media (max-width: 900px) { .fl-zm .btn { min-height: 44px; } }
.fl-cond { border: 1px solid var(--line, #e5e7eb); border-radius: 10px; padding: 8px 12px; margin: 6px 0; background: #fafbfd; }
.fl-condh { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; } .fl-condv { color: #1e3a8a; font-size: .85rem; flex: 1; min-width: 160px; }
.fl-cg { display: grid; grid-template-columns: 90px 1fr; gap: 6px; align-items: start; margin-top: 6px; } .fl-cg > div { display: flex; flex-wrap: wrap; gap: 4px 14px; }
.fl-cb { display: inline-flex; gap: 5px; align-items: center; font-size: .85rem; }
@media (max-width: 600px) { .fl-cg { grid-template-columns: 1fr; } .fl-cb { min-height: 36px; } }
/* 成約報告・引継の設計 / 値の元 */
.ho-pv{margin-top:2px}.ho-pv button{margin-left:4px}
.won-post{list-style:none;margin:8px 0;padding:0;display:flex;flex-direction:column;gap:6px}
.won-post li{display:flex;align-items:center;gap:6px;padding:6px 8px;border-radius:8px;background:rgba(127,127,127,.1)}
.won-post li>span{flex:1}
.won-off{display:flex;flex-wrap:wrap;gap:6px}
.won-pv{white-space:pre-wrap;padding:10px;border-radius:8px;background:rgba(127,127,127,.1);font-size:.9em}
/* 運用開始の準備 */
.pg-wrap .pg-ul{margin:2px 0 10px 28px;padding:0}.pg-cat{margin-top:6px}
.pg-lock{padding:10px;border-radius:8px;background:#fff0d6}
.pg-t{border-collapse:collapse;margin:6px 0}.pg-t td,.pg-t th{padding:4px 14px 4px 0;text-align:left}.pg-t .num{text-align:right}
/* 割り振り状況: 次の10件の順番 */
.cs-next { margin: 8px 0; }
.cs-nextl { display: flex; flex-wrap: wrap; gap: 6px; list-style: none; counter-reset: nx; margin: 6px 0; padding: 0; }
.cs-nextl li { counter-increment: nx; padding: 4px 10px; border-radius: 999px; background: #eef3fb; font-size: .9rem; }
.cs-nextl li::before { content: counter(nx) ". "; color: #66758a; font-variant-numeric: tabular-nums; }

/* 活動履歴 / ノート のタブ */
.ac-tabs { display: flex; gap: 2px; border-bottom: 2px solid var(--line, #e5e7eb); margin: 8px 0 10px; }
.ac-tab { border: 0; background: none; padding: 8px 14px; font-weight: 600; color: #64748b; cursor: pointer; border-bottom: 3px solid transparent; margin-bottom: -2px; }
.ac-tab.on { color: #0f172a; border-bottom-color: #2563eb; }
.sl-bar, .sl-tool, .sl-foot { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 6px 0; }
.sl-title { flex: 1 1 160px; font-weight: 700; font-size: 1.05em; }
.sl-seg { display: inline-flex; gap: 2px; }
.sl-seg .sm.on { background: #2563eb; color: #fff; }
.sl-list { list-style: none; margin: 8px 0; padding: 0; display: grid; gap: 4px; }
.sl-item { width: 100%; text-align: left; background: #f8fafc; border: 0; border-radius: 8px; padding: 9px 12px; cursor: pointer; }
.sl-item:hover { background: #eef2ff; }
.sl-tpls { background: #f8fafc; border-radius: 8px; padding: 8px 10px; margin: 6px 0; display: grid; gap: 6px; }
.sl-trow { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.sl-cols { display: grid; gap: 10px; margin: 8px 0; }
.sl-c1 { grid-template-columns: 1fr; } .sl-c2 { grid-template-columns: repeat(2, 1fr); } .sl-c3 { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 720px) { .sl-c2, .sl-c3 { grid-template-columns: 1fr; } }
.sl-col { min-height: 220px; padding: 10px 12px; border-radius: 8px; background: #fafafa; box-shadow: inset 0 0 0 1px #eef0f3; outline: none; overflow: auto; word-break: break-word; font: inherit; width: 100%; box-sizing: border-box; }
.sl-col:focus { background: #fff; box-shadow: inset 0 0 0 2px #93c5fd; }
.sl-md { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: .9em; resize: vertical; border: 0; }
.ac-hist .ac-ng { color: #b91c1c; font-weight: 700; }
.ac-hist .ac-ok { color: #1565c0; font-weight: 700; }
/* 履歴の本文: 1つのまとまりとして折り返す(日時・コメントなどの補足は、本文の下の行) */
.ac-bd { order: 9; flex: 1 1 100%; min-width: 0; line-height: 1.55; padding-top: 2px; } /* 本文は、日時・担当者などの見出しの行の下に、横いっぱいで出す */
.ac-hist .ac-ok, .ac-hist .ac-ng { white-space: nowrap; }
.ac-sub { display: block; margin-top: 2px; font-size: .85rem; color: var(--muted); font-weight: 400; }
.ac-sub .ac-ok, .ac-sub .ac-ng { font-size: .85rem; }

/* ノート: ブロック */
.sl-help { margin: 2px 0 8px; line-height: 1.6; }
.sl-colwrap { background: #f4f6fa; border-radius: 10px; padding: 8px; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.sl-colhead { font-size: .78em; font-weight: 700; color: #64748b; letter-spacing: .04em; }
.sl-blks { display: flex; flex-direction: column; gap: 6px; min-height: 120px; border-radius: 8px; transition: background .1s; }
.sl-blks.over { background: #e0ecff; }
.sl-empty { color: #94a3b8; font-size: .9em; text-align: center; padding: 28px 8px; border: 2px dashed #cbd5e1; border-radius: 8px; }
.sl-blk { display: flex; gap: 6px; align-items: flex-start; background: #fff; border-radius: 8px; padding: 6px 6px 6px 2px; box-shadow: 0 0 0 1px #e5e7eb; position: relative; }
.sl-blk:hover { box-shadow: 0 0 0 1px #93c5fd; }
.sl-blk.editing { box-shadow: 0 0 0 2px #2563eb; }
.sl-blk.dragging { opacity: .35; }
.sl-grip { cursor: grab; color: #94a3b8; padding: 2px 6px; font-size: 1.15em; line-height: 1.4; user-select: none; touch-action: none; }
.sl-grip:hover { color: #2563eb; background: #eff6ff; border-radius: 4px; }
.sl-bmain { flex: 1; min-width: 0; }
.sl-type { appearance: none; border: 0; background: #eef2f7; color: #64748b; font-size: .72em; border-radius: 10px; padding: 1px 8px; margin-bottom: 3px; cursor: pointer; }
.sl-view { min-height: 24px; word-break: break-word; }
.sl-clk { cursor: text; }
.sl-view p { margin: 0; } .sl-view h1, .sl-view h2, .sl-view h3 { margin: 0; } .sl-view ul, .sl-view ol { margin: 0; padding-left: 1.4em; }
.sl-view blockquote { margin: 0; padding: 2px 10px; border-left: 3px solid #cbd5e1; color: #475569; } .sl-view pre { margin: 0; background: #0f172a; color: #e2e8f0; padding: 8px; border-radius: 6px; overflow: auto; }
.sl-view img { max-width: 100%; height: auto; border-radius: 4px; display: block; } .sl-view code { background: #eef2f7; padding: 0 4px; border-radius: 3px; }
.sl-ph { color: #94a3b8; }
.sl-edit { width: 100%; box-sizing: border-box; border: 0; outline: none; resize: none; background: #f8fbff; border-radius: 6px; padding: 6px 8px; font: inherit; min-height: 34px; overflow: hidden; }
.sl-hint { margin-top: 3px; }
.sl-bops { display: flex; flex-direction: column; gap: 1px; opacity: 0; transition: opacity .1s; }
.sl-blk:hover .sl-bops, .sl-blk.editing .sl-bops, .sl-blk:focus-within .sl-bops { opacity: 1; }
.sl-op { border: 0; background: none; color: #94a3b8; cursor: pointer; font-size: .75em; padding: 1px 5px; border-radius: 4px; }
.sl-op:hover { background: #eef2f7; color: #0f172a; }
@media (hover: none) { .sl-bops { opacity: 1; } }
.sl-drop { height: 4px; background: #2563eb; border-radius: 2px; margin: -2px 0; }
.sl-add { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; padding-top: 2px; }
.sl-chip { cursor: grab; }
.sl-type { width: auto; max-width: 100%; display: inline-block; }

/* ノート: テンプレートの大きな画面・選ぶ画面・共有 */
body.sl-noscroll { overflow: hidden; }
.sl-ov { position: fixed; inset: 0; background: rgba(15, 23, 42, .55); z-index: 1000; display: flex; align-items: center; justify-content: center; padding: 2vh 2vw; }
.sl-ov ~ .sl-ov { z-index: 1010; }
.sl-ovbox { background: #fff; border-radius: 12px; width: min(1400px, 96vw); height: 94vh; overflow: auto; box-shadow: 0 20px 60px rgba(0, 0, 0, .35); }
.sl-ovbody { padding: 14px 18px 24px; }
.sl-ovbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.sl-pv-t { margin: 4px 0 10px; }
.sl-pv .sl-pvcol { background: #fff; border-radius: 8px; padding: 10px 12px; min-height: 160px; box-shadow: 0 0 0 1px #e5e7eb; }
.sl-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 10px; margin-top: 8px; }
.sl-card { background: #f8fafc; border-radius: 10px; padding: 12px; display: grid; gap: 10px; align-content: space-between; box-shadow: 0 0 0 1px #e5e7eb; }
.sl-none { text-align: center; padding: 36px 12px; background: #f8fafc; border-radius: 10px; margin-top: 8px; }
.sl-share { background: #f8fafc; border-radius: 10px; padding: 10px 12px; margin: 10px 0; display: grid; gap: 6px; }
.sl-ulist { max-height: 180px; overflow: auto; display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 2px 10px; background: #fff; border-radius: 8px; padding: 6px 8px; margin: 4px 0; }
.sl-urow { display: flex; gap: 6px; align-items: center; font-size: .92em; cursor: pointer; }
.sl-ovbody .sl-colwrap .sl-blks { min-height: 240px; }
.sl-view a.sl-file, .sl-file { display: inline-flex; align-items: center; gap: 4px; background: #eef2f7; border-radius: 8px; padding: 6px 12px; color: #0f172a; text-decoration: none; }
.sl-view a.sl-file:hover { background: #dbeafe; text-decoration: underline; }

.ac-gcframe { width: 100%; height: 900px; display: block; overflow: hidden; border: 1px solid #d0d7de; border-radius: 6px; background: #fff; }

.sl-slot { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 14px 12px; border: 2px dashed #94a3b8; border-radius: 8px; background: #f8fafc; color: #334155; }
.sl-slotlbl { min-width: 160px; flex: 0 1 220px; }

.sl-plain .sl-type, .sl-plain .sl-grip, .sl-plain .sl-bops, .sl-plain .sl-add, .sl-plain .sl-seg, .sl-plain .sl-help, .sl-plain .sl-colhead { display: none; }

.sl-fld { padding: 8px 4px; }
.sl-fl { display: block; font-weight: 600; margin-bottom: 4px; }
.sl-fin { width: 100%; box-sizing: border-box; min-height: 40px; padding: 8px 10px; border: 1px solid #cbd5e1; border-radius: 6px; font: inherit; resize: vertical; }
.sl-fbody img { max-width: 100%; max-height: 320px; display: block; margin-bottom: 6px; }
.sl-static { padding: 2px 4px; }
.sl-bxd { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 10px 8px; border: 2px dashed #94a3b8; border-radius: 8px; background: #f8fafc; }
.sl-boxlbl { min-width: 180px; flex: 0 1 260px; }

.sl-row { display: flex; gap: 6px; align-items: stretch; }
.sl-row .sl-item { flex: 1 1 auto; text-align: left; }
.sl-row .sm { flex: 0 0 auto; }
img[data-sl] { cursor: zoom-in; }
a.sl-file[data-slf] { cursor: pointer; }
.sl-zoom { display: flex; justify-content: center; align-items: center; padding: 8px; cursor: zoom-out; }
.sl-zoom img { max-width: 100%; max-height: 80vh; cursor: zoom-out; }
.sl-pvframe { width: 100%; height: 75vh; border: 1px solid #d0d7de; border-radius: 6px; background: #fff; }
.sl-nopv { padding: 24px; text-align: center; }
.ac-tab[hidden]{display:none}

/* CRMダッシュボード: クリックできる数字・割合・レコード一覧 */
.cd-num { background: none; border: 0; padding: 0; margin: 0; font: inherit; font-weight: 700; color: var(--primary); cursor: pointer; text-decoration: underline; text-decoration-style: dotted; text-underline-offset: 3px; }
.cd-num:hover { text-decoration-style: solid; }
.cd-pc { display: block; font-size: .72rem; color: var(--muted); font-weight: 400; line-height: 1.2; }
.cd-fn .cd-pc { display: inline; width: 3.6em; flex: none; text-align: right; }
.cd-kp { font-size: .75rem; color: var(--muted); } .cd-kp b { color: var(--text); }
.cd-recbox { max-height: 65vh; overflow: auto; }
.cd-rec { cursor: pointer; } .cd-rec:hover, .cd-rec:focus { background: #eef4ff; outline: 0; }

/* 編集・削除などの操作ボタンは表の左端に置き、横にスクロールしても見えるよう固定する */
.mg-tbl th:first-child, .mg-tbl td:first-child { position: sticky; left: 0; z-index: 2; background: #fff; box-shadow: 1px 0 0 #e3e8ef; }
.mg-tbl thead th:first-child { background: #f5f7fa; z-index: 3; }
.mg-tbl tr.retired td:first-child { background: #f7f7f7; }
.mg-tbl td:first-child { white-space: nowrap; }
.dwa-tbl td.dwa-op { white-space: nowrap; vertical-align: top; }

/* 外部連携のステップ設定 */
.sp-steps { display: flex; flex-wrap: wrap; gap: 6px 14px; list-style: none; padding: 0; margin: 10px 0; }
.sp-steps li { display: flex; align-items: center; gap: 6px; font-size: .85rem; color: var(--muted, #6b7280); }
.sp-steps li span { display: inline-flex; width: 22px; height: 22px; border-radius: 50%; background: #e5e7eb; color: #374151; align-items: center; justify-content: center; font-size: .8rem; font-weight: 700; }
.sp-steps li.on { color: #111827; font-weight: 700; } .sp-steps li.on span { background: var(--primary, #1a56c7); color: #fff; }
.sp-steps li.done span { background: #16a34a; color: #fff; }
.sp-nav { margin-top: 14px; }
.sp-menu { display: grid; gap: 10px; margin-top: 10px; }
.sp-item { display: grid; gap: 4px; padding: 12px 14px; border: 1px solid #d8dee8; border-radius: 8px; text-decoration: none; color: inherit; background: #fff; }
.sp-item:hover { background: #f1f5fb; }

/* トレーニング(研修) */
.tr-card .tr-hd { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 4px; }
.tr-card .tr-hd h3 { margin: 0; }
.tr-no { display: inline-flex; width: 28px; height: 28px; border-radius: 50%; background: var(--brand, #0b4f5c); color: #fff; align-items: center; justify-content: center; font-weight: 700; }
.tr-checks { list-style: none; margin: 6px 0; padding: 0; font-size: .9rem; }
.tr-checks li { padding: 2px 0; color: #555; }
.tr-checks li.ok { color: #1b6b3a; font-weight: 600; }
.tr-script h4, .tr-guide h4 { margin: 12px 0 4px; }
.tr-dl { display: grid; grid-template-columns: 8em 1fr; gap: 4px 10px; margin: 6px 0; font-size: .92rem; }
.tr-dl dt { color: #555; } .tr-dl dd { margin: 0; }
.tr-qa { width: 100%; border-collapse: collapse; font-size: .92rem; margin: 6px 0; }
.tr-qa th, .tr-qa td { border: 1px solid var(--line, #d9dee5); padding: 6px 8px; text-align: left; vertical-align: top; }
#trn-bar { position: fixed; left: 0; right: 0; top: 0; z-index: 1000; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 6px 14px; min-height: 44px; box-sizing: border-box; background: repeating-linear-gradient(135deg, #c62828 0 16px, #a81e1e 16px 32px); color: #fff; box-shadow: 0 2px 10px rgba(0,0,0,.35); }
#trn-bar .trn-title { font-size: 1.25rem; letter-spacing: .08em; padding: 2px 12px; border-radius: 6px; background: #fff; color: #b71c1c; }
#trn-bar .trn-msg { flex: 1; font-size: .85rem; opacity: .95; }
#trn-bar button { background: #fff; color: #7a4300; border: 0; border-radius: 8px; padding: 6px 12px; font-weight: 700; cursor: pointer; }
body.trn-on { padding-top: var(--trn-h, 48px); } body.trn-on .hd { top: var(--trn-h, 48px); }

.tr-sheet { margin: 8px 0 14px; } .tr-sheet h5 { margin: 0 0 4px; font-size: .95rem; } .tr-qa th { text-align: left; font-weight: 600; white-space: nowrap; width: 11em; background: #f4f7fb; } .tr-card.tr-focus { outline: 3px solid #7fb0ff; }
.nav-dd-btn:hover, .nav-dd.hov:hover .nav-dd-btn { background: rgba(255,255,255,.12); }

/* 納車カンバン: 列の見出しは進捗バーと同じ色の矢羽根、カードは角丸で状態ごとに色分け */
.dw-col { border-radius: 16px; background: #f8f4f7; padding: 8px 8px 10px; }
.dw-h { --pt: 14px; display: flex; flex-direction: column; align-items: center; justify-content: center; margin: 0 0 8px; padding: 6px 18px 6px 12px; font-size: 14px; text-align: center; clip-path: polygon(0 0, calc(100% - var(--pt)) 0, 100% 50%, calc(100% - var(--pt)) 100%, 0 100%); }
.dw-h small { font-weight: 400; font-size: 12px; }
.dw-h-todo { background: #fecaca; color: #6e1414; } .dw-h-doing { background: #fbbf24; color: #3b2300; } .dw-h-done { background: #dbeafe; color: #1e3a8a; }
.dw-card { border-radius: 14px; border: 1px solid transparent; border-left-width: 6px; padding: 9px 12px; margin-bottom: 8px; box-shadow: 0 1px 3px #0001; }
.dw-s-todo { background: #fff1f1; border-color: #f5b5b5; } .dw-s-doing { background: #fff6dc; border-color: #f2cf76; } .dw-s-done { background: #e8f1ff; border-color: #aac8f5; }
.dw-s-todo { border-left-color: #ef6b6b; } .dw-s-doing { border-left-color: #f0a500; } .dw-s-done { border-left-color: #3b82f6; }
.dw-card:hover { box-shadow: 0 3px 8px #0002; }
.dw-who { font-weight: 600; } .dw-d { white-space: nowrap; }
.dw-new { display: inline-block; font-size: 11px; font-weight: 700; padding: 0 6px; border-radius: 10px; background: #ede9fe; color: #5b21b6; vertical-align: middle; }
.dw-addbox { margin-top: 4px; } .dw-ghost { cursor: text; }

.dw-tabs { display: flex; gap: 8px; margin: 14px 0 10px; }
.dw-tab { display: inline-flex; align-items: center; gap: 8px; padding: 10px 22px; font-size: 16px; font-weight: 700; border-radius: 999px; border: 2px solid #d9c9d6; background: #fff; color: #6b4f66; cursor: pointer; }
.dw-tab.on { background: #be3f8a; border-color: #be3f8a; color: #fff; }
.dw-open { font-size: 13px; font-weight: 700; padding: 2px 10px; border-radius: 999px; background: #fecaca; color: #6e1414; }
.dw-open.zero { background: #dbeafe; color: #1e3a8a; }
.dw-tab.on .dw-open { background: #fff; }

/* ---- キャンセル・在庫一覧 ---- */
.ac-cancel-btn { color: #b42318; border-color: #f0b4ae; }
.cn-tbl { border-collapse: collapse; margin: 8px 0; width: 100%; max-width: 520px; }
.cn-tbl th, .cn-tbl td { text-align: left; padding: 4px 8px; border-bottom: 1px solid #e6ebf1; font-size: 14px; }
.cn-tbl th { color: #6b7280; font-weight: 600; width: 8em; white-space: nowrap; }
.ls-grid, .sk-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 8px; margin: 8px 0; }
.ls-th, .sk-ph { display: flex; flex-direction: column; gap: 4px; align-items: stretch; }
.ls-th img, .sk-img img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 8px; border: 1px solid #d8dee6; display: block; }
.sk-img { padding: 0; border: 0; background: none; cursor: zoom-in; }
.ls-pdf { display: flex; align-items: center; justify-content: center; aspect-ratio: 4 / 3; border-radius: 8px; border: 1px solid #d8dee6; background: #f4f6f9; font-weight: 700; }
.ls-add { display: inline-block; padding: 8px 14px; border: 1px dashed #9aa7b8; border-radius: 8px; cursor: pointer; color: #1a56c7; }
.ls-add:hover { background: #f1f5fb; }
.sk-thumb { width: 72px; height: 54px; object-fit: cover; border-radius: 6px; border: 1px solid #d8dee6; display: block; }
.sk-noimg { display: inline-block; width: 72px; font-size: 11px; color: #98a4b3; text-align: center; }
.sk-row { cursor: pointer; }
.sk-row:hover { background: #f1f5fb; }
.sk-eds { margin-top: 8px; }
.sk-w { white-space: pre-wrap; margin: 4px 0; }
.sk-tasks { list-style: none; padding: 0; margin: 6px 0 0; font-size: 13px; }
.sk-t { padding: 3px 8px; margin: 3px 0; border-radius: 8px; border-left: 4px solid #ccc; background: #f8fafc; }
.sk-t-todo { border-left-color: #e5484d; } .sk-t-doing { border-left-color: #f5b301; } .sk-t-done { border-left-color: #2b6fd6; }
.sk-tst { font-weight: 700; font-size: 12px; margin-right: 4px; }
.dw-cancel { border-left: 5px solid #e5484d; }
.sk-lb { position: fixed; inset: 0; z-index: 9999; background: rgba(0,0,0,.85); display: flex; align-items: center; justify-content: center; }
.sk-lb img { max-width: 92vw; max-height: 88vh; object-fit: contain; }
.sk-lb-x { position: absolute; top: 12px; right: 16px; font-size: 28px; background: transparent; border: 0; color: #fff; }
.sk-lb-n { position: absolute; top: 50%; transform: translateY(-50%); font-size: 36px; background: rgba(255,255,255,.15); border: 0; color: #fff; width: 48px; height: 64px; }
.sk-lb-p { left: 8px; } .sk-lb-nx { right: 8px; }
.sk-lb-c { position: absolute; bottom: 12px; color: #fff; font-size: 14px; }
.cn-bank { margin: 8px 0; }
.cn-bank-g { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; }
.cn-foot { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; flex-wrap: wrap; margin-top: 12px; }
.cn-ap { flex: 1 1 260px; max-width: 420px; }
.cn-btns { display: flex; gap: 8px; align-items: center; margin-left: auto; }

.sk-el { white-space: nowrap; font-weight: 600; }
.sk-el-long { color: #b42318; }

/* キャンセル: 成約完了 → キャンセル(赤)。申請中(承認待ち)は、薄い赤 */
.ph-cancel { background: #dc2626; color: #fff; } .ph-cancelw { background: #fee2e2; color: #991b1b; box-shadow: inset 0 0 0 2px #dc2626; }
.ph-tag.ph-cancel { background: #dc2626; color: #fff; } .ph-tag.ph-cancelw { background: #fee2e2; color: #991b1b; box-shadow: inset 0 0 0 1px #dc2626; }

/* 在庫一覧: 上の部分は動かさず、表の中だけを縦にスクロールする。見出しは色つきで固定。横にスライドしないよう、列の幅を割りふる */
main:has(.sk-list) { max-width: 1500px; }
@media(min-width:721px){
  .sk-list { display: flex; flex-direction: column; height: calc(100vh - var(--cs-hd, 56px) - 44px); min-height: 420px; overflow: hidden; }
  .sk-head { flex: none; }
  .sk-wrap { flex: 1 1 auto; min-height: 0; overflow-y: auto; overflow-x: hidden; margin-top: 6px; border-radius: 8px; border: 1px solid #d8dee6; }
}
.sk-tbl { width: 100%; table-layout: fixed; border-collapse: collapse; font-size: 13px; }
.sk-tbl th, .sk-tbl td { padding: 6px 6px; text-align: left; vertical-align: middle; overflow-wrap: anywhere; word-break: break-word; border-bottom: 1px solid #e6ebf1; }
.sk-tbl thead th { position: sticky; top: 0; z-index: 2; background: #0f4c5c; color: #fff; font-weight: 700; white-space: nowrap; }
.sk-tbl tbody tr:nth-child(even) { background: #f7fafc; }
.sk-tbl col.c-th { width: 8%; } .sk-tbl col.c-d { width: 8%; } .sk-tbl col.c-el { width: 6%; } .sk-tbl col.c-car { width: 12%; } .sk-tbl col.c-gr { width: 11%; } .sk-tbl col.c-yr { width: 11%; } .sk-tbl col.c-cl { width: 8%; } .sk-tbl col.c-km { width: 8%; } .sk-tbl col.c-cost { width: 9%; } .sk-tbl col.c-loc { width: 7%; } .sk-tbl col.c-st { width: 6%; } .sk-tbl col.c-sh { width: 6%; }
.sk-thumb { width: 100%; max-width: 72px; height: auto; aspect-ratio: 4 / 3; }
@media(max-width:720px){
  .sk-tbl, .sk-tbl tbody, .sk-tbl tr, .sk-tbl td { display: block; width: 100%; }
  .sk-tbl thead { display: none; }
  .sk-tbl tr { border: 1px solid #d8dee6; border-radius: 10px; margin: 8px 0; padding: 6px 8px; background: #fff !important; }
  .sk-tbl td { border: 0; padding: 3px 0; display: flex; gap: 8px; } .sk-tbl td[data-l]::before { content: attr(data-l); flex: none; width: 6.5em; color: #6b7280; font-size: 12px; }
}
#nav-more-menu, #nav-goal-menu { max-height: calc(100vh - 90px); overflow-y: auto; overscroll-behavior: contain; }
@media (max-width: 720px) { #nav-more-menu, #nav-goal-menu { max-height: none; overflow-y: visible; } }

/* ---- 納車待ち詳細: すっきりしたタブとカード(上のタブ=下線式 / 枠の切り替え=グループ式 / カード=白地+影+左の色帯) ---- */
.dw-wrap .card { border-radius: 18px; border: 0; box-shadow: 0 1px 2px #0001, 0 8px 24px #1f243012; }
.dw-ttabs { display: flex; gap: 6px; margin: 22px 0 0; border-bottom: 2px solid #e8e9ee; flex-wrap: wrap; }
.dw-ttab { position: relative; display: inline-flex; align-items: center; gap: 10px; padding: 12px 20px 14px; font-size: 16px; font-weight: 700; color: #6b7280; background: none; border: 0; border-radius: 0; cursor: pointer; }
.dw-ttab:hover { color: #be3f8a; }
.dw-ttab.on { color: #be3f8a; } .dw-ttab.on::after { content: ""; position: absolute; left: 8px; right: 8px; bottom: -2px; height: 4px; border-radius: 4px 4px 0 0; background: #be3f8a; }
.dw-pill { font-size: 12px; font-weight: 700; border-radius: 999px; padding: 3px 10px; background: #eef0f5; color: #4b5563; }
.dw-ttab.on .dw-pill { background: #fbeaf3; color: #be3f8a; } .dw-pill.bad { background: #fde8ec !important; color: #d92d4b !important; } .dw-pill.ok { background: #e1f6ec !important; color: #0f9d6b !important; }
.dw-seg { display: inline-flex; background: #eceef4; border-radius: 12px; padding: 4px; margin: 18px 0 14px; gap: 2px; }
.dw-seg .dw-tab { border: 0; background: none; border-radius: 9px; padding: 8px 18px; font-size: 14px; color: #6b7280; box-shadow: none; }
.dw-seg .dw-tab.on { background: #fff; color: #1f2430; box-shadow: 0 1px 4px #0002; }
.dw-seg .dw-open { background: #e5e7ee; color: #4b5563; } .dw-seg .dw-open.zero { background: #e5e7ee; color: #4b5563; } .dw-seg .dw-tab.on .dw-open { background: #fbeaf3; color: #be3f8a; }
.dw-panel[hidden] { display: none; }
.dw-col { background: #eef0f6; border-radius: 18px; padding: 12px; }
.dw-h { clip-path: none; background: none !important; flex-direction: row; justify-content: flex-start; gap: 8px; padding: 2px 4px; margin: 2px 0 12px; font-size: 14px; color: #1f2430 !important; text-align: left; }
.dw-h::before { content: ""; width: 10px; height: 10px; border-radius: 50%; background: #ef4444; }
.dw-h-doing::before { background: #f59e0b; } .dw-h-done::before { background: #3b82f6; }
.dw-h small { margin-left: auto; font-weight: 600; color: #6b7280; background: #fff; border-radius: 999px; padding: 2px 9px; }
.dw-card { position: relative; overflow: hidden; background: #fff !important; border: 0 !important; border-radius: 14px; padding: 12px 14px 12px 18px; margin-bottom: 10px; box-shadow: 0 1px 2px #0001, 0 4px 12px #1f24300d; }
.dw-card::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 5px; background: #ef4444; }
.dw-s-doing::before { background: #f59e0b; } .dw-s-done::before { background: #3b82f6; }
.dw-card:hover { box-shadow: 0 2px 4px #0002, 0 8px 20px #1f243016; }
.dw-addbox .dw-add { width: 100%; border: 2px dashed #cfd3df; background: none; border-radius: 14px; padding: 11px; color: #6b7280; font-weight: 700; font-size: 13px; }

/* ---- 予実管理 ---- */
.yj-sum { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin: 20px 0; }
.yj-sum .s { border-radius: 18px; padding: 18px 22px; background: #fff; box-shadow: 0 1px 2px #0001, 0 8px 24px #1f243012; }
.yj-sum .s span { font-size: 13px; color: #6b7280; font-weight: 600; } .yj-sum .s b { display: block; font-size: 30px; margin-top: 4px; font-variant-numeric: tabular-nums; } .yj-sum .s small { color: #6b7280; }
.yj-sum .s.d.bad { background: linear-gradient(135deg, #fff, #fff2f4); border: 1px solid #f7c6cf; } .yj-sum .s.d.bad b { color: #d92d4b; }
.yj-sum .s.d.ok { background: linear-gradient(135deg, #fff, #eafaf3); border: 1px solid #b7e8d3; } .yj-sum .s.d.ok b { color: #0f9d6b; }
.yj-card h3 { margin: 0 0 4px; font-size: 17px; } .yj-card .n { margin: 0 0 12px; font-size: 12.5px; color: #6b7280; }
table.yj { width: 100%; border-collapse: collapse; } .yj th { font-size: 12px; color: #6b7280; font-weight: 700; text-align: left; padding: 8px; border-bottom: 2px solid #e8e9ee; white-space: nowrap; }
.yj td { padding: 7px 8px; border-bottom: 1px solid #e8e9ee; font-size: 14px; } .yj .r { text-align: right; font-variant-numeric: tabular-nums; }
.yj .sec td { background: #2c3e50; color: #fff; font-weight: 800; font-size: 13px; padding: 7px 10px; border: 0; }
.yj .hl { background: #fff7fb; } .yj th.hl { background: #fbeaf3; color: #be3f8a; } .yj .mut { color: #a3a9b8; } .yj .up { color: #d92d4b; font-weight: 700; } .yj .dn { color: #0f9d6b; font-weight: 700; }
.yj .tax { font-size: 12px; font-weight: 700; padding: 3px 10px; border-radius: 999px; background: #e8f0ff; color: #2563eb; white-space: nowrap; } .yj .tax.f { background: #eef7ee; color: #15803d; }
.yj input.ie { width: 100%; min-width: 0; font: inherit; padding: 3px 2px; } .yj input.ie.r { text-align: right; } .yj .yj-nm { min-width: 14em; }
.yj select.yj-tx { border: 0; background: #e8f0ff; color: #2563eb; font-weight: 700; border-radius: 999px; padding: 3px 8px; }
.yj .x { text-align: center; } .yj-rm { border: 0; background: none; color: #b6bbc8; font-size: 20px; cursor: pointer; } .yj-rm:hover { color: #d92d4b; }
.yj-add { margin-top: 10px; border: 0; background: #fbeaf3; color: #be3f8a; font-weight: 800; font-size: 14px; padding: 9px 16px; border-radius: 12px; cursor: pointer; }
.yj-bar { position: sticky; bottom: 8px; margin-top: 18px; display: flex; align-items: center; gap: 28px; flex-wrap: wrap; background: #1f2430; color: #fff; border-radius: 18px; padding: 14px 22px; box-shadow: 0 6px 24px #0004; }
.yj-bar span { display: block; font-size: 12px; color: #b6bbc8; } .yj-bar b { font-size: 20px; font-variant-numeric: tabular-nums; } .yj-bar .primary { margin-left: auto; }
@media (max-width: 720px) { .yj-sum { grid-template-columns: 1fr; } .dw-ttab { padding: 10px 12px 12px; font-size: 14px; } .yj-bar { gap: 14px; } }
.yj { table-layout: auto; } .yj:not(.yj2) th:nth-child(2) { width: 84px; } .yj:not(.yj2) th:nth-child(n+3) { width: 118px; } .yj:not(.yj2) th.hl { width: 150px; }
.yj input.ie { background: transparent; border: 0; border-bottom: 1.5px dashed #c9cdd8; border-radius: 0; box-shadow: none; } .yj input.ie:placeholder-shown { background: #f4f6fa; } .yj input.ie:focus { border-bottom-color: #be3f8a; outline: 0; background: #fff; }
.yj select.yj-tx { width: auto; min-width: 0; }
.yj2 th:nth-child(1) { width: auto; } .yj2 th:nth-child(2) { width: 100px; } .yj2 th:nth-child(3), .yj2 th:nth-child(4) { width: 140px; } .yj2 th:nth-child(5) { width: 44px; }

.dw-fgrid{display:grid;grid-template-columns:repeat(auto-fit,minmax(170px,1fr));gap:12px;margin:10px 0}
.dw-fgrid label{display:flex;flex-direction:column;gap:4px;font-size:12px;color:var(--muted,#64748b)}
.dw-plan output{display:block;padding:8px 10px;border-radius:8px;background:#f1f5f9;color:#0f172a;font-size:14px;font-weight:600}

/* ---- コメント(案件・納車待ちの右ペイン)と、共有ボタン ---- */
.cs-rtabs .cs-t-cmt, .cs-rtabs .cs-t-cmt.on { background: var(--hd); border-color: var(--hd); color: #fff; position: relative; } /* CRMのヘッダーの色 */
.cm-tabbadge { display: inline-block; min-width: 18px; padding: 0 5px; margin-left: 6px; border-radius: 999px; background: #dc2626; color: #fff; font-size: 11px; font-weight: 800; line-height: 18px; text-align: center; vertical-align: 1px; }
.cm-tabbadge[hidden] { display: none; }
.cm-badge { display: inline-block; background: #dc2626; color: #fff; border-radius: 999px; padding: 1px 9px; font-size: 11.5px; font-weight: 800; line-height: 1.6; white-space: nowrap; vertical-align: middle; }
.cm-badge.cm-bm, .cm-tabbadge.cm-bm { box-shadow: 0 0 0 2px #fff, 0 0 0 4px #dc2626; }
.cm-sharebtn { margin-left: auto; white-space: nowrap; }
.dw-toprow { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; flex-wrap: wrap; }
.cm-box { display: flex; flex-direction: column; height: max(380px, calc(100vh - var(--cs-used, 200px) - 70px)); min-height: 0; }
.cm-list { flex: 1; min-height: 0; overflow-y: auto; padding: 4px 2px 8px; }
.cm-empty { padding: 18px 8px; text-align: center; }
.cm-c { display: flex; gap: 8px; padding: 8px 4px; border-radius: 10px; transition: background .3s; }
.cm-c.cm-flash { background: #fef9c3; }
.cm-av { flex: 0 0 30px; width: 30px; height: 30px; border-radius: 50%; color: #fff; font-weight: 700; display: grid; place-items: center; font-size: 13px; }
.cm-body { flex: 1; min-width: 0; }
.cm-meta { display: flex; align-items: baseline; gap: 8px; font-size: 13px; }
.cm-txt { white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.55; margin: 2px 0; font-size: 14px; }
.cm-mention { color: #1d4ed8; background: #e0e7ff; border-radius: 4px; padding: 0 3px; font-weight: 600; }
.cm-mention.me { background: #fde68a; color: #92400e; }
.cm-quote { display: block; width: 100%; text-align: left; margin: 3px 0; padding: 4px 8px; border: 0; border-left: 3px solid #cbd5e1; border-radius: 4px; background: #f1f5f9; color: #475569; font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; cursor: pointer; }
.cm-imgs { display: grid; gap: 4px; margin: 4px 0; max-width: 360px; grid-template-columns: repeat(2, 1fr); }
.cm-imgs.n1 { grid-template-columns: 1fr; max-width: 260px; }
.cm-img { padding: 0; border: 1px solid #e2e8f0; border-radius: 8px; overflow: hidden; background: #f1f5f9; cursor: zoom-in; aspect-ratio: 4 / 3; display: block; }
.cm-imgs.n1 .cm-img { aspect-ratio: auto; max-height: 260px; }
.cm-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cm-imgs.n1 .cm-img img { object-fit: contain; }
.cm-rx { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; margin-top: 3px; position: relative; }
.cm-r { padding: 1px 8px; border: 1px solid #d5dce6; border-radius: 999px; background: #fff; font-size: 12.5px; cursor: pointer; line-height: 1.7; }
.cm-r.on { background: #dbeafe; border-color: #60a5fa; color: #1e40af; font-weight: 700; }
.cm-rp { color: #64748b; opacity: 0; transition: opacity .12s; }
.cm-c:hover .cm-rp, .cm-c:focus-within .cm-rp, .cm-rp:focus { opacity: 1; }
@media (hover: none) { .cm-rp { opacity: 1; } }
.cm-radd { position: relative; }
.cm-epop { position: absolute; bottom: 120%; left: 0; z-index: 20; display: flex; gap: 2px; background: #fff; border-radius: 12px; padding: 4px; box-shadow: 0 8px 24px rgba(15, 23, 42, .22); }
.cm-epop button { border: 0; background: transparent; font-size: 20px; padding: 4px 7px; border-radius: 8px; cursor: pointer; }
.cm-epop button:hover { background: #f1f5f9; }
.cm-ops { display: flex; gap: 10px; margin-top: 1px; }
.cm-op { border: 0; background: transparent; padding: 0; color: #64748b; font-size: 12px; cursor: pointer; }
.cm-op:hover { color: var(--primary); text-decoration: underline; }
.cm-op.danger:hover { color: #dc2626; }
.cm-del .cm-body { padding: 2px 0 2px 38px; }
.cm-compose { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 8px; align-items: start; border-bottom: 1px solid var(--line, #e1e6ec); padding-bottom: 8px; margin-bottom: 6px; } /* 入力欄は上(タブのすぐ下)。画面の右下のチャットのアイコンと重ならない */
.cm-compose > .cm-reply, .cm-compose > .cm-prev { grid-column: 1 / -1; }
.cm-reply { display: flex; justify-content: space-between; gap: 8px; align-items: center; background: #f1f5f9; border-left: 3px solid #94a3b8; border-radius: 6px; padding: 4px 8px; font-size: 12px; margin-bottom: 6px; }
.cm-reply[hidden], .cm-prev[hidden], .cm-mpop[hidden] { display: none; }
.cm-x { border: 0; background: transparent; cursor: pointer; color: #64748b; padding: 0 4px; font-size: 14px; }
.cm-prev { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 6px; }
.cm-pv { position: relative; width: 64px; height: 64px; border-radius: 8px; overflow: hidden; background: #f1f5f9; }
.cm-pv img { width: 100%; height: 100%; object-fit: cover; }
.cm-pv .cm-x { position: absolute; top: 2px; right: 2px; background: rgba(15, 23, 42, .65); color: #fff; border-radius: 50%; width: 20px; height: 20px; padding: 0; line-height: 20px; font-size: 11px; }
.cm-inwrap { position: relative; }
.cm-in { width: 100%; min-height: 44px; max-height: 160px; resize: none; line-height: 1.5; }
.cm-mpop { position: absolute; left: 0; top: 100%; z-index: 30; min-width: 180px; max-height: 220px; overflow-y: auto; background: #fff; border-radius: 12px; padding: 4px; box-shadow: 0 8px 24px rgba(15, 23, 42, .22); margin-top: 4px; }
.cm-mo { display: block; width: 100%; text-align: left; border: 0; background: transparent; padding: 6px 10px; border-radius: 8px; font-size: 13.5px; cursor: pointer; }
.cm-mo.on, .cm-mo:hover { background: #e0e7ff; }
.cm-actions { display: flex; flex-direction: column; align-items: stretch; gap: 6px; } /* 画像のボタンは、送信ボタンの上 */
.cm-actions .cm-hint:empty { display: none; }
.cm-lb { position: fixed; inset: 0; z-index: 10000; background: rgba(15, 23, 42, .88); display: grid; place-items: center; cursor: zoom-out; }
.cm-lb img { max-width: 94vw; max-height: 90vh; border-radius: 6px; box-shadow: 0 10px 40px rgba(0, 0, 0, .5); cursor: default; }
.cm-lb button { position: absolute; border: 0; background: rgba(255, 255, 255, .16); color: #fff; width: 44px; height: 44px; border-radius: 50%; font-size: 24px; cursor: pointer; }
.cm-lb button:hover { background: rgba(255, 255, 255, .3); }
.cm-lb-x { top: 16px; right: 16px; } .cm-lb-p { left: 16px; top: 50%; } .cm-lb-n { right: 16px; top: 50%; }
.cm-lb-c { position: absolute; bottom: 16px; left: 50%; transform: translateX(-50%); color: #fff; font-size: 13px; }
/* 納車待ちの詳細: 2ペイン(左: 作業・予実・納車日 / 右: コメント)。スマホは縦に積む */
.dw-page { display: grid; gap: 14px; align-items: start; }
.dw-left { min-width: 0; }
.dw-right { position: sticky; top: 64px; padding: 10px 12px; min-width: 0; }
.dw-cmh { margin: 0 0 6px; font-size: 1rem; }
.dw-right .cm-box { height: calc(100vh - 150px); min-height: 360px; }
.dw-rtabs { display: flex; gap: 4px; background: #eceef4; border-radius: 10px; padding: 3px; margin: 0 0 8px; }
.dw-rtab { flex: 1; border: 0; background: none; border-radius: 8px; padding: 7px 10px; font-size: 14px; font-weight: 700; color: #6b7280; cursor: pointer; }
.dw-rtab.on { background: #fff; color: #be3f8a; box-shadow: 0 1px 3px rgba(0,0,0,.12); }
.dw-acbox { height: calc(100vh - 150px); min-height: 360px; overflow-y: auto; }
@media (max-width: 900px) { .dw-page { grid-template-columns: 1fr !important; } .dw-right { position: static; } .dw-right .cm-box { height: 70vh; } .dw-acbox { height: 70vh; } .cs-chatpane .cm-box { height: 70vh; } }
/* マスター一覧の、選択項目のラベル(指定工場・認証工場・グループ内・外注など) */
.badge.mg-lb-designated { background: #dbeafe; color: #1e40af; }
.badge.mg-lb-certified { background: #dcfce7; color: #166534; }
.badge.mg-lb-outside { background: #e5e7eb; color: #475569; }

/* マスター: 取引先の一覧は、操作を一番右に。行を押すと詳細 */
.mg-tbl.mg-vend th:first-child, .mg-tbl.mg-vend td:first-child { position: static; box-shadow: none; background: inherit; }
.mg-tbl.mg-vend th:last-child, .mg-tbl.mg-vend td:last-child { position: sticky; right: 0; z-index: 2; background: #fff; box-shadow: -1px 0 0 #e3e8ef; text-align: right; }
.mg-tbl.mg-vend thead th:last-child { background: #f5f7fa; z-index: 3; }
.mg-tbl.mg-vend tr.retired td:last-child { background: #f7f7f7; }
.mg-tbl tr.mg-click { cursor: pointer; } .mg-tbl tr.mg-click:hover td { background: #f1f5fb; }
.mg-dl { display: grid; grid-template-columns: 9em 1fr; gap: 8px 12px; margin: 8px 0 12px; } .mg-dl dt { color: #667; font-size: 13px; } .mg-dl dd { margin: 0; word-break: break-all; }

/* 目標(成約/納車) */
.tg-head { align-items: center; gap: 6px; margin: 6px 0 8px; } .tg-head input[type=month] { width: auto; }
.tg-unit { margin: 14px 0; } .tg-unit h4 { margin: 0 0 6px; } .tg-unit.tg-sub { margin-left: 18px; padding-left: 12px; border-left: 3px solid #d5deec; }
.tg-tbl { width: 100%; border-collapse: collapse; } .tg-tbl th, .tg-tbl td { padding: 7px 8px; border-bottom: 1px solid #e3e8ef; text-align: right; white-space: nowrap; } .tg-tbl thead th { background: #f5f7fa; font-size: 12px; } .tg-tbl tbody th { text-align: left; font-weight: 600; }
.tg-tbl td.tg-b { min-width: 170px; text-align: left; } .tg-bar { display: inline-block; vertical-align: middle; width: 110px; height: 12px; border-radius: 6px; background: #e8edf5; overflow: hidden; margin-right: 8px; } .tg-bar i { display: block; height: 100%; border-radius: 6px; background: #2f6fd6; }
.tg-bar.ok i { background: #1f9d55; } .tg-bar.mid i { background: #e0a100; } .tg-bar.low i { background: #d64545; } .tg-bar.blue i { background: #2f6fd6; } .tg-pct { font-variant-numeric: tabular-nums; font-size: 13px; }
.tg-edit td > .tg-in { border: 0; border-bottom: 1px dashed #cfd6df; border-radius: 4px; background: #f6f8fc; padding: 6px 8px; width: 100%; min-width: 110px; text-align: right; font: inherit; } .tg-edit td > .tg-in:hover { background: #eef3fb; } .tg-edit td > .tg-in:focus { background: #fff; border-bottom: 2px solid var(--primary, #1a56c7); outline: none; }
.tg-trow th { font-weight: 400; color: #556; }

.tg-opts { align-items: center; gap: 14px; margin: 6px 0 10px; flex-wrap: wrap; } .tg-pick { border: 2px solid #cfdcf3; border-radius: 10px; padding: 4px 12px; background: #f7faff; }
.tg-unit.tg-per { margin-left: 36px; border-left-color: #b9d8c4; } .tg-prow th { font-weight: 400; color: #556; } .tg-auto { text-align: right; min-height: 1.2em; } .tg-edit td > .tg-in.tg-off { opacity: .45; text-decoration: line-through; }

.tg-row2 { margin-top: 6px; }

/* 試験用(ステージング)環境の表示 */
.stg-bar { background: #f59e0b; color: #1f1500; text-align: center; font-weight: 700; font-size: 13px; padding: 5px 10px; position: sticky; top: 0; z-index: 60; }

/* システム管理メニュー: グループごとに開閉(今いる画面のグループは開いておく) */
.nav-sub > summary { list-style: none; cursor: pointer; padding: 8px 16px; font-size: .85rem; font-weight: 700; color: var(--muted); display: flex; justify-content: space-between; align-items: center; user-select: none; }
.nav-sub > summary::-webkit-details-marker { display: none; }
.nav-sub > summary::after { content: '▸'; font-size: .8em; }
.nav-sub[open] > summary::after { content: '▾'; }
.nav-sub > summary:hover { background: #eef3fb; color: var(--primary); }
.nav-sub + .nav-sub { border-top: 1px solid var(--line); }
.nav .nav-dd-menu .nav-sub a { padding-left: 28px; }
@media (max-width: 720px) {
  .nav-sub > summary { color: #9fb4e6; padding: 12px 4px 12px 22px; border-bottom: 1px solid rgba(255,255,255,.1); }
  .nav-sub > summary:hover { background: rgba(255,255,255,.12); color: #fff; }
  .nav-sub + .nav-sub { border-top: 0; }
  .nav .nav-dd-menu .nav-sub a { padding-left: 38px; }
}

/* PC: 見出しにマウスを乗せると、項目が左横に出る(スマホ・タッチは従来の開閉) */
@media (hover: hover) and (min-width: 721px) {
  #nav-dd-menu { min-width: 170px; }
  .nav-sub { position: relative; }
  .nav-sub > summary::after { content: '◂'; }
  .nav-sub[open] > summary::after { content: '◂'; }
  .nav-sub[open] > summary { background: #eef3fb; color: var(--primary); }
  .nav-sub-list { position: absolute; right: 100%; top: -7px; min-width: 260px; background: #fff; border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 6px 20px #0003; padding: 6px 0; z-index: 31; }
  .nav .nav-dd-menu .nav-sub a { padding-left: 16px; }
}

/* 案件詳細 ⇄ 納車待ち の行き来のボタン(両方の画面で同じデザイン・同じ位置=共有ボタンの左) */
.nav-xbtn { display: inline-flex; align-items: center; gap: 4px; padding: 6px 14px; border: 1px solid var(--primary); border-radius: 8px; background: #fff; color: var(--primary); font-weight: 700; font-size: .9rem; line-height: 1.2; text-decoration: none; white-space: nowrap; cursor: pointer; }
.nav-xbtn:hover { background: var(--primary); color: #fff; }
.nav-xbtn.is-off { border-color: #c9ced6; color: #9aa1ad; background: #f1f3f6; cursor: not-allowed; pointer-events: auto; }
.nav-xbtn.is-off:hover { background: #f1f3f6; color: #9aa1ad; }
.nav-xbtn.sm { padding: 3px 10px; font-size: .85rem; }
.nav-xbtn:not([hidden]) { margin-left: auto; }
.nav-xbtn:not([hidden]) + .cm-sharebtn { margin-left: 0; }

/* 納車待ち・納車済みの一覧: 見出しを固定し、横にスライドしない(列は幅の割合で固定。長い文字は折り返す) */
.dw-list .dw-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; margin: 8px 0 10px; }
.dw-list .dw-bar .cs-search { display: flex; gap: 6px; flex: 1 1 320px; max-width: 560px; }
.dw-list .dw-bar .cs-search input { flex: 1 1 auto; min-width: 0; }
.dw-fix { overflow-x: hidden; overflow-y: auto; max-height: calc(100vh - 260px); }
table.dw-fixed { table-layout: fixed; width: 100%; }
table.dw-fixed th, table.dw-fixed td { overflow-wrap: anywhere; word-break: break-word; vertical-align: middle; }
table.dw-fixed thead th { position: sticky; top: 0; z-index: 5; background: #f6f8fb; }
@media(max-width:600px){ .dw-fix { max-height: none; overflow: visible; } table.dw-fixed { table-layout: auto; } table.dw-fixed thead th { position: static; } }

/* 納車待ち・納車済みの一覧の見出しに色を付ける(システムのヘッダーと同じ色)。先頭の列も同じ色にし、横に固定しない */
table.dw-fixed thead th, table.dw-fixed thead th:first-child { background: #0c4f5c; color: #fff; font-weight: 700; border-bottom: 2px solid #083944; }
table.dw-fixed th:first-child, table.dw-fixed td:first-child { position: static; box-shadow: none; }
table.dw-fixed thead th { position: sticky; top: 0; z-index: 5; }
table.dw-fixed tbody tr:nth-child(even) td { background: #f6fafb; }
table.dw-fixed tbody tr:hover td { background: #e3f1f4; }
/* ヘッダーの固定: 試験用の黄色いバーがあるときは、その下に固定する(同じ位置に重なって、ヘッダーが隠れるのを防ぐ) */
.hd { top: var(--stg-bar-h, 0px); }
/* 予実の差額(実際 − 予測): マイナスは赤の太字 */
.yj-sum .s b.neg { color: #d92d4b; font-weight: 800; } .yj-bar b.neg { color: #ff5470; font-weight: 800; }

/* ===== 車両チェック(納車待ち詳細 > 作業ボード > チェック) ===== */
.vc { display: flex; flex-direction: column; gap: 14px; }
.vc .card { margin: 0; }
.vc-hrow { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.vc-stages { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; }
.vc-stage { display: flex; flex-direction: column; gap: 6px; text-align: left; padding: 10px 12px; border: 2px solid #d9dde7; border-radius: 12px; background: #fff; cursor: pointer; min-width: 0; }
.vc-stage.on { border-color: #be3f8a; box-shadow: 0 0 0 3px rgba(190, 63, 138, .15); }
.vc-stage .vc-sn { display: flex; justify-content: space-between; gap: 6px; font-size: 14px; }
.vc-stage.done { background: #eaf7ee; }
.vc-stage.ready { background: #fff8e1; }
.vc-bar { display: block; height: 6px; background: #e6e9f0; border-radius: 99px; overflow: hidden; }
.vc-bar i { display: block; height: 100%; background: #2f9e5b; }
.vc-ngt { color: #c62828; }
.vc-cols { display: flex; flex-direction: column; gap: 14px; } /* 1カラム: 装備チェック表 → 車両情報・入力欄 → 外装図 → 備考 → 印刷 の順に縦に並べる */
.vc-side { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.vc-mxh { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.vc-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.vc-chip { padding: 6px 12px; border-radius: 99px; border: 1px solid #d9dde7; background: #fff; font-size: 13px; cursor: pointer; }
.vc-chip.on { background: #be3f8a; border-color: #be3f8a; color: #fff; }
.vc-warn { background: #fff4e5; border-radius: 8px; padding: 6px 10px; color: #8a5200; }
.vc-th { display: grid; grid-template-columns: minmax(0, 1fr) 324px; font-size: 12px; font-weight: 700; color: #6b7488; padding: 6px 4px; border-bottom: 2px solid #d9dde7; position: sticky; top: 0; background: #fff; z-index: 1; }
.vc-ths { display: grid; grid-template-columns: repeat(6, 1fr); text-align: center; white-space: nowrap; font-size: 11px; }
.vc-ths .cur { color: #be3f8a; }
.vc-grp { background: #eef1f6; font-weight: 700; font-size: 13px; padding: 5px 8px; margin-top: 8px; border-radius: 6px; }
.vc-row { display: grid; grid-template-columns: minmax(0, 1fr) 324px; align-items: center; padding: 5px 4px; border-bottom: 1px dotted #cfd4de; }
.vc-row.off { opacity: .55; }
.vc-row.bad { background: #fff1f0; }
.vc-nm { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; min-width: 0; }
.vc-eq { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; color: #6b7488; cursor: pointer; white-space: nowrap; }
.vc-cells { display: grid; grid-template-columns: repeat(6, 1fr); gap: 4px; }
.vc-c { height: 34px; border: 1px solid #d9dde7; border-radius: 8px; background: #fff; font-size: 17px; font-weight: 700; cursor: pointer; padding: 0; }
.vc-c.cur { border-color: #be3f8a; border-width: 2px; }
.vc-c.ok { color: #1b7f3e; background: #eaf7ee; }
.vc-c.ng { color: #c62828; background: #fdeaea; }
.vc-c.warn { color: #b26a00; background: #fff3dc; }
.vc-c.na { color: #6b7488; background: #f0f1f5; }
.vc-c:disabled { cursor: default; }
.vc-big { display: none; gap: 6px; flex-wrap: wrap; grid-column: 1 / -1; padding-top: 6px; }
.vc-big-b { flex: 1; min-height: 48px; white-space: nowrap; padding: 0 4px; border: 2px solid #d9dde7; border-radius: 10px; background: #fff; font-size: 15px; font-weight: 700; cursor: pointer; }
.vc-big-b.ok.on { background: #2f9e5b; border-color: #2f9e5b; color: #fff; }
.vc-big-b.ng.on { background: #c62828; border-color: #c62828; color: #fff; }
.vc-big-b.warn { background: #fff; border-color: #d9dde7; color: inherit; }
.vc-big-b.warn.on { background: #e08a00; border-color: #e08a00; color: #fff; }
.vc-big-b:disabled { background: #fff; color: #b5bbc8; border-color: #e3e6ee; cursor: default; }
.vc-offnote { flex-basis: 100%; }
.vc-act { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-top: 12px; }
.vc-kvs { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 4px 12px; margin-bottom: 8px; }
.vc-kv { display: flex; justify-content: space-between; gap: 6px; font-size: 13px; border-bottom: 1px dotted #cfd4de; padding: 2px 0; }
.vc-auto { color: #6b7488; }
.vc-sec > summary { cursor: pointer; padding: 2px 0; }
.vc-fg { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px 12px; margin-top: 8px; }
.vc-f { display: flex; flex-direction: column; gap: 2px; font-size: 12px; color: #6b7488; }
.vc-f .ie { font-size: 14px; color: #1f2937; }
#vc-car { max-width: 420px; display: block; margin: 0 auto 8px; touch-action: manipulation; cursor: crosshair; }
.vc-pin circle { stroke: #fff; stroke-width: 3; cursor: pointer; }
.vc-pin text { fill: #fff; pointer-events: none; }
.vc-pin.open circle { fill: #c62828; }
.vc-pin.requested circle { fill: #2563eb; }
.vc-pin.done circle { fill: #2f9e5b; }
.vc-pinrow { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; padding: 8px; border: 0; border-bottom: 1px dotted #cfd4de; background: none; cursor: pointer; }
.vc-pn { flex: none; width: 26px; height: 26px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; color: #fff; font-weight: 700; background: #c62828; }
.vc-pn.requested { background: #2563eb; } .vc-pn.done { background: #2f9e5b; }
.vc-pt { flex: 1; min-width: 0; display: flex; flex-direction: column; font-size: 13px; }
.vc-pt small { color: #6b7488; }
.vc-ps { flex: none; font-size: 12px; font-weight: 700; color: #c62828; }
.vc-ps.requested { color: #2563eb; } .vc-ps.done { color: #2f9e5b; }
.vc-kinds { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.vc-kind span { display: inline-block; padding: 8px 14px; border: 2px solid #d9dde7; border-radius: 10px; cursor: pointer; }
.vc-kind input { position: absolute; opacity: 0; }
.vc-kind input:checked + span { border-color: #be3f8a; background: #fbeaf4; font-weight: 700; }
.vc-ph { display: flex; gap: 8px; flex-wrap: wrap; margin: 8px 0; }
.vc-phi { position: relative; }
.vc-phi img { width: 96px; height: 96px; object-fit: cover; border-radius: 8px; }
.vc-phx { position: absolute; top: 2px; right: 2px; }
.vc-note { display: flex; gap: 10px; align-items: flex-start; padding: 6px 0; border-bottom: 1px dotted #cfd4de; }
.vc-nd { flex: none; width: 48px; font-weight: 700; font-size: 13px; }
.vc-nt { flex: 1; min-width: 0; display: flex; flex-direction: column; font-size: 14px; }
.vc-nt small { color: #6b7488; }
.vc-rm { flex: none; border: 0; background: none; color: #c62828; font-size: 18px; cursor: pointer; }
@media (max-width: 1000px) { .vc-stages { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 700px) {
  .vc-th, .vc-cells { display: none; }
  .vc-row { grid-template-columns: 1fr; padding: 8px 4px; }
  .vc-big { display: flex; }
  .vc-fg, .vc-kvs { grid-template-columns: 1fr; }
  .vc-stages { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.vc-yr { display: flex; align-items: center; gap: 10px; }
.vc-yr .ie { width: 6em; }
.vc-wa { font-size: 13px; color: #1f2937; white-space: nowrap; }
.vc-memo-b { grid-column: 1 / -1; text-align: left; background: none; border: 0; padding: 2px 4px; margin: 2px 0 0; font-size: 12px; color: #6b7488; cursor: pointer; border-radius: 6px; }
.vc-memo-b.has { color: #1f2937; background: #fff8e1; padding: 4px 8px; font-size: 13px; }
.vc-memo-t { grid-column: 1 / -1; width: 100%; font-size: 14px; margin-top: 4px; }
.vc-row.off .vc-c, .vc-row.off .vc-c.ok, .vc-row.off .vc-c.ng, .vc-row.off .vc-c.na, .vc-row.off .vc-c.warn, .vc-row.off .vc-c.cur { background: #fff; color: transparent; border-color: #e3e6ee; }
.vc-bigdone { min-height: 52px; padding: 0 22px; font-size: 16px; font-weight: 700; }
.vc-cdone { color: #1b7f3e; margin: 0 0 4px; }
@media (max-width: 700px) { .vc-bigdone { width: 100%; } }
.act-cmt { margin-top: 6px; padding: 8px 10px; background: #f4f6fa; border-left: 3px solid #5b7bd5; border-radius: 6px; white-space: pre-wrap; word-break: break-word; font-size: 13px; }
.vc-stage.skip { background: #eceef2; border-color: #dfe3ea; color: #9aa3b2; opacity: .7; cursor: not-allowed; }
.vc-stage.skip .vc-bar i { background: transparent; }
.vc-ths .skipc, .vc-c.skipc { background: #eceef2; color: transparent; border-color: #e3e6ee; cursor: not-allowed; }
.vc-ths .skipc { color: #b3bac6; text-decoration: line-through; background: transparent; }
.vc-same { display: flex; gap: 8px; align-items: flex-start; flex-wrap: wrap; padding: 10px 12px; margin: 8px 0; background: #f4f6fa; border-radius: 8px; }
.vc-same { flex-wrap: nowrap !important; } .vc-same input { margin-top: 5px; flex: none; } .vc-samet { flex: 1; min-width: 0; line-height: 1.5; }
.vc { padding-bottom: 84px; }
.vc-save { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(14px + env(safe-area-inset-bottom, 0px)); z-index: 30; display: flex; align-items: center; gap: 12px; padding: 8px 8px 8px 16px; background: rgba(255,255,255,.96); border: 1px solid #cfd6e4; border-radius: 99px; box-shadow: 0 6px 22px rgba(20,30,60,.22); max-width: calc(100vw - 24px); }
.vc-save .small { color: #596579; white-space: nowrap; } .vc-save .small.bad { color: #c0392b; font-weight: 700; }
.vc-save button { border-radius: 99px; padding: 10px 22px; font-weight: 700; white-space: nowrap; }
@media print { .vc-save { display: none !important; } }

/* システム管理 > 納車タスク(パターン方式の出し分け設定) */
.dta-layout { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 16px; align-items: start; }
@media (max-width: 860px) { .dta-layout { grid-template-columns: 1fr; } }
.dta-list { display: flex; flex-direction: column; gap: 6px; margin-top: 10px; }
.dta-pat { display: flex; flex-direction: column; gap: 1px; width: 100%; text-align: left; border: 2px solid transparent; background: #f1f3f8; border-radius: 12px; padding: 9px 12px; cursor: pointer; font: inherit; color: inherit; }
.dta-pat.on { border-color: #be3f8a; background: #fbe9f3; }
.dta-pat b { font-size: 14px; }
.dta-ed { min-width: 0; }
.dta-head { gap: 6px; }
input.ie.dta-pname { font-size: 18px; font-weight: 700; flex: 1; min-width: 200px; width: auto; }
.dta-cond { display: flex; flex-direction: column; gap: 8px; margin: 8px 0; }
.dta-crow { display: flex; gap: 8px; align-items: flex-start; flex-wrap: wrap; background: #f1f3f8; border-radius: 12px; padding: 8px 10px; }
.dta-crow select { width: auto; min-width: 100px; }
.dta-and { font-size: 11px; font-weight: 700; color: var(--muted); padding: 0 4px; }
.dta-vals { flex: 1; min-width: 180px; display: flex; flex-direction: column; gap: 6px; }
.dta-chips { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.dta-chip { border: 0; border-radius: 999px; padding: 4px 12px; font: inherit; font-size: 13px; background: #fff; color: inherit; box-shadow: inset 0 0 0 1px var(--line); cursor: pointer; }
.dta-chip.on { background: #be3f8a; color: #fff; box-shadow: none; font-weight: 700; }
input.ie.dta-word { width: 170px; }
.dta-x { border: 0; background: none; color: var(--muted); font-size: 18px; line-height: 1; padding: 2px 6px; border-radius: 8px; cursor: pointer; }
.dta-x:hover { background: #fff; }
.dta-menu { position: relative; display: inline-block; }
.dta-pop { position: absolute; z-index: 20; top: 110%; left: 0; min-width: 240px; background: #fff; border-radius: 14px; box-shadow: 0 10px 30px #0003; padding: 6px; max-height: 300px; overflow: auto; }
.dta-pop button { display: flex; justify-content: space-between; gap: 10px; width: 100%; border: 0; background: none; text-align: left; padding: 8px 10px; border-radius: 8px; font: inherit; font-size: 13px; cursor: pointer; }
.dta-pop button:hover { background: #f1f3f8; }
.dta-card { display: flex; gap: 6px; align-items: flex-start; }
.dta-grab { color: var(--muted); cursor: grab; user-select: none; padding-top: 6px; }
.dta-nm { flex: 1; min-width: 0; }
.dta-nm input.ie { font-weight: 600; font-size: 13px; padding: 4px 4px; }
.dta-add { display: flex; gap: 6px; flex-wrap: wrap; }
.dta-mk { background: #fff; border: 2px solid #be3f8a; border-radius: 14px; padding: 10px; display: flex; flex-direction: column; gap: 8px; }
.dta-vars button { border: 0; background: #fbe9f3; color: #be3f8a; border-radius: 999px; font-size: 11px; padding: 2px 9px; font-weight: 700; cursor: pointer; margin-left: 4px; }
.dta-dim { opacity: .55; }
.dta-empty { border: 2px dashed var(--line); border-radius: 12px; padding: 14px 8px; text-align: center; }
.dta-foot { margin-top: 14px; }
.dta-sv { color: var(--warn); }
.dta-sim { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; margin-top: 10px; }
.dta-sim label { display: flex; flex-direction: column; gap: 2px; }
.dta-layout aside { position: sticky; top: 8px; }
.dta-list { max-height: 72vh; overflow-y: auto; padding-right: 4px; }
@media (max-width: 860px) { .dta-layout aside { position: static; } .dta-list { max-height: 40vh; } }

/* スマホ(iPhone 14 = 幅390px 基準): ボタンから文字がはみ出さない・縦書きにならない */
@media (max-width: 600px) {
  button, .btn { max-width: 100%; overflow-wrap: anywhere; }
  .dw-seg { display: flex; width: 100%; }
  .dw-seg .dw-tab { flex: 1 1 0; min-width: 0; flex-direction: column; align-items: center; justify-content: center; gap: 3px; padding: 7px 2px; font-size: 14px; white-space: nowrap; text-align: center; line-height: 1.25; }
  .dw-seg .dw-open { font-size: 11px; padding: 1px 7px; white-space: nowrap; }
  .dw-ttabs { display: flex; flex-wrap: wrap; gap: 4px 8px; }
  .dw-ttab { font-size: 14px; padding: 8px 6px; white-space: nowrap; }
  .dw-pill { font-size: 11px; white-space: nowrap; }
  .dw-toprow { flex-wrap: wrap; gap: 6px 10px; }
  .dw-toprow .btn, .dw-toprow button { font-size: 13px; padding: 6px 10px; }
  .vc-big-b { font-size: 13px; padding: 0 2px; }
  .vc-act button, .vc-act .btn { font-size: 13px; }
  .vc-stage .vc-sn { font-size: 13px; }
  .dw-tab, .vc-chip, .dw-add { font-size: 13px; }
}

/* 案件詳細ページ: スマホ・タブレット(幅1023px以下)は、3列を縦に並べる(モーダルにしない) */
@media (max-width: 1023px) {
  .cs-page { display: flex; flex-direction: column; height: auto; min-height: 0; gap: 12px; }
  .cs-page .cs-pane { overflow: visible; }
  .cs-ph { position: static; }
  .cs-pane .cs-dgrid { grid-template-columns: 7em minmax(0, 1fr); }
  .cs-chatpane .lc-list { max-height: 60vh; }
  .cs-pagebar { flex-wrap: wrap; }
  .cs-head .cs-pagebar .btn, .cs-head .cs-pagebar button { font-size: 13px; padding: 6px 10px; }
  .cs-hname { font-size: 1.25em; overflow-wrap: anywhere; }
  .cs-hl1, .cs-hl2 { flex-wrap: wrap; gap: 2px 10px; overflow-wrap: anywhere; }
}
@media (max-width: 600px) {
  .cs-acts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
  .cs-acts .cs-act { white-space: normal; font-size: .85rem; padding: 8px 2px; line-height: 1.25; overflow-wrap: anywhere; }
}

/* ロゴ(ヘッダーは濃い背景なので白のロゴ、ログイン画面は明るい背景なのでカラーのロゴ) */
.brand { display: flex; align-items: center; }
.brand img { height: 30px; width: auto; display: block; }
.logo-h1 { margin: 0 0 14px; line-height: 0; }
.logo-h1 img { height: 56px; width: auto; max-width: 100%; }

/* システム管理「メニュー設定」: 名前は、枠なしで、その場で書き換える(押すと薄く色が付く)。スマホ(幅390px)は、名前の下にボタンを並べる */
.mn-list { display: flex; flex-direction: column; border-top: 1px solid var(--line); }
.mn-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 12px; padding: 8px 4px 8px calc(4px + var(--d, 0) * 22px); border-bottom: 1px solid #e8edf3; }
.mn-row.off { background: #f6f7f9; } .mn-row.off .mn-lab { color: #8a94a3; text-decoration: line-through; }
.mn-main { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 12px; flex: 1 1 260px; min-width: 0; }
.mn-lab { flex: 1 1 140px; min-width: 0; width: auto; font: inherit; font-weight: 600; color: inherit; background: transparent; border: 0; border-radius: 6px; padding: 8px 8px; box-shadow: none; }
.mn-lab:hover { background: #f0f4fa; } .mn-lab:focus { background: #e8f0fd; outline: 2px solid #9db8e8; }
.mn-lab::placeholder { color: #9aa4b2; font-weight: 400; }
.mn-page { flex: 1 1 220px; min-width: 0; max-width: 100%; }
.mn-note { white-space: nowrap; }
.mn-btns { display: flex; flex-wrap: wrap; gap: 4px; }
.mn-btns button { white-space: nowrap; min-width: 40px; padding: 7px 10px; background: #fff; color: #234; border: 1px solid #c7d0dc; border-radius: 8px; font: inherit; font-size: .9rem; cursor: pointer; }
.mn-btns button:hover:not(:disabled) { background: #eef3fb; } .mn-btns button:disabled { opacity: .35; cursor: default; }
.mn-btns .mn-eye { min-width: 64px; } .mn-btns .mn-del { color: #b3261e; border-color: #e2b4b0; }
.mn-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }
.mn-dirty { color: #b25e00; font-weight: 600; }
@media (max-width: 600px) { .mn-row { padding-left: calc(2px + var(--d, 0) * 14px); } .mn-btns { width: 100%; } .mn-btns button { flex: 1 1 0; padding-left: 6px; padding-right: 6px; } .mn-btns .mn-eye, .mn-btns .mn-del { flex: 1.5 1 0; }  }

.nav .nav-dd-menu a.lv-2 { padding-left: 30px; } .nav .nav-dd-menu a.lv-3 { padding-left: 44px; }
@media (max-width: 720px) { .nav .nav-dd-menu a.lv-2 { padding-left: 36px !important; } .nav .nav-dd-menu a.lv-3 { padding-left: 50px !important; } }

/* ドラッグ&ドロップ(dnd.js): 置く位置の線・つかんだ物の表示。一覧の中には何も挿さないので、並びがずれない */
.dnd-line { position: fixed; height: 4px; border-radius: 2px; background: #2f6fe0; box-shadow: 0 0 0 2px rgba(47,111,224,.25); z-index: 9998; pointer-events: none; display: none; }
.dnd-ghost { position: fixed; z-index: 9999; pointer-events: none; background: #fff; color: #1a2b44; border: 1px solid #2f6fe0; border-radius: 8px; padding: 6px 12px; font-size: .9rem; box-shadow: 0 6px 18px rgba(0,0,0,.2); max-width: 70vw; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dnd-over { outline: 2px dashed #2f6fe0; outline-offset: 2px; border-radius: 8px; }
body.dnd-on, body.dnd-on * { cursor: grabbing !important; user-select: none; -webkit-user-select: none; }
.fm-grip { touch-action: none; padding: 6px 10px; }
.fm-pi { touch-action: manipulation; -webkit-touch-callout: none; user-select: none; -webkit-user-select: none; }
.fm-hd { -webkit-touch-callout: none; }

/* ホーム画面のウィジェット(home.js): 正方形の「マス」を敷き、1つのウィジェットが「横×縦」のマス数を使う */
.hm-bar-top { display: flex; justify-content: flex-end; margin: 0 0 8px; }
.hm-wrap { width: 100%; }
.hm-grid { display: grid; grid-template-columns: repeat(var(--c, 1), minmax(0, 1fr)); grid-auto-rows: minmax(var(--cell, 72px), auto); grid-auto-flow: row dense; gap: 12px; }
.hm-it { min-width: 0; container-type: inline-size; container-name: hmw; position: relative; }
.hm-it > .card, .hm-it > .hm-w { margin: 0; box-sizing: border-box; }
.hm-it > .card:only-child, .hm-it > .hm-w { height: 100%; } /* 複数のカードを並べる部品(営業ダッシュボード等)は、先頭のカードを枠いっぱいに伸ばさない */
.hm-it > .card + *, .hm-it > * + .card { margin-top: 12px; }
.hm-it.fix { overflow: hidden; contain: size; }
.hm-it.fix > .card { overflow: auto; }
.hm-it.fix:has(> .card + *) { overflow: auto; }
.hm-it.fix .hm-w { display: flex; flex-direction: column; }
.hm-it.fix .hm-b { flex: 1 1 0; min-height: 0; overflow: auto; }
/* 自分で作るウィジェット: 枠(マス)の大きさに合わせて、文字・余白の大きさが変わる */
.hm-it.own { font-size: clamp(12px, calc(var(--cell, 72px) * .1 * var(--k, 1)), 30px); }
.hm-it.own .small { font-size: .85em; }
.hm-it.own .hm-w { padding: clamp(8px, calc(var(--cell, 72px) * .12), 18px); }
.hm-w { min-width: 0; }
.hm-w .hm-t { margin: 0 0 .5em; font-size: 1.05em; line-height: 1.3; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hm-b { min-width: 0; }
.hm-sub { margin-bottom: .4em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hm-mets { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 7em), 1fr)); gap: .8em; }
.hm-met { min-width: 0; }
.hm-ml { font-size: .85em; color: #5b6b80; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hm-mv { font-size: 1.7em; font-weight: 700; line-height: 1.25; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hm-met.hm-only .hm-mv { font-size: 2.3em; }
.hm-x { overflow: hidden; text-overflow: ellipsis; }
.hm-bar { position: relative; height: .6em; min-height: 6px; border-radius: 4px; background: #e3e9f2; margin: .4em 0 .3em; }
.hm-bar i { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 4px; background: #2f6fe0; }
.hm-bar b { position: absolute; top: -3px; bottom: -3px; width: 2px; background: #e07b2f; }
.hm-cases, .hm-links { list-style: none; margin: 0; padding: 0; }
.hm-cases li, .hm-links li { padding: .4em 0; border-bottom: 1px solid #eef1f6; min-width: 0; }
.hm-cases li:last-child, .hm-links li:last-child { border-bottom: 0; }
.hm-cases a { display: flex; gap: .2em .6em; align-items: baseline; text-decoration: none; color: inherit; min-width: 0; }
.hm-cases a > b { flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hm-cases a > .small { flex: 1 1 0; min-width: 0; white-space: nowrap; }
.hm-cases a > .badge { flex: none; }
.hm-links a { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hm-memo { white-space: pre-wrap; overflow-wrap: break-word; word-break: normal; line-break: strict; }
/* 枠が狭いとき(1〜2マス): 補足を省いて、主な内容だけをきれいに出す(1文字ずつ縦に折り返さない) */
@container hmw (max-width: 190px) {
  .hm-mv { font-size: 1.35em; }
  .hm-met.hm-only .hm-mv { font-size: 1.7em; }
  .hm-x, .hm-cases .badge { display: none; }
  .hm-it.own .hm-w { padding: 8px; }
  .hm-mets { grid-template-columns: 1fr; gap: .5em; }
}
@container hmw (max-width: 120px) {
  .hm-w .hm-t { font-size: .9em; }
  .hm-sub { display: none; }
  .hm-mv { font-size: 1.15em; }
}
/* 編集画面 */
.hm-edit-wrap { display: grid; grid-template-columns: 17em minmax(0, 1fr); gap: 12px; margin-top: 12px; align-items: start; }
.hm-pool .hm-pi { display: flex; justify-content: space-between; gap: 8px; align-items: center; padding: 8px 0; border-bottom: 1px solid #eef1f6; }
.hm-stage { min-width: 0; }
.hm-phone-bar { margin-bottom: 6px; }
.hm-frame { border: 2px dashed #c3cee0; border-radius: 10px; padding: 10px; background: #f6f8fc; min-height: 8em; }
.hm-stage.sp .hm-frame { width: 390px; max-width: 100%; margin: 0 auto; border-style: solid; border-radius: 22px; padding: 14px 10px; box-sizing: border-box; }
.hm-tool { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; padding: 10px 12px; margin-bottom: 8px; }
.hm-tn { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hm-tr { display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.hm-tool select { width: auto; min-width: 3.5em; }
.hm-tool button, .hm-tool label { white-space: nowrap; }
.hm-tnote { flex-basis: 100%; }
.hm-ed { background: #fff; border: 1px solid #d7deea; border-radius: 8px; padding: 8px 10px; cursor: pointer; overflow: hidden; min-width: 0; display: flex; flex-direction: column; gap: 2px; font-size: .9rem; }
.hm-ed:focus-visible { outline: 2px solid #2f6fe0; outline-offset: 2px; }
.hm-ed.sel { outline: 3px solid #2f6fe0; outline-offset: -1px; background: #eef4ff; }
.hm-ed b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hm-ed .sz { color: #2f6fe0; font-weight: 700; white-space: nowrap; }
.hm-ed .hm-x { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
@container hmw (max-width: 120px) { .hm-ed .hm-x { display: none; } }
.hm-empty { border: 2px dashed #c3cee0; border-radius: 8px; padding: 18px 8px; text-align: center; }
.hm-form label { display: block; margin-top: 8px; font-size: .85rem; color: #5b6b80; }
.hm-form label.chk { display: flex; gap: 6px; align-items: center; color: inherit; }
.hm-pv { max-width: 100%; border: 2px dashed #c3cee0; border-radius: 10px; padding: 10px; background: #f6f8fc; box-sizing: content-box; }
.hm-lrow { display: flex; gap: 6px; align-items: center; margin: 4px 0; flex-wrap: wrap; }
.hm-lrow .ie { flex: 1 1 8em; min-width: 0; }
.hm-pi button { white-space: nowrap; flex: none; }
@media (max-width: 700px) {
  .hm-edit-wrap { grid-template-columns: minmax(0, 1fr); }
  .hm-pool { order: 2; }
}
.hm-form select[data-pz] { width: auto; min-width: 4.5em; }

/* 月次売上入力: 表のセルは枠なし。ホバーで薄く色が付き、クリックでその場で直接入力する */
.mi{display:flex;flex-direction:column;gap:12px}
.mi-bar{display:flex;flex-wrap:wrap;gap:10px;align-items:center}.mi-bar h2{margin:0}
.mi-bar select{font:inherit;padding:6px 10px;border:1px solid var(--line);border-radius:8px;background:var(--card);color:var(--text)}
.mi-mv{border:1px solid var(--line);background:var(--card);color:var(--text);border-radius:8px;width:32px;height:32px;font-size:1.1rem;cursor:pointer}
.mi-mon{min-width:6.5em;text-align:center}
.mi-badge{border-radius:999px;padding:2px 12px;font-weight:700;font-size:.8rem}.mi-badge.open{background:#e8f0fe;color:var(--primary)}.mi-badge.lock{background:#ffe3ea;color:#8a1f45}
.mi-sp{flex:1}.mi-saved{font-size:.8rem;color:var(--ok)}.mi-saved.bad{color:var(--danger);font-weight:700}
.mi-btn{border:1px solid var(--line);background:var(--card);color:var(--text);border-radius:999px;padding:6px 16px;font:inherit;cursor:pointer}.mi-btn.pk{background:#ffdde6;border-color:#f2a9bd;color:#8a1f45;font-weight:700}
.mi-tiles{display:grid;grid-template-columns:repeat(4,1fr);gap:10px}
.mi-tile{background:var(--card);border:1px solid var(--line);border-radius:10px;padding:8px 12px}.mi-tile.sum{border:2px solid var(--hd)}
.mi-tile .l{font-size:.75rem;color:var(--muted)}.mi-tile .v{font-size:1.25rem;font-weight:800;text-align:right;font-variant-numeric:tabular-nums}.mi-tile .v small{font-size:.75rem;margin-left:2px}
.mi-sec h2{color:var(--hd);margin:0 0 2px}.mi-sec p{margin:0 0 8px}
.mi-tw{overflow-x:auto}.mi-t{border-collapse:collapse;width:100%}
.mi-t th{background:#dbe6f8;font-size:.78rem;font-weight:800;text-align:left;padding:6px 8px;white-space:nowrap;color:#1d2733}.mi-t th.r{text-align:right}
.mi-t td{border-bottom:1px solid var(--line);padding:0}.mi-no{width:30px;text-align:center;color:var(--muted);font-size:.78rem}.mi-x{width:34px;text-align:center}
.mi-calc{text-align:right;padding:6px 8px!important;font-variant-numeric:tabular-nums}
.mi-ce{width:100%;min-width:0;font:inherit;color:var(--text);background:transparent;border:0;border-radius:0;padding:8px;outline:0}.mi-ce.r{text-align:right;font-variant-numeric:tabular-nums}
.mi-t td:hover .mi-ce:not(:disabled){background:#eef3fe}.mi-ce:focus{background:#eef3fe!important;box-shadow:inset 0 -2px 0 var(--primary)}
.mi-ce:disabled{color:var(--text);-webkit-text-fill-color:var(--text);opacity:1}
.mi-neg{color:var(--danger)!important;font-weight:700}
.mi-t tr.mi-bad td{background:#fde8ea}.mi-err{color:var(--danger);font-size:.8rem;font-weight:700;padding:4px 8px}.mi-err:empty{display:none}
.mi-warn{color:#5a4300;background:#fff7e0;font-size:.75rem;padding:1px 6px;border-radius:6px;margin-left:6px}
.mi-del{border:0;background:transparent;color:var(--muted);font-size:1.1rem;line-height:1;padding:4px 8px;border-radius:6px;opacity:.5;cursor:pointer}.mi-t tr:hover .mi-del{opacity:1}.mi-del:hover:not(:disabled){color:var(--danger);background:#eef3fe}
.mi-t tfoot td{border-top:2px solid var(--text);font-weight:800;padding:7px 8px;text-align:right;font-variant-numeric:tabular-nums}.mi-t tfoot td:first-child{text-align:left}
.mi-foot{margin-top:8px}.mi-add{border:1px dashed var(--line);background:var(--card);color:var(--primary);border-radius:999px;padding:5px 14px;font:inherit;font-size:.85rem;cursor:pointer}.mi-add:disabled,.mi-btn:disabled{opacity:.5;cursor:not-allowed}
@media (max-width:700px){
 .mi-tiles{grid-template-columns:1fr 1fr}.mi-tw{overflow:visible}
 .mi-t,.mi-t tbody,.mi-t tr,.mi-t td,.mi-t tfoot{display:block;width:100%}.mi-t thead{display:none}
 .mi-t tbody tr{border:1px solid var(--line);border-radius:10px;margin:0 0 10px;padding:6px 10px;position:relative}
 .mi-t td{border:0;display:flex;align-items:center;gap:8px;padding:0}.mi-t td::before{content:attr(data-l);flex:0 0 5.2em;font-size:.75rem;color:var(--muted)}
 .mi-no{display:none!important}.mi-x{position:absolute;right:4px;top:2px;width:auto!important}.mi-x::before{display:none!important}
 .mi-calc{padding:8px!important;justify-content:space-between}
 .mi-ce{border-bottom:1px dashed var(--line)}
 .mi-t tfoot tr{display:flex;justify-content:space-between;border-top:2px solid var(--text);padding:8px 4px}.mi-t tfoot td{display:block;width:auto;border:0;padding:0}.mi-t tfoot td::before{display:none}.mi-t tfoot td.mi-e{display:none}
}
/* 月次売上入力のセル: システム共通の入力欄の見た目(薄い灰色の塗り・角丸・枠)を使わず、枠なしで直接編集できる見た目にする */
.mi .mi-ce,.mi .mi-ce:hover:not(:focus):not([disabled]),.mi .mi-ce[disabled]{background:transparent;border:0;border-radius:0;box-shadow:none;padding:8px;color:var(--text);-webkit-text-fill-color:var(--text);line-height:1.4}
.mi .mi-t td:hover .mi-ce:not([disabled]){background:#eef3fe}
.mi .mi-ce:focus{background:#eef3fe;border:0;border-radius:0;box-shadow:inset 0 -2px 0 var(--primary)}
.mi .mi-t tr.mi-bad .mi-ce{background:transparent}
.mi-bar select{padding:6px 34px 6px 10px;border:1px solid var(--line);border-radius:8px;background-color:var(--card)}
@media (max-width:700px){.mi .mi-ce,.mi .mi-ce:hover:not(:focus):not([disabled]),.mi .mi-ce[disabled]{border-bottom:1px dashed var(--line)}.mi .mi-ce:focus{border-bottom:1px solid var(--primary)}}
.dw-fgrid .dw-out{display:block;padding:8px 10px;border-radius:8px;background:#f1f5f9;color:#0f172a;font-size:14px;font-weight:600;min-height:38px}
.dw-fgrid .dw-gk{display:flex;flex-direction:column;gap:4px;justify-content:flex-end;font-size:13px;padding-bottom:6px}
.dw-fgrid .dw-gk .chk{display:flex;flex-direction:row;align-items:center;gap:6px;color:var(--text,#0f172a)}
.yj3 tr.sub td{color:var(--muted,#64748b);font-size:.92em}.yj3 tr.tot td{border-top:2px solid var(--line,#e2e8f0)}

/* 月次売上入力: 店舗の選択欄を目立たせる / 保存ボタン / 確認ダイアログ */
.mi-store-band{display:flex;flex-wrap:wrap;align-items:center;gap:10px 14px;padding:12px 16px;margin-bottom:12px;border:2px solid var(--primary,#2a6df4);border-radius:12px;background:color-mix(in srgb,var(--primary,#2a6df4) 9%,var(--card))}
.mi-store-l{font-weight:700;font-size:.95rem;color:var(--primary,#2a6df4);white-space:nowrap}
.mi-store-band select{font:inherit;font-size:1.1rem;font-weight:700;padding:9px 38px 9px 14px;min-width:min(100%,260px);max-width:420px;border:2px solid var(--primary,#2a6df4);border-radius:10px;background-color:var(--card);color:var(--text)}
.mi-store-one{font-size:1.15rem}.mi-store-h{font-size:.8rem;color:var(--muted)}
.mi-btn.sv{background:var(--primary,#2a6df4);border-color:var(--primary,#2a6df4);color:#fff;font-weight:700}
.mi-btn.sv.dirty{box-shadow:0 0 0 3px color-mix(in srgb,var(--primary,#2a6df4) 35%,transparent)}.mi-btn.sv:disabled{opacity:.6}
.mi-dlg-m{padding:6px 2px}.mi-dlg-t{font-size:1.05rem;font-weight:700;margin:0 0 8px}.mi-dlg-b{font-size:1.2rem;font-weight:700;margin:0 0 10px}
@media (max-width:600px){.mi-store-band select{width:100%}}

/* ===== ボタンを、ボタンと分かる見た目に(白地に白いボタンで見失う問題)+ スマホで文字が縦に折れる問題 ===== */
button:where(:not([class])), button.sm, button.danger, .btn, button.warn {
  background: #eaf1fd; border: 1px solid #8fb0e6; color: var(--primary-d, #164a96); font-weight: 600;
  box-shadow: 0 1px 0 rgba(31, 95, 191, .16);
}
button:where(:not([class])):where(:hover), button.sm:hover, button.danger:hover, .btn:hover, button.warn:hover { background: #d9e6fb; }
button:where(:not([class])):where(:active), button.sm:active, button.danger:active, .btn:active { transform: translateY(1px); box-shadow: none; }
button.danger { background: #fdecea; border-color: #e3a29a; color: var(--danger, #c0392b); }
button.danger:hover { background: #fadbd7; }
button.warn { background: #fff0d6; border-color: #e6c68a; color: #8a5200; }
button.primary { box-shadow: 0 1px 0 rgba(0, 0, 0, .2); }
button:disabled { box-shadow: none; }
/* 文字だけのボタン(編集・削除・返信 など)も、枠と色をつけてボタンと分かるように */
.lnk { background: #eaf1fd; border: 1px solid #b7cdf0; border-radius: 6px; padding: 2px 9px; color: var(--primary-d, #164a96); font-weight: 600; }
.lnk:hover { background: #d9e6fb; text-decoration: none; }
/* 日本語のボタンの文字を、1字ずつ縦に折らない */
button, .btn { word-break: keep-all; overflow-wrap: break-word; }
.ch-tabs, .ac-tabs, .dw-tabs, .dw-rtabs { overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
.ch-tabs::-webkit-scrollbar, .ac-tabs::-webkit-scrollbar, .dw-tabs::-webkit-scrollbar, .dw-rtabs::-webkit-scrollbar { display: none; }
.ch-tabs > *, .ac-tabs > *, .dw-tabs > *, .dw-rtabs > * { flex: 0 0 auto; white-space: nowrap; }
@media (max-width: 640px) {
  button.sm, .lnk { min-height: 32px; }
  button.sm { padding: 6px 12px; }
  .row { gap: 8px; }
}

/* スマホ: 縦書きのように1字ずつ折れる問題(mobilefix.js が見つけた枠に付くクラス + 表の列の最低幅) */
@media (max-width: 640px) {
  .vfix-wrap { flex-wrap: wrap !important; }
  .vfix-item { min-width: 7em !important; flex: 0 0 auto !important; max-width: 100%; }
  .tbl-wrap th, .tbl-wrap td { min-width: 4.6em; }
}

/* スマホのチャット: キーボードが出てもヘッダーを画面の上に残す(kbfix.js が見えている範囲を --vvh / --vvt に入れる) */
@media (max-width: 760px) {
  html.kb-fix, html.kb-fix body { overflow: hidden; overscroll-behavior: none; }
  html.kb-fix body { position: fixed; left: 0; right: 0; top: var(--vvt, 0px); height: var(--vvh, 100dvh); width: 100%; }
  html.kb-fix main > .chat:not(.embedded) { height: calc(var(--vvh, 100dvh) - var(--hd-h, 52px)); }
}

/* スマホ: ヘッダーを細く(高さ 52px → 40px)。アイコンも少し小さく */
@media (max-width: 720px) {
  .hd-in { min-height: 40px; padding-left: 12px; padding-right: 6px; }
  .brand { padding: 3px 0; font-size: .9rem; }
  .brand img { height: 22px; }
  .hd-chat, .hd-crm { width: 36px; height: 36px; }
  .hd-chat svg, .hd-crm svg { width: 23px; height: 23px; }
  .hd-dot { top: 4px; right: 4px; }
  .menu-btn { width: 36px; height: 36px; gap: 4px; padding: 0 8px; }
  .menu-open .menu-btn span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
  .menu-open .menu-btn span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }
}

/* ---- おすすめ車両(案件の右ペインのタブ): 画像つきのカードを縦に並べる ---- */
.cs-rtabs .cs-t-veh { background: #fff7ed; color: #9a3412; border-color: #fdba74; }
.cs-rtabs .cs-t-veh.on { background: #ea580c; border-color: #ea580c; color: #fff; }
.rv { padding: 10px; display: flex; flex-direction: column; gap: 10px; }
.rv-tabs { display: flex; flex-wrap: wrap; gap: 6px; } /* 横スライドは気付きにくいので、折り返して全部見せる */
.rv-tabs button { white-space: nowrap; border-radius: 999px; }
.rv-tabs button.on { background: #ea580c; border-color: #ea580c; color: #fff; }
.rv-cat { display: flex; align-items: center; gap: 8px; font-size: .85rem; color: var(--muted); }
.rv-cat select { flex: 1; min-width: 0; font: inherit; font-size: 15px; font-weight: 700; color: #9a3412; background: #fff7ed; border: 1px solid #fdba74; border-radius: 8px; padding: 9px 30px 9px 10px; cursor: pointer; -webkit-appearance: none; appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%239a3412' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; }
.rv-sum { background: #fff7ed; border: 1px solid #fed7aa; border-radius: 10px; padding: 8px 10px; line-height: 1.6; }
.rv-list { display: flex; flex-direction: column; gap: 8px; }
.rv-card { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 10px; align-items: center; border: 1px solid #e5e7eb; border-radius: 10px; padding: 8px; background: #fff; }
.rv-img { width: 96px; aspect-ratio: 2 / 1; display: flex; align-items: center; justify-content: center; background: #f8fafc; border-radius: 6px; overflow: hidden; }
.rv-img img { width: 100%; height: 100%; object-fit: contain; display: block; }
.rv-noimg { font-size: 28px; opacity: .5; }
.rv-body { min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.rv-nm { overflow-wrap: anywhere; }
.rv-mo { display: flex; flex-wrap: wrap; gap: 2px 10px; margin-top: 2px; }
.rv-m b { color: #c2410c; }
.rv-md { overflow-wrap: anywhere; }
.badge.rv-low { background: #16a34a; color: #fff; border-color: #16a34a; }
.rv-foot { margin: 0; }
.rv-skip { margin: 0; }

/* ---- システム管理 > おすすめ車両の管理 ---- */
.rva .rva-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 8px; }
.rva .rv-tabs { margin: 8px 0; }
.rva-pt { border-collapse: collapse; font-size: .85rem; } .rva-pt th, .rva-pt td { padding: 2px 4px; white-space: nowrap; } .rva-pt th { text-align: left; color: var(--muted); font-weight: 600; }
.rva-pt input.ie { width: 7.5em; text-align: right; }
.rva-form { display: flex; flex-direction: column; gap: 8px; min-width: min(560px, 80vw); } .rva-form label { display: flex; flex-direction: column; gap: 2px; font-size: .85rem; color: var(--muted); }
.rva-form select { font: inherit; font-size: 15px; padding: 9px 10px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.rva-bt { border-collapse: collapse; font-size: .85rem; } .rva-bt th { text-align: left; color: var(--muted); font-weight: 600; padding: 2px 4px; } .rva-bt td { padding: 2px 4px; }
.rva-imgbox { display: flex; gap: 10px; align-items: center; } .rva-imgbox .rv-img { flex: 0 0 120px; width: 120px; }

/* スマホ(720px以下): 納車待ち・納車済み一覧(と外部の車両一覧)は、横に長い表をやめて、案件一覧と同じ1件ずつのカードにする */
@media (max-width: 720px) {
  .dw-fix { max-height: none; overflow: visible; }
  table.dw-tbl, table.dw-tbl tbody { display: block; width: 100%; table-layout: auto; }
  table.dw-tbl colgroup, table.dw-tbl thead { display: none; }
  table.dw-tbl tr.dw-row { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 2px 0; border: 1px solid var(--line, #e3e7ec); border-radius: 10px; padding: 8px 12px; margin: 10px 0; background: #fff; position: relative; }
  table.dw-tbl tbody tr:nth-child(even) td, table.dw-tbl tbody tr:hover td { background: transparent; }
  table.dw-tbl td { display: block; width: 50%; border: 0; padding: 4px 8px 4px 0; min-width: 0; font-size: .92rem; box-sizing: border-box; overflow-wrap: anywhere; word-break: break-word; }
  table.dw-tbl td::before { content: attr(data-l); display: block; color: var(--muted, #6b7280); font-size: .75rem; font-weight: normal; line-height: 1.3; }
  table.dw-tbl td[data-l="お名前"], table.dw-tbl td[data-l="車種"], table.dw-tbl td[data-l="車台番号"] { font-weight: 700; }
  table.dw-tbl td[data-l="お名前"] { order: 1; }
  table.dw-tbl td[data-l="管理番号"] { order: 2; }
  table.dw-tbl td[data-l="車種"] { order: 3; width: 100%; }
  table.dw-tbl td[data-l="車台番号"] { order: 4; width: 100%; }
  table.dw-tbl td[data-l="成約店舗"] { order: 5; }
  table.dw-tbl td[data-l="営業担当"] { order: 6; }
  table.dw-tbl td[data-l="成約日"] { order: 7; }
  table.dw-tbl td[data-l="納車日"] { order: 8; }
  table.dw-tbl td[data-l="案件詳細"] { order: 9; width: 100%; padding-top: 6px; }
  table.dw-tbl td[data-l="案件詳細"]::before { content: none; }
  table.dw-tbl td[data-l="案件詳細"] .btn { padding: 8px 14px; font-size: .9rem; }
}

/* 営業ダッシュボード: 無効・失注 / 信販会社別 */
.cd-subs { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.cd-sub { background: var(--card, #fff); border: 1px solid var(--line, #e3e7ec); border-radius: 10px; padding: 10px 12px; }
.cd-sub .cd-kv { font-size: 1.3rem; font-weight: 700; }
.cd-rs h4 { margin: 0 0 6px; font-size: .95rem; }
.cd-two > .cd-rs { min-width: 0; }
.cd-chip { display: inline-block; background: #eef5f7; border: 1px solid #cfe0e5; border-radius: 999px; padding: 1px 8px; font-size: .82rem; white-space: nowrap; margin: 1px 0; }

.cd-org th.cd-ax, .cd-org td.cd-ax { background: rgba(37, 99, 235, .08); } .cd-org td.cd-ax .cd-pc { margin-left: 4px; }
/* 納車済みの案件: 上部サマリ(文字の大きさは全部同じ) */
.dw-donehead { display: flex; flex-direction: column; gap: 10px; }
.dw-drow { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px 16px; }
.dw-addr .dw-kv:nth-child(2) { grid-column: span 2; }
.dw-donehead .dw-kv span { font-size: 12px; }
.dw-donehead .dw-kv b { font-size: 16px; font-weight: 700; word-break: break-all; }
.dw-dsep { border: 0; border-top: 1px solid #d1d5db; margin: 2px 0; width: 100%; }
@media (max-width: 600px) { .dw-drow { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* ---- 一覧の見出しの色(システム全体で統一)と、項目の選択・列幅の変更 ---- */
:root { --th-bg: #0b4f5c; --th-fg: #fff; }
table:not(.sh):not(.at):not(.pr-tbl):not(.yj) thead th { background: var(--th-bg) !important; color: var(--th-fg) !important; }
table:not(.sh):not(.at):not(.pr-tbl):not(.yj) thead th a { color: inherit; }
.cc-hide { display: none !important; }
.cc-bar { display: flex; justify-content: flex-end; margin: 4px 0; }
.cc-open { background: #fff; border: 1px solid var(--line); color: var(--text); border-radius: 8px; padding: 6px 12px; cursor: pointer; font-size: .85rem; }
table.cc-fixed { table-layout: fixed; min-width: 100%; }
table.cc-fixed th, table.cc-fixed td { overflow: hidden; text-overflow: ellipsis; }
th.cc-th { position: relative; }
.cc-rs { position: absolute; top: 0; right: 0; width: 9px; height: 100%; cursor: col-resize; touch-action: none; user-select: none; }
.cc-rs::after { content: ""; position: absolute; top: 20%; bottom: 20%; right: 3px; width: 2px; background: rgba(255,255,255,.45); border-radius: 1px; }
.cc-rs:hover::after { background: #fff; }
.cc-dlg { border: 0; border-radius: 12px; padding: 0; width: min(560px, calc(100vw - 24px)); max-height: calc(100dvh - 24px); box-shadow: 0 10px 40px rgba(0,0,0,.3); }
.cc-dlg::backdrop { background: rgba(0,0,0,.4); }
.cc-form { padding: 16px; display: flex; flex-direction: column; gap: 10px; max-height: calc(100dvh - 24px); }
.cc-form h3 { margin: 0; font-size: 1.1rem; }
.cc-list { list-style: none; margin: 0; padding: 0; overflow: auto; border: 1px solid var(--line); border-radius: 8px; }
.cc-list li { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 10px; border-bottom: 1px solid var(--line); }
.cc-list li:last-child { border-bottom: 0; }
.cc-list li.off { background: #f3f4f6; color: #9aa3ad; }
.cc-chk { display: flex; align-items: center; gap: 10px; font-size: 1rem; font-weight: 600; flex: 1; min-width: 0; cursor: pointer; }
.cc-chk input { width: 22px; height: 22px; flex: none; }
.cc-mv { display: flex; gap: 6px; flex: none; }
.cc-b { min-height: 38px; padding: 4px 10px; border: 1px solid var(--line); background: #fff; border-radius: 8px; cursor: pointer; font-size: .85rem; }
.cc-b:disabled { opacity: .35; cursor: default; }
.cc-act { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.cc-act button { min-height: 42px; padding: 6px 14px; border-radius: 8px; border: 1px solid var(--line); background: #fff; cursor: pointer; }
.cc-act .primary { background: var(--primary); color: #fff; border-color: var(--primary); font-weight: 700; }
.cc-sp { flex: 1; }
@media (max-width: 700px) { .cc-b { padding: 4px 8px; font-size: .8rem; } .cc-rs { display: none; } table.cc-fixed { table-layout: auto; width: 100% !important; min-width: 0; } }
.cc-chk { margin: 0; color: var(--text); }
.cc-chk span { color: var(--text); }
.cc-scroll { overflow: auto; display: flex; flex-direction: column; gap: 10px; min-height: 0; flex: 1 1 auto; }
.cc-scroll .cc-list { overflow: visible; flex: none; }
.cc-h4 { margin: 6px 0 0; font-size: .95rem; }
.cc-tag { font-style: normal; font-size: .7rem; font-weight: 600; background: #e0efff; color: #1f5fbf; border-radius: 99px; padding: 1px 8px; margin-left: 6px; white-space: nowrap; }
.cc-pool li { background: #fafbfc; }

/* ---- 案件ファイル(案件詳細の左ペインのリンクと、ファイル一覧の画面) ---- */
.cf-link { margin: 6px 0 8px; }
.cf-open { display: flex; align-items: center; gap: 8px; width: 100%; max-width: 100%; text-align: left; padding: 9px 12px; border: 1px solid #b8d4da; border-radius: 9px; background: #eef7f9; color: #0b4f5c; font-weight: 700; cursor: pointer; }
.cf-open:hover { background: #dff0f4; }
.cf-ic { flex: none; font-size: 1.15em; }
.cf-nm { min-width: 0; overflow-wrap: anywhere; line-height: 1.35; }
.cf-h { margin: 0 0 4px; font-size: 1.1em; display: flex; gap: 6px; align-items: baseline; }
.cf-hn { min-width: 0; overflow-wrap: anywhere; }
.cf-fn { min-width: 0; overflow-wrap: anywhere; }
.cf-tag { display: inline-block; padding: 1px 7px; border-radius: 999px; font-size: .78em; font-weight: 700; background: #e3f1f4; color: #0b4f5c; }
.cf-tag.cf-old { background: #eef0f3; color: #556; }
.cf-old-box { margin-top: 12px; }
.cf-old-box > summary { cursor: pointer; padding: 6px 0; color: #556; }
.cf-row .row { align-items: center; }
.cf-t { display: flex; gap: 6px; align-items: flex-start; }
.cf-i { flex: none; }
.sc-fl { margin: 6px 0 10px; }
.sc-fl .row { display: flex; gap: 6px; align-items: center; }
.sc-fl input.grow { flex: 1; min-width: 0; }
.sc-req { display: inline-block; margin-left: 4px; padding: 0 5px; border-radius: 4px; background: #fee2e2; color: #b91c1c; font-size: .7rem; }
.sc-lay { margin: 0 0 6px; }
.sc-rest { margin: 12px 0; } .sc-rest summary { cursor: pointer; color: #64748b; }
.sc-dim { opacity: .6; } .sc-dim:focus-within, .sc-dim:hover { opacity: 1; }
.sc-f textarea { width: 100%; box-sizing: border-box; }

/* フォームのページ送り・郵便番号 */
.fm-nav { gap: 12px; margin: 16px 0 8px; }
.fm-nav button { min-width: 7em; min-height: 44px; }
.fm-nav .fm-next { flex: 1; }
.fm-zip { margin-top: 4px; }
.fm-zipset { margin-top: 8px; padding: 8px 10px; border: 1px dashed var(--line, #cbd5e1); border-radius: 8px; }
.fm-nl { display: grid; gap: 10px; }
.fm-nli { display: grid; gap: 4px; }
.fm-nli input { width: 7em; }
.sc-pbar { display: flex; gap: 8px; align-items: center; justify-content: space-between; flex-wrap: wrap; padding: 8px 10px; margin: 8px 0; border-radius: 8px; background: var(--soft, #f1f5f9); font-size: 13px; }
.sc-pbar.on { background: #fef3c7; }
.sc-pii { display: inline-block; padding: 6px 0; letter-spacing: .04em; }
.sc-ls { margin: 14px 0; border-top: 1px solid #e2e8f0; padding-top: 8px; } .sc-ls summary { cursor: pointer; padding: 6px 0; }
.sc-lc { margin: 10px 0; } .sc-lt { border-collapse: collapse; width: 100%; max-width: 360px; } .sc-lt th { text-align: left; font-weight: 400; color: #475569; padding: 3px 8px 3px 0; } .sc-lt td { text-align: right; padding: 3px 0; }
.sc-sim { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0; }
.sc-ls .sc-f input, .sc-ls .sc-f select { width: 100%; box-sizing: border-box; }
.ac-sim { margin: 12px 0; border-top: 1px solid #e2e8f0; padding-top: 8px; } .ac-sim summary { cursor: pointer; padding: 4px 0; } .ac-simout { margin: 8px 0; }
.ct { padding: 8px; } .ct-form { display: grid; gap: 8px; } .ct-form label { display: block; font-size: .78rem; color: #475569; } .ct-form select { width: 100%; box-sizing: border-box; }
.ct-r3 { display: grid; grid-template-columns: 1.3fr 1fr 1.2fr; gap: 6px; }
.ct-ans { margin: 10px 0; padding: 10px; border-radius: 8px; background: var(--soft, #f1f5f9); } .ct-big { font-size: 1.6rem; font-weight: 700; }
.ct-tw { overflow-x: auto; margin: 8px 0; } .ct-t { border-collapse: collapse; font-size: .78rem; white-space: nowrap; } .ct-t th, .ct-t td { border: 1px solid #e2e8f0; padding: 3px 6px; text-align: right; }
.ct-t thead th { background: #fef9c3; font-weight: 600; text-align: center; } .ct-t .ct-era { font-weight: 400; font-size: .68rem; color: #64748b; } .ct-t .ct-c0 { background: #dbeafe; position: sticky; left: 0; text-align: left; z-index: 1; }
.ct-t .ct-hc { background: #fde047; } .ct-t .ct-hr .ct-c0 { background: #93c5fd; } .ct-t .ct-hr td { background: #f0f9ff; } .ct-t td.ct-hit { background: #f97316; color: #fff; font-weight: 700; }
.ct .ct-t thead th { background: #fef9c3; color: #1e293b; } .ct .ct-t thead th.ct-c0 { background: #dbeafe; } .ct .ct-t thead th.ct-hc { background: #fde047; }
@media (max-width: 640px) { #trn-bar { gap: 6px; padding: 4px 8px; } #trn-bar .trn-title { font-size: 1rem; } #trn-bar .trn-msg { display: none; } #trn-bar button { padding: 5px 8px; font-size: .8rem; } }
.tc-box { margin: 0; } .tc-list { height: min(56vh, 520px); } .tc-pick { padding: 12px; display: grid; gap: 8px; background: #fff; } .tc-pick select { width: 100%; box-sizing: border-box; }
.tcv { display: grid; grid-template-columns: minmax(300px, 1fr) minmax(300px, 1fr); gap: 14px; align-items: start; } @media (max-width: 800px) { .tcv { grid-template-columns: 1fr; } }
.tcv-s .tr-qa td, .tcv-s .tr-qa th { vertical-align: top; } .tcv-ans { cursor: pointer; } .tcv-ans:hover { background: #ecfdf5; }

/* 擬似電話(AIのお客様役) */
.tc-tel, .tc-rec { margin-left: 6px; border: 0; border-radius: 14px; padding: 3px 9px; font-size: 12px; cursor: pointer; background: #fff; color: #06c755; font-weight: 700; } .tc-tel:disabled { opacity: .5; } .tc-rec { color: #475569; font-weight: 400; }
.tc-recs { background: #fff; border: 1px solid #e2e8f0; border-radius: 8px; margin: 6px 0; padding: 8px 10px; max-height: 260px; overflow: auto; font-size: 12px; }
.tv-h summary { cursor: pointer; font-weight: 700; padding: 3px 0; } .tv-hc { display: flex; flex-direction: column; gap: 2px; padding: 4px 0; border-top: 1px dashed #e2e8f0; } .tv-hc audio { width: 100%; height: 30px; }
.tv-ov { position: fixed; inset: 0; z-index: 10000; background: rgba(15, 23, 42, .78); display: flex; align-items: center; justify-content: center; padding: 12px; }
.tv-card { width: min(420px, 100%); max-height: 100%; background: #0f172a; color: #fff; border-radius: 18px; padding: 20px 18px; display: flex; flex-direction: column; gap: 8px; text-align: center; box-shadow: 0 10px 40px rgba(0, 0, 0, .5); }
.tv-name { font-size: 20px; font-weight: 700; } .tv-st { font-size: 14px; color: #86efac; min-height: 20px; } .tv-time { font-size: 13px; color: #94a3b8; font-variant-numeric: tabular-nums; }
.tv-log { text-align: left; background: #1e293b; border-radius: 10px; padding: 8px 10px; height: 160px; overflow: auto; font-size: 13px; display: flex; flex-direction: column; gap: 4px; } .tv-c { color: #bbf7d0; } .tv-s { color: #e2e8f0; }
.tv-lv { height: 6px; background: #1e293b; border-radius: 3px; overflow: hidden; } .tv-lv i { display: block; height: 100%; width: 0; background: #22c55e; transition: width .08s; }
.tv-btns { display: flex; gap: 10px; justify-content: center; } .tv-btns button { border: 0; border-radius: 22px; padding: 10px 18px; font-size: 14px; cursor: pointer; } .tv-done { background: #334155; color: #fff; } .tv-done:disabled { opacity: .4; } .tv-end { background: #ef4444; color: #fff; font-weight: 700; }
.tv-note { font-size: 11px; color: #94a3b8; margin: 0; }

/* 粗利計算: パターンのタブ・出品票の添付 */
.gc-tabs { display: flex; gap: 6px; overflow-x: auto; padding: 2px 0 8px; } .gc-tab { flex: 0 0 auto; border: 1px solid #cbd5e1; background: #f8fafc; border-radius: 8px 8px 0 0; padding: 5px 10px; font-size: 12px; text-align: left; cursor: pointer; line-height: 1.35; } .gc-tab.on { background: #fff; border-color: #2563eb; border-bottom: 3px solid #2563eb; } .gc-tab .ng { color: #b91c1c; } .gc-add { color: #2563eb; border-style: dashed; align-self: stretch; }
.gc-sheetbar { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; margin: 4px 0 8px; } .gc-lbl { flex: 1 1 180px; }
.gc-files { margin: 10px 0; padding: 8px 10px; border: 1px solid #e2e8f0; border-radius: 8px; background: #fafcff; } .gc-fl { list-style: none; margin: 4px 0; padding: 0; } .gc-fl li { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 4px 0; border-top: 1px dashed #e2e8f0; font-size: 13px; flex-wrap: wrap; } .gc-up { cursor: pointer; display: inline-block; }

.gc-acts { display: flex; flex-wrap: wrap; gap: 8px 12px; justify-content: space-between; align-items: center; margin-top: 8px; } .gc-sub, .gc-main { display: flex; flex-wrap: wrap; gap: 6px; } .gc-main { margin-left: auto; justify-content: flex-end; }
