/* Notion風デザインシステム */
:root {
  --text: #37352f;
  --text-light: #787774;
  --text-faint: #9b9a97;
  --bg: #ffffff;
  --divider: #e9e9e7;
  --hover: rgba(55, 53, 47, 0.06);
  --callout-gray: #f1f1ef;
  --callout-brown: #f4eeee;
  --heading-orange: #faebdd;
  --blue-btn: #2383e2;
  /* タグ背景 */
  --tag-gray: #e3e2e0;
  --tag-blue: #d3e5ef;
  --tag-yellow: #fdecc8;
  --tag-green: #dbeddb;
  --tag-purple: #e8deee;
  --tag-pink: #f5e0e9;
  --tag-red: #ffe2dd;
  --tag-orange: #fadec9;
  --tag-brown: #eee0da;
  /* ドット(人アイコン) */
  --dot-orange: #d9730d;
  --dot-blue: #337ea9;
  --dot-brown: #9f6b53;
  --dot-yellow: #cb912f;
  --dot-green: #448361;
  --dot-purple: #9065b0;
  --dot-red: #d44c47;
  --dot-navy: #28456c;
  --dot-gray: #b1b0ad;
  --dot-black: #191919;
  --dot-white: #e3e2e0;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue",
    "Hiragino Kaku Gothic ProN", "Hiragino Sans", Meiryo, sans-serif;
  color: var(--text);
  background: var(--bg);
  font-size: 14px;
  line-height: 1.5;
}
a { color: inherit; }

/* ---------- 上部バー ---------- */
.topbar {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; gap: 8px;
  height: 44px; padding: 0 12px;
  background: var(--bg);
  font-size: 14px;
}
.topbar .crumb { display: flex; align-items: center; gap: 6px; color: var(--text); }
.topbar .crumb .icon { font-size: 16px; }
.topbar .spacer { flex: 1; }
.topbar .tb-btn {
  border: none; background: none; padding: 4px 8px; border-radius: 4px;
  color: var(--text); cursor: pointer; font-size: 14px;
}
.topbar .tb-btn:hover { background: var(--hover); }

/* ---------- カバー・タイトル ---------- */
.cover { height: 220px; background: #4d94b8; background-image: linear-gradient(180deg, #4d94b8, #3f86ab); }
.page {
  max-width: 1500px;               /* 画面が広い端末では広く使う */
  margin: 0 auto;
  padding: 0 clamp(16px, 5vw, 96px) 30vh;
}
.gcard { text-decoration: none; color: inherit; display: block; }

/* 営業ボードへの入口バナー */
.board-banner {
  display: flex; align-items: center; gap: 14px;
  background: linear-gradient(135deg, #2383e2, #1b6cbe);
  color: #fff; border-radius: 10px; padding: 16px 20px;
  text-decoration: none; margin: 12px 0 18px;
  box-shadow: 0 2px 10px rgba(35, 131, 226, .35);
  transition: transform .1s, box-shadow .1s;
}
.board-banner:hover { transform: translateY(-1px); box-shadow: 0 4px 14px rgba(35, 131, 226, .45); }
.bb-icon { font-size: 30px; line-height: 1; }
.bb-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.bb-title { font-size: 18px; font-weight: 700; }
.bb-sub { font-size: 13px; opacity: .92; }
.bb-arrow { margin-left: auto; font-size: 28px; opacity: .85; }
@media (max-width: 640px) {
  .board-banner { padding: 14px 16px; gap: 10px; }
  .bb-title { font-size: 16px; }
  .bb-sub { font-size: 12px; }
}

/* 実績ページのサマリー */
.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin: 14px 0; }
.stat {
  border: 1px solid var(--divider); border-radius: 8px; padding: 10px 14px;
  background: #fff; box-shadow: 0 1px 2px rgba(15,15,15,.03);
}
.stat-l { font-size: 12px; color: var(--text-light); }
.stat-v { font-size: 20px; font-weight: 700; margin-top: 2px; }
.page-icon {
  width: 100px; height: 100px; margin-top: -54px;
  background: #fff; border-radius: 4px;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 0 0 1px rgba(15,15,15,.06);
}
.page-icon img { width: 84px; height: 84px; object-fit: contain; }
h1.page-title {
  font-size: 40px; font-weight: 700; margin: 24px 0 8px; line-height: 1.2;
  letter-spacing: .01em;
}

/* ---------- 汎用ブロック ---------- */
.callout {
  display: flex; gap: 8px; padding: 16px 16px 16px 12px;
  border-radius: 4px; margin: 6px 0;
}
.callout .callout-icon { font-size: 16px; line-height: 1.4; flex-shrink: 0; }
.callout.gray { background: var(--callout-gray); }
.callout.brown { background: var(--callout-brown); }
.callout.plain { background: transparent; border: 1px solid var(--divider); }
.callout-body { flex: 1; min-width: 0; }

.h-band {
  background: var(--heading-orange);
  padding: 3px 6px; border-radius: 4px;
  font-size: 17px; font-weight: 600;
  margin: 24px 0 8px;
}
h2.toggle-h {
  font-size: 22px; font-weight: 600; margin: 12px 0 4px;
  display: flex; align-items: center; gap: 4px; cursor: pointer; user-select: none;
}
h3.sub-h { font-size: 17px; font-weight: 600; margin: 14px 0 4px; display: flex; align-items: center; gap: 4px; cursor: pointer; user-select: none; }
.tri {
  width: 20px; height: 20px; border-radius: 4px; flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
  transition: transform .15s; font-size: 11px; color: var(--text);
}
.toggle-h:hover .tri, .sub-h:hover .tri { background: var(--hover); }
.tg[open] > summary .tri { transform: rotate(90deg); }
.tg > summary { list-style: none; }
.tg > summary::-webkit-details-marker { display: none; }

.columns { display: flex; gap: 28px; }
.columns > .col { min-width: 0; }

/* ---------- ギャラリービュー ---------- */
.db-block { margin: 8px 0 20px; }
.db-header {
  display: flex; align-items: center; gap: 6px; padding: 4px 0;
  border-bottom: 1px solid var(--divider); margin-bottom: 12px;
}
.db-header .db-title { font-size: 15px; font-weight: 600; display: flex; align-items: center; gap: 6px; }
.db-header .lock { color: var(--text-faint); font-size: 12px; display: flex; align-items: center; gap: 3px; }
.db-header .spacer { flex: 1; }
.db-header .hicons { color: var(--text-faint); display: flex; gap: 10px; font-size: 13px; align-items: center; }
.btn-new {
  background: var(--blue-btn); color: #fff; border: none; border-radius: 4px;
  font-size: 13px; padding: 4px 8px; cursor: pointer; font-weight: 500;
  display: inline-flex; align-items: center; gap: 4px;
}
.btn-new:hover { background: #1a74cc; }

.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; }
@media (max-width: 640px) { .gallery { grid-template-columns: repeat(auto-fill, minmax(136px, 1fr)); gap: 10px; } }
.gcard {
  border: 1px solid var(--divider); border-radius: 6px; overflow: hidden;
  background: #fff; cursor: pointer;
  box-shadow: 0 1px 2px rgba(15,15,15,.03);
}
.gcard:hover { background: #fafafa; }
.gcard .gimg {
  height: 110px; display: flex; align-items: center; justify-content: center;
  background: #fff; border-bottom: 1px solid var(--divider);
}
.gcard .gbody { padding: 8px 10px; font-size: 14px; }
.gcard .gsub { font-size: 12px; color: var(--text-light); display: flex; align-items: center; gap: 4px; margin-top: 4px; }
.gcard .gname { display: flex; align-items: center; gap: 6px; font-weight: 500; }

.store-logo {
  width: 84px; height: 84px; border-radius: 50%;
  border: 4px solid; display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 22px; letter-spacing: .05em;
  color: #333; position: relative; text-align: center; line-height: 1.1;
}
.avatar {
  width: 100%; height: 110px; object-fit: cover; object-position: top;
}
.avatar-ph {
  width: 74px; height: 74px; border-radius: 50%;
  background: #e8e8e6; color: #a5a29e;
  display: flex; align-items: center; justify-content: center;
  font-size: 30px; font-weight: 600;
}
/* 担当者カラーの丸: はっきり見分けられる高彩度カラー(ツヤは控えめに) */
.dot { width: 14px; height: 14px; border-radius: 50%; display: inline-block; flex-shrink: 0; border: 1px solid rgba(0,0,0,.18); background: radial-gradient(circle at 33% 28%, rgba(255,255,255,.45), rgba(255,255,255,0) 32%); box-shadow: 0 1px 2px rgba(0,0,0,.18); }
.dot.orange { background-color: #ff7a00; }
.dot.blue { background-color: #1e88ff; }
.dot.brown { background-color: #a4551e; }
.dot.yellow { background-color: #ffb300; }
.dot.green { background-color: #00a344; }
.dot.purple { background-color: #8f4fe8; }
.dot.red { background-color: #f03e3e; }
.dot.navy { background-color: #1f3f9e; }
.dot.gray { background-color: #8d939e; }
.dot.black { background-color: #17181a; }
.dot.white { background-color: #ffffff; border-color: rgba(0,0,0,.32); }

.page-ref { display: inline-flex; align-items: center; gap: 4px; }
.page-ref .pg { color: var(--text-faint); }

/* ---------- リンク集 ---------- */
.dblinks { display: grid; grid-template-columns: 1fr 1.2fr; gap: 4px 24px; }
.dblink {
  display: flex; align-items: center; gap: 8px; padding: 3px 4px;
  border-radius: 4px; text-decoration: none; font-weight: 500;
}
.dblink:hover { background: var(--hover); }
.dblink .di { color: var(--text-faint); }
.dblink span.t { border-bottom: 1px solid #d5d3d0; }

/* ---------- チャート ---------- */
.chart-block { margin: 4px 0 16px; }
.chart-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.chart-chip {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--callout-gray); border-radius: 14px; padding: 3px 10px;
  font-size: 13px; font-weight: 500;
}
.chart-head .spacer { flex: 1; }
.chart-head .hicons { color: var(--text-faint); font-size: 13px; display: flex; gap: 8px; align-items: center; }
.hchart { position: relative; }
.hchart .hbar-row { position: relative; z-index: 1; }
.hgrid { position: absolute; top: 0; bottom: 18px; left: 98px; right: 60px; z-index: 0; pointer-events: none; }
.hgrid-line { position: absolute; top: 0; bottom: 0; width: 1px; background: rgba(55, 53, 47, .08); }
.haxis { position: relative; z-index: 1; height: 18px; margin: 4px 60px 0 98px; }
.haxis-l { position: absolute; transform: translateX(-50%); font-size: 10.5px; color: var(--text-faint); white-space: nowrap; }
.hchart .hbar-track { margin-right: 60px; }
.hchart .hbar { flex-shrink: 0; }
.hbar-row { display: grid; grid-template-columns: 90px 1fr; align-items: center; gap: 8px; margin: 14px 0; }
.hbar-label { font-size: 12px; color: var(--text); text-align: right; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hbar-track { display: flex; align-items: center; gap: 6px; }
.hbar { height: 20px; border-radius: 2px; min-width: 2px; }
.hbar-val { font-size: 12px; color: var(--text-light); white-space: nowrap; }
.donut-wrap { display: flex; flex-direction: column; align-items: center; padding: 12px 0 20px; }
.donut { position: relative; }
.donut .center {
  position: absolute; inset: 0; display: flex; flex-direction: column;
  align-items: center; justify-content: center;
}
.donut .center .num { font-size: 44px; font-weight: 700; }
.donut .center .lbl { font-size: 12px; color: var(--text-light); }

/* ---------- カンバン ---------- */
.board-tabs { display: flex; align-items: center; gap: 4px; margin: 4px 0 8px; }
.board-tab {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 8px; border-radius: 4px; font-size: 14px;
  color: var(--text-light); cursor: pointer; border: none; background: none;
}
.board-tab.active { background: var(--callout-gray); color: var(--text); font-weight: 500; }
.board-tab:hover { background: var(--hover); }
.board-toolbar { display: flex; align-items: center; gap: 10px; color: var(--text-faint); }

.board { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 12px; }
/* 列は画面幅に応じて伸縮(全段階が横スクロールなしで収まる)。狭い画面ではmin-widthで横スクロールに */
.bcol { flex: 1 1 0; min-width: 158px; max-width: 300px; border-radius: 8px; padding: 6px; }
@media (max-width: 900px) {
  .bcol { min-width: 200px; }   /* タブレット以下は読みやすさ優先で横スクロール */
}
.bcol .bcol-head {
  display: flex; align-items: center; gap: 8px; padding: 4px 6px 8px;
  font-size: 15px;
}
.bcol .pill {
  display: inline-flex; align-items: center; gap: 6px; font-size: clamp(12.5px, 1.1vw, 15px);
  border-radius: 14px; padding: 2px 10px 2px 8px; font-weight: 600; white-space: nowrap;
}
.pill .pdot { width: 8px; height: 8px; border-radius: 50%; }
.bcol .cnt { color: var(--text-faint); font-size: 14px; }
.bcol.blue { background: #f6fafd; } .bcol.blue .pill { background: var(--tag-blue); } .pill .pdot.blue { background: var(--dot-blue); }
.bcol.yellow { background: #fdfaf3; } .bcol.yellow .pill { background: var(--tag-yellow); } .pill .pdot.yellow { background: var(--dot-yellow); }
.bcol.green { background: #f6faf6; } .bcol.green .pill { background: var(--tag-green); } .pill .pdot.green { background: var(--dot-green); }
.bcol.purple { background: #faf8fc; } .bcol.purple .pill { background: var(--tag-purple); } .pill .pdot.purple { background: var(--dot-purple); }
.bcol.pink { background: #fdf8fa; } .bcol.pink .pill { background: var(--tag-pink); } .pill .pdot.pink { background: #c14c8a; }
.bcol.red { background: #fdf7f6; } .bcol.red .pill { background: var(--tag-red); } .pill .pdot.red { background: var(--dot-red); }

.bcard {
  background: #fff; border-radius: 6px; padding: 8px 10px; margin: 6px 0;
  box-shadow: 0 0 0 1px rgba(15,15,15,.05), 0 1px 2px rgba(15,15,15,.04);
  cursor: pointer; font-size: 13px;
}
.bcard:hover { background: #fbfbfa; }
.bcard.dragging { opacity: .45; }
.bcol.drag-over { outline: 2px dashed var(--blue-btn); outline-offset: -2px; }
.bcard .bname { font-size: 14px; font-weight: 500; margin-bottom: 6px; overflow-wrap: anywhere; }
.bcard .brow { display: flex; align-items: center; gap: 5px; margin: 5px 0; color: var(--text); }
.bcard .brow .dot { width: 17px; height: 17px; }
.bcard .brow.money { color: var(--text); }
.tag {
  display: inline-block; padding: 0 6px; border-radius: 3px;
  font-size: 12px; line-height: 1.6;
}
.tag.a { background: var(--tag-red); }
.tag.b { background: var(--tag-yellow); }
.tag.c { background: var(--tag-blue); }
.tag.none { background: var(--tag-gray); }
.bcol .add-card {
  display: flex; align-items: center; gap: 6px; color: var(--text-faint);
  padding: 6px; cursor: pointer; border-radius: 4px; font-size: 13px;
}
.bcol .add-card:hover { background: var(--hover); }

/* ---------- テーブルビュー ---------- */
.tbl-wrap { overflow-x: auto; margin: 6px 0 10px; }
table.ntable { border-collapse: collapse; font-size: 14px; min-width: 100%; }
.ntable th, .ntable td {
  border-top: 1px solid var(--divider);
  padding: 5px 8px; text-align: left; white-space: nowrap; max-width: 320px;
  overflow: hidden; text-overflow: ellipsis;
}
.ntable tr:last-child td { border-bottom: 1px solid var(--divider); }
.ntable th {
  color: var(--text-light); font-weight: 400; font-size: 13px;
  border-top: none;
}
.ntable th .thi { margin-right: 4px; color: var(--text-faint); }
.ntable td.link-cell { cursor: pointer; }
.ntable td.link-cell:hover { background: var(--hover); }
tr.row-click { cursor: pointer; }
tr.row-click:hover td { background: var(--hover); }
.ntable .count-row { color: var(--text-faint); font-size: 12px; padding: 4px 8px; }
.status-tag { display: inline-flex; align-items: center; gap: 5px; padding: 0 8px; border-radius: 12px; font-size: 13px; }
.status-tag .sdot { width: 8px; height: 8px; border-radius: 50%; }
.status-tag.gray { background: var(--tag-gray); } .status-tag.gray .sdot { background: #787774; }
.status-tag.green { background: var(--tag-green); } .status-tag.green .sdot { background: var(--dot-green); }
.status-tag.blue { background: var(--tag-blue); } .status-tag.blue .sdot { background: var(--dot-blue); }
.status-tag.red { background: var(--tag-red); } .status-tag.red .sdot { background: var(--dot-red); }
.status-tag.purple { background: var(--tag-purple); } .status-tag.purple .sdot { background: var(--dot-purple); }
.status-tag.yellow { background: var(--tag-yellow); } .status-tag.yellow .sdot { background: var(--dot-yellow); }
.status-tag.pink { background: var(--tag-pink); } .status-tag.pink .sdot { background: #c14c8a; }

/* ---------- モーダル(案件詳細) ---------- */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(15,15,15,.6); z-index: 100;
  display: flex; align-items: flex-start; justify-content: center;
  opacity: 0; visibility: hidden; pointer-events: none;
  transition: opacity .2s ease, visibility 0s linear .2s;
}
.modal-overlay.open { opacity: 1; visibility: visible; pointer-events: auto; transition: opacity .2s ease; }
.modal-overlay .modal {
  transform: translateY(18px) scale(.975); opacity: 0;
  transition: transform .26s cubic-bezier(.2,.8,.25,1), opacity .2s ease;
}
.modal-overlay.open .modal { transform: none; opacity: 1; }
.modal {
  background: #fff; border-radius: 10px; margin-top: 60px;
  width: min(860px, calc(100vw - 80px)); max-height: calc(100vh - 120px);
  overflow-y: auto; box-shadow: 0 8px 30px rgba(15,15,15,.25);
  padding: 44px 90px 60px;
}
.modal h1.m-title {
  font-size: 32px; font-weight: 700; margin: 0 0 12px; outline: none;
}
.m-tabs { display: flex; gap: 4px; margin-bottom: 16px; }
.m-tab {
  display: inline-flex; align-items: center; gap: 5px; font-size: 14px;
  padding: 3px 8px; border-radius: 4px; border: 1px solid var(--divider);
  background: none; cursor: pointer; color: var(--text-light);
}
.m-tab.active { background: var(--callout-gray); color: var(--text); border-color: transparent; font-weight: 500; }
.m-sec { color: var(--text-faint); font-size: 13px; margin: 16px 0 4px; padding-top: 12px; border-top: 1px solid var(--divider); }
.prop-row { display: flex; align-items: flex-start; min-height: 32px; }
.prop-label {
  width: 160px; flex-shrink: 0; color: var(--text-light); font-size: 14px;
  display: flex; align-items: center; gap: 6px; padding: 5px 0;
}
.prop-label .pi { color: var(--text-faint); width: 16px; text-align: center; }
.prop-value { flex: 1; padding: 3px 6px; border-radius: 4px; min-height: 26px; }
.prop-value:hover { background: var(--hover); }
select.nsel {
  appearance: none; -webkit-appearance: none;
  width: auto; max-width: 100%;
  padding: 3px 12px; border-radius: 8px; font-size: 13px; line-height: 1.6;
  border: none; outline: none; cursor: pointer; color: var(--text);
  transition: box-shadow .1s;
}
select.nsel:hover { box-shadow: 0 0 0 2px rgba(55, 53, 47, .08); }
select.nsel:focus { box-shadow: 0 0 0 2px rgba(35, 131, 226, .3); }
.tagc-none, select.nsel.tagc-none { background: transparent; }
.tagc-gray, select.nsel.tagc-gray { background: var(--tag-gray); }
.tagc-blue, select.nsel.tagc-blue { background: var(--tag-blue); }
.tagc-yellow, select.nsel.tagc-yellow { background: var(--tag-yellow); }
.tagc-green, select.nsel.tagc-green { background: var(--tag-green); }
.tagc-purple, select.nsel.tagc-purple { background: var(--tag-purple); }
.tagc-pink, select.nsel.tagc-pink { background: var(--tag-pink); }
.tagc-red, select.nsel.tagc-red { background: var(--tag-red); }
.tagc-orange, select.nsel.tagc-orange { background: var(--tag-orange); }
.tagc-brown, select.nsel.tagc-brown { background: var(--tag-brown); }
.prop-value input, .prop-value select, .prop-value textarea {
  width: 100%; border: none; background: transparent; font: inherit; color: inherit;
  outline: none; padding: 2px 0; resize: vertical;
}
.prop-value .empty { color: var(--text-faint); }
.m-close {
  position: sticky; top: 0; float: right; margin: -30px -70px 0 0;
  background: none; border: none; font-size: 18px; color: var(--text-faint);
  cursor: pointer; padding: 6px; border-radius: 4px;
}
.m-close:hover { background: var(--hover); }

/* ---------- ボタン風リンク ---------- */
.pill-btn {
  display: inline-flex; align-items: center; gap: 6px;
  background: #fff; border: 1px solid var(--divider); border-radius: 6px;
  padding: 4px 10px; font-size: 14px; font-weight: 500; text-decoration: none;
  box-shadow: 0 1px 2px rgba(15,15,15,.05); cursor: pointer;
}
.pill-btn:hover { background: #fafafa; }

.empty-hint { color: var(--text-faint); font-size: 13px; padding: 8px 0; }

/* ---------- 月カレンダー ---------- */
.cal-toolbar { display: flex; gap: 8px; align-items: center; margin: 8px 0 10px; }
.cal-grid {
  display: grid; grid-template-columns: repeat(7, 1fr);
  border-top: 1px solid var(--divider); border-left: 1px solid var(--divider);
}
.cal-dow {
  text-align: center; font-size: 12px; color: var(--text-light); padding: 5px 0;
  border-right: 1px solid var(--divider); border-bottom: 1px solid var(--divider);
  background: #fbfbfa;
}
.cal-cell {
  min-height: 96px; padding: 4px; font-size: 12px; overflow: hidden;
  border-right: 1px solid var(--divider); border-bottom: 1px solid var(--divider);
}
.cal-cell.other { background: #fafaf9; }
.cal-cell[data-date] { cursor: pointer; }
.cal-cell[data-date]:hover { background: #fbfbfa; }
.cal-day { font-size: 12px; color: var(--text-light); width: 20px; height: 20px; display: flex; align-items: center; justify-content: center; margin-bottom: 2px; }
.cal-cell.today .cal-day { background: var(--dot-red); color: #fff; border-radius: 50%; font-weight: 600; }
.cal-ev {
  display: flex; gap: 4px; align-items: center; padding: 1px 3px; border-radius: 3px;
  cursor: pointer; margin-bottom: 1px;
}
.cal-ev:hover { background: var(--hover); }
.cal-ev .dot { width: 13px; height: 13px; flex-shrink: 0; }
.cal-ev-t { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-more { color: var(--text-faint); font-size: 11px; padding-left: 3px; cursor: default; }
@media (max-width: 640px) {
  .cal-cell { min-height: 64px; padding: 2px; }
  .cal-ev { padding: 1px 2px; }
  .cal-ev-t { font-size: 10px; }
}

/* ログ入力フォームとオートコンプリート */
.log-form { display: flex; gap: 8px; flex-wrap: wrap; margin: 4px 0 12px; align-items: center; }
.log-form .staff-field { display: inline-flex; flex: 0 0 auto; }
.log-form input, .log-form select, .log-form textarea {
  font: inherit; padding: 7px 10px; border: 1px solid var(--divider); border-radius: 6px; background: #fff;
}
.log-form input:focus, .log-form select:focus, .log-form textarea:focus { outline: 2px solid rgba(35,131,226,.4); border-color: var(--blue-btn); }
.ac-wrap { position: relative; }
.ac-wrap input { width: 100%; }
.ac-list {
  position: absolute; left: 0; right: 0; top: calc(100% + 2px); z-index: 60;
  background: #fff; border: 1px solid var(--divider); border-radius: 8px;
  box-shadow: 0 6px 20px rgba(15,15,15,.12); max-height: 260px; overflow-y: auto;
}
.ac-item { padding: 7px 12px; cursor: pointer; display: flex; gap: 8px; align-items: center; font-size: 14px; }
.ac-item:hover, .ac-item.sel { background: var(--callout-gray); }
.ac-item .ac-sub { color: var(--text-faint); font-size: 12px; margin-left: auto; }
@media (max-width: 640px) {
  .log-form { flex-direction: column; align-items: stretch; }
  .log-form > * { flex: 0 0 auto !important; }   /* 縦積みではflex比率が高さを潰すため無効化 */
  .log-form input, .log-form select, .log-form textarea { font-size: 16px; }
  /* ログイン本人が担当者として自動セット済みなら、スマホでは選択欄を出さない */
  .log-form .staff-field.prefilled { display: none; }
}

/* データベース一覧の色付きタグ */
.ntag {
  display: inline-block; padding: 0 8px; border-radius: 12px;
  font-size: 13px; line-height: 1.7; white-space: nowrap;
}
select.nsel-e {
  appearance: none; -webkit-appearance: none;
  width: auto !important; max-width: 100%;
  padding: 4px 12px !important; border-radius: 12px !important;
  border: none !important; cursor: pointer;
  background: var(--callout-gray);
}
.nc-field select.nsel-e.tagc-gray { background: var(--tag-gray); }
.nc-field select.nsel-e.tagc-blue { background: var(--tag-blue); }
.nc-field select.nsel-e.tagc-yellow { background: var(--tag-yellow); }
.nc-field select.nsel-e.tagc-green { background: var(--tag-green); }
.nc-field select.nsel-e.tagc-purple { background: var(--tag-purple); }
.nc-field select.nsel-e.tagc-pink { background: var(--tag-pink); }
.nc-field select.nsel-e.tagc-red { background: var(--tag-red); }
.nc-field select.nsel-e.tagc-orange { background: var(--tag-orange); }
.nc-field select.nsel-e.tagc-brown { background: var(--tag-brown); }

/* 案件追加フォーム */
.nc-modal { width: min(560px, calc(100vw - 40px)); padding: 28px 30px 24px; margin-top: 90px; max-height: calc(100vh - 140px); }
.nc-field { margin-bottom: 12px; flex: 1; min-width: 0; }
.nc-field label { display: block; font-size: 13px; color: var(--text-light); margin-bottom: 4px; }
.nc-field label .req { color: #d44c47; font-size: 11px; margin-left: 4px; }
.nc-field input, .nc-field select, .nc-field textarea {
  width: 100%; font: inherit; padding: 7px 10px;
  border: 1px solid var(--divider); border-radius: 6px; background: #fff;
  resize: vertical;
}
.nc-field input:focus, .nc-field select:focus, .nc-field textarea:focus {
  outline: 2px solid rgba(35, 131, 226, .4); border-color: var(--blue-btn);
}
.nc-row { display: flex; gap: 10px; }
@media (max-width: 640px) {
  .nc-modal { width: 100vw; margin: 0; max-height: 100dvh; height: 100dvh; border-radius: 0; padding: 20px 16px 40px; }
  .nc-row { flex-direction: column; gap: 0; }
  .nc-field input, .nc-field select, .nc-field textarea { font-size: 16px; padding: 10px; }
}
@media (max-width: 900px) {
  .gallery { grid-template-columns: repeat(3, 1fr); }
  .columns { flex-direction: column; gap: 8px; }
}

/* ---------- スマホ最適化 ---------- */
@media (max-width: 640px) {
  body { font-size: 15px; }
  .topbar { height: auto; min-height: 44px; flex-wrap: wrap; padding: 6px 10px; gap: 4px; }
  .topbar .crumb { max-width: 46vw; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-size: 13px; }
  .topbar .tb-btn { padding: 6px; font-size: 13px; }
  .cover { height: 110px; }
  .page { padding: 0 14px 15vh; }
  .page-icon { width: 68px; height: 68px; margin-top: -36px; }
  .page-icon img { width: 56px; height: 56px; }
  h1.page-title { font-size: 26px; margin: 14px 0 6px; }
  .gallery { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .gcard .gimg { height: 92px; }
  .store-logo { width: 68px; height: 68px; font-size: 17px; }
  .h-band { font-size: 15px; }
  h2.toggle-h { font-size: 17px; flex-wrap: wrap; row-gap: 2px; }
  /* 営業活動ログ: スマホはメモ列を隠して日付・営業先・担当を1画面に(メモは行タップで表示) */
  .log-table .log-memo { display: none; }
  .log-table { width: 100%; table-layout: fixed; }
  .log-table th.log-date, .log-table td.log-date { font-size: 11px; color: var(--text-light); white-space: nowrap; width: 56px; padding-left: 4px; padding-right: 4px; }
  .log-table .log-target { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .log-table th.log-staff, .log-table td.log-staff { white-space: nowrap; font-size: 12.5px; width: 96px; overflow: hidden; text-overflow: ellipsis; padding-left: 4px; padding-right: 4px; }
  .ongoing-badge { font-size: 11.5px; padding: 2px 8px; white-space: nowrap; }
  .inq-stats { margin-left: 0; width: 100%; gap: 16px; padding-left: 26px; }
  .inq-stats b { font-size: 17px; }

  /* カンバン: 列を細くして横スクロール */
  .board { gap: 8px; -webkit-overflow-scrolling: touch; }
  .bcol { width: 210px; }
  .bcard { padding: 10px 12px; }

  /* テーブルは横スクロール(既定) + 行を触りやすく */
  .ntable th, .ntable td { padding: 8px 8px; }

  /* 案件詳細モーダル: 全画面 */
  .modal-overlay.open { align-items: stretch; }
  .modal {
    width: 100vw; max-height: 100dvh; height: 100dvh; margin: 0;
    border-radius: 0; padding: 20px 16px 80px;
  }
  .modal h1.m-title { font-size: 24px; }
  .m-close { position: fixed; top: 8px; right: 8px; margin: 0; background: var(--callout-gray); border-radius: 50%; width: 34px; height: 34px; }
  .prop-row { min-height: 40px; }
  .prop-label { width: 118px; font-size: 13px; }
  .prop-value { padding: 6px 8px; }
  /* iOSの自動ズームを防ぐため入力は16px */
  .prop-value input, .prop-value select, .prop-value textarea,
  #log-form input, #log-form select { font-size: 16px; }
  #log-form { flex-direction: column; align-items: stretch; }
  #log-form input, #log-form select { padding: 9px 10px; }
  .btn-new { padding: 8px 12px; font-size: 15px; }
  .pill-btn { padding: 8px 12px; }
  .stat-row { grid-template-columns: repeat(2, 1fr); }
  .stat-v { font-size: 17px; }
  .dblinks { grid-template-columns: 1fr; }
}

/* ---------- 入力式の絞り込みセレクト(コンボボックス) ---------- */
.combo { position: relative; display: flex; align-items: center; gap: 4px; min-width: 0; flex: 1; }
.combo-input {
  flex: 1; min-width: 0; font: inherit; padding: 6px 10px;
  border: 1px solid var(--divider); border-radius: 6px; background: #fff;
}
.combo-input:focus { outline: 2px solid rgba(35, 131, 226, .35); border-color: var(--blue-btn); }
.combo-clear {
  border: none; background: none; color: var(--text-faint); cursor: pointer;
  font-size: 12px; padding: 4px; flex-shrink: 0;
}
.combo-clear:hover { color: var(--text); }
.combo-list {
  position: absolute; top: calc(100% + 4px); left: 0; right: 0; z-index: 300;
  background: #fff; border: 1px solid var(--divider); border-radius: 8px;
  box-shadow: 0 8px 24px rgba(15, 15, 15, .15); max-height: 260px; overflow-y: auto;
}
.combo-item {
  display: flex; align-items: center; gap: 8px; padding: 8px 12px;
  cursor: pointer; font-size: 14px;
}
.combo-item:hover, .combo-item.active { background: var(--hover); }
.combo-item .dot { width: 12px; height: 12px; }
.combo-more { padding: 8px 12px; color: var(--text-faint); font-size: 12px; }
.combo-new { padding: 9px 12px; color: var(--accent, #2383e2); font-weight: 600; font-size: 13px; cursor: pointer; border-top: 1px solid var(--border, #e9e9e7); }
.combo-new:hover { background: rgba(35, 131, 226, .08); }
@media (max-width: 640px) {
  .combo-input { font-size: 16px; padding: 10px; }
  .combo-item { padding: 11px 12px; }
}

/* ---------- 折りたたみ式サイドバー ---------- */
.sidebar {
  position: fixed; top: 0; left: 0; bottom: 0; width: 240px;
  background: #f7f6f4; border-right: 1px solid var(--divider);
  z-index: 90; overflow-y: auto; padding: 12px 8px 24px;
  transform: translateX(0); transition: transform .18s ease;
}
body.sb-closed .sidebar { transform: translateX(-105%); }
body { transition: padding-left .18s ease; }
body:not(.sb-closed) { padding-left: 240px; }
.sb-head { display: flex; gap: 10px; align-items: center; padding: 6px 10px 14px; }
.sb-head img { width: 32px; height: 32px; flex-shrink: 0; }
.sb-title { font-weight: 700; font-size: 14px; }
.sb-user { font-size: 12px; color: var(--text-light); }
.sb-nav a, .sb-nav button {
  display: flex; align-items: center; gap: 8px; width: 100%;
  padding: 7px 10px; border-radius: 6px; text-decoration: none;
  color: var(--text); font-size: 14px; border: none; background: none;
  cursor: pointer; text-align: left; font-family: inherit;
}
.sb-nav a:hover, .sb-nav button:hover { background: var(--hover); }
.sb-sec summary {
  padding: 7px 10px; font-size: 12px; color: var(--text-light);
  cursor: pointer; list-style: none; border-radius: 6px; user-select: none;
}
.sb-sec summary::-webkit-details-marker { display: none; }
.sb-sec summary:hover { background: var(--hover); }
.sb-sec a { padding-left: 24px; font-size: 13.5px; }
.sb-backdrop { display: none; }
@media (max-width: 900px) {
  body:not(.sb-closed) { padding-left: 0; }
  body:not(.sb-closed) .sb-backdrop {
    display: block; position: fixed; inset: 0;
    background: rgba(15, 15, 15, .4); z-index: 85;
  }
  .sidebar { width: 270px; box-shadow: 4px 0 20px rgba(15,15,15,.15); }
}

/* ---------- 案件詳細: 段階・スケジュール・経過メモ ---------- */
.cs-stage-row { display: flex; align-items: center; gap: 10px; margin: 8px 0 4px; flex-wrap: wrap; }
.stage-hist summary { font-size: 12.5px; color: var(--text-light); cursor: pointer; list-style: none; padding: 3px 8px; border-radius: 4px; }
.stage-hist summary::-webkit-details-marker { display: none; }
.stage-hist summary:hover { background: var(--hover); }
.stage-hist-list { padding: 6px 4px; font-size: 13px; }
.sh-item { padding: 3px 4px; }
.ntag { display: inline-block; padding: 0 8px; border-radius: 3px; font-size: 12.5px; line-height: 1.7; }
.note-form { display: flex; gap: 8px; align-items: flex-start; flex-wrap: wrap; margin: 4px 0 8px; }
.note-form select { flex: 0 0 auto; }
.note-form textarea { flex: 1; min-width: 200px; font: inherit; padding: 8px 10px; border: 1px solid var(--divider); border-radius: 6px; resize: vertical; }
.note-item { border: 1px solid var(--divider); border-radius: 6px; margin: 5px 0; background: #fff; overflow: hidden; }
.note-head { display: flex; align-items: center; gap: 8px; padding: 7px 10px; cursor: pointer; min-width: 0; }
.note-head:hover { background: var(--hover); }
.note-meta { color: var(--text-faint); font-size: 12px; flex-shrink: 0; }
.note-preview { color: var(--text-light); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.note-full { padding: 8px 12px 12px; border-top: 1px solid var(--divider); font-size: 13.5px; background: #fbfbfa; }
.cs-mini { padding: 2px 8px; font-size: 12px; }
.cs-scheds { margin-bottom: 4px; }
@media (max-width: 640px) {
  .note-form { flex-direction: column; align-items: stretch; }
  .note-form textarea { font-size: 16px; }
  .note-preview { display: none; }
}

/* 段階の履歴(横並びフロー: タグの下に日付、右上に✕) */
.sh-flow { display: flex; align-items: flex-start; flex-wrap: wrap; gap: 2px; min-width: 0; }
.sh-step { display: inline-flex; flex-direction: column; align-items: center; position: relative; padding: 0 7px; }
.sh-date { font-size: 10px; color: var(--text-faint); margin-top: 2px; line-height: 1.2; }
.sh-arrow { color: var(--text-faint); margin: 3px 1px 0; font-size: 12px; }
.sh-del {
  position: absolute; top: -7px; right: -3px;
  border: none; background: var(--bg, #fff); color: var(--text-faint);
  cursor: pointer; font-size: 9px; line-height: 1; padding: 2px 3px;
  border-radius: 50%; box-shadow: 0 0 0 1px var(--divider); opacity: .8;
}
.sh-del:hover { color: #fff; background: #d44c47; opacity: 1; }

/* スケジュール: 日付タブ+1件表示 */
.sched-pager { margin: 2px 0 6px; }
.sp-row { display: flex; align-items: center; gap: 6px; }
.sp-nav { border: none; background: rgba(0,0,0,.045); border-radius: 6px; width: 26px; height: 26px; cursor: pointer; font-size: 15px; color: var(--text-light); flex-shrink: 0; }
.sp-nav:disabled { opacity: .3; cursor: default; }
.sp-tabs { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; }
.sp-tabs::-webkit-scrollbar { display: none; }
.sp-tab { border: none; background: rgba(0,0,0,.045); border-radius: 6px; padding: 4px 10px; font-size: 12px; cursor: pointer; color: var(--text-light); white-space: nowrap; flex-shrink: 0; }
.sp-tab.on { background: #e7f3f8; color: #337ea9; font-weight: 600; }
.sp-item { margin-top: 6px; padding: 8px 10px; border: 1px solid var(--divider); border-radius: 8px; font-size: 14px; display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.sp-item[data-dbedit]:hover { background: rgba(0,0,0,.03); }

/* プロパティ: 折りたたみグループ+2列グリッド */
.pgroup { border-top: 1px solid var(--divider); padding: 2px 0 8px; }
.pgroup > summary { cursor: pointer; list-style: none; display: flex; align-items: center; gap: 8px; font-size: 13.5px; font-weight: 600; color: var(--text-light); padding: 9px 0 5px; user-select: none; }
.pgroup > summary::-webkit-details-marker { display: none; }
.pgroup > summary::before { content: '▸'; color: var(--text-faint); transition: transform .15s; }
.pgroup[open] > summary::before { transform: rotate(90deg); }
.pg-count { font-weight: 400; font-size: 11px; color: var(--text-faint); }
.pgrid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 32px; }
.pgrid .span2 { grid-column: 1 / -1; }
@media (max-width: 900px) { .pgrid { grid-template-columns: 1fr; } }

/* カンバンカード: 名前の左の優先度タグ */
.bcard .bname .tag { font-size: 11px; padding: 0 6px; margin-right: 3px; vertical-align: 1px; }
/* タグ型セレクトは内容幅で表示(全幅化の打ち消し) */
.prop-value select.nsel { width: auto; }

/* スケジュール: シンプルな1行リスト */
.cs-scheds { margin: 2px 0 6px; }
.sched-line { padding: 3px 8px; font-size: 13.5px; border-radius: 6px; }
.sched-line[data-dbedit] { cursor: pointer; }
.sched-line[data-dbedit]:hover { background: rgba(0,0,0,.04); }
/* タイトル直下の担当営業行 */
.cs-top-staff { margin-top: 6px; min-height: 30px; }

/* プロパティ: 左右2列(縦に読む)+中央の境界線 */
.pcols { display: flex; }
.pcol { flex: 1 1 0; min-width: 0; }
.pcol-r { border-left: 1px solid var(--divider); padding-left: 26px; margin-left: 26px; }
@media (max-width: 900px) {
  .pcols { flex-direction: column; }
  .pcol { width: 100%; }
  .pcol-r { border-left: none; padding-left: 0; margin-left: 0; }
}
/* 選択タグは他のテキストと同じ左寄せ(枠内の文字だけ中央) */
.pcol .prop-value select.nsel { text-align: center; }
/* 提案施設の編集UI */
.prop-chips { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; padding: 4px 0 8px; }
.prop-chips .chart-chip { display: inline-flex; align-items: center; gap: 4px; }
.chip-del { border: none; background: none; color: var(--text-faint); cursor: pointer; font-size: 10px; padding: 0 2px; border-radius: 50%; }
.chip-del:hover { color: #fff; background: #d44c47; }
.prop-add-wrap { min-width: 180px; }

/* グラフ: ホバーツールチップ+クリック可能 */
[data-chart] { cursor: pointer; }
.hbar-click:hover { background: rgba(0,0,0,.025); border-radius: 4px; }
.hbar-click:hover .hbar { filter: brightness(1.08); }
svg rect[data-chart]:hover { filter: brightness(1.1); }
.chart-tip { position: fixed; z-index: 300; background: #fff; border: 1px solid var(--divider); border-radius: 8px; box-shadow: 0 6px 22px rgba(0,0,0,.14); padding: 8px 10px; font-size: 12.5px; pointer-events: none; min-width: 180px; }
.chart-tip[hidden] { display: none; }
.ct-main { display: flex; align-items: center; gap: 6px; font-weight: 500; }
.ct-sw { width: 9px; height: 9px; border-radius: 2px; flex-shrink: 0; }
.ct-val { margin-left: auto; color: var(--text-light); padding-left: 16px; }
.ct-hint { color: var(--text-faint); font-size: 11.5px; margin-top: 6px; border-top: 1px solid var(--divider); padding-top: 6px; }
/* グラフのデータ一覧ポップアップ */
.cr-bg { position: fixed; inset: 0; background: rgba(15,15,15,.45); z-index: 250; display: flex; align-items: flex-start; justify-content: center; padding: 9vh 16px 16px; }
.cr-bg[hidden] { display: none; }
.cr-modal { background: #fff; border-radius: 12px; box-shadow: 0 10px 40px rgba(0,0,0,.25); width: 660px; max-width: 100%; padding: 18px 20px; }
.cr-head { display: flex; align-items: center; justify-content: space-between; font-size: 17px; }
.cr-filters { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 12px; }
.cr-chip { border: 1px solid var(--divider); border-radius: 20px; padding: 2px 10px; font-size: 12px; color: #337ea9; background: #f7fbfd; }
.cr-row { cursor: pointer; }
.cr-row:hover { background: rgba(0,0,0,.03); }

/* h-band型の開閉見出し */
.hband-sum { cursor: pointer; display: flex; align-items: center; gap: 6px; }
.hband-sum .tri { font-size: 11px; }
details.tg > summary:hover .h-band { filter: brightness(.97); }

/* 案件管理見出しの進行中件数バッジ */
.inq-stats { margin-left: auto; display: inline-flex; gap: 22px; align-items: baseline; font-weight: 600; font-size: 13px; color: var(--text-light); white-space: nowrap; }
.inq-stats b { font-size: 22px; color: var(--text); margin-left: 2px; }
.ongoing-badge {
  display: inline-block; background: var(--tag-blue); color: var(--text);
  border-radius: 16px; padding: 2px 12px; font-size: 15px; font-weight: 600;
  margin-right: 10px; vertical-align: 4px;
}

/* カレンダーの店舗切り替え */
.cal-stores { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 10px; }
.cal-store.active { background: #2383e2; color: #fff; border-color: transparent; }
.cal-store.active:hover { background: #1a75d2; }

/* ---------- お知らせ(オレンジ枠で強調) ---------- */
.notice-callout { border: 2px solid #d9730d; background: #fdf3ea; border-radius: 10px; }
.notice-callout .callout-icon { font-size: 22px; }

/* ---------- 日別予定モーダル ---------- */
.day-ev { display: flex; gap: 10px; align-items: flex-start; padding: 9px 10px; border-bottom: 1px solid var(--border, #e9e9e7); border-radius: 6px; }
.day-ev:hover { background: rgba(35, 131, 226, .06); }
.day-ev-time { flex-shrink: 0; min-width: 44px; max-width: 100px; font-size: 12px; font-weight: 700; color: #2383e2; font-variant-numeric: tabular-nums; padding-top: 1px; }

/* ---------- カレンダーのスマホ表示 ---------- */
@media (max-width: 640px) {
  .cal-grid { gap: 2px; }
  .cal-cell { min-height: 52px; padding: 3px 2px; }
  .cal-day { font-size: 11px; }
  /* 予定はタイトルを出さず色ドットだけにして、タップで日別一覧を見る */
  .cal-cell .cal-ev { display: inline-flex; padding: 0; margin: 1px; border: none; background: none; }
  .cal-cell .cal-ev .cal-ev-t { display: none; }
  .cal-cell .cal-ev .dot { width: 8px; height: 8px; }
  .cal-toolbar { flex-wrap: wrap; }
  .cal-stores { overflow-x: auto; white-space: nowrap; }
}

/* ---------- ポップアップ・モーション ---------- */
.day-modal-box { max-width: 540px; position: relative; padding: 40px 28px 32px; }
@keyframes dayInR { from { opacity: 0; transform: translateX(34px); } }
@keyframes dayInL { from { opacity: 0; transform: translateX(-34px); } }
@keyframes dayInUp { from { opacity: 0; transform: translateY(10px); } }
.day-in-r { animation: dayInR .24s cubic-bezier(.2,.8,.25,1); }
.day-in-l { animation: dayInL .24s cubic-bezier(.2,.8,.25,1); }
.day-in-up { animation: dayInUp .2s ease; }
/* 検索コンボ・オートコンプリートの出現 */
@keyframes popIn { from { opacity: 0; transform: translateY(-5px); } }
.combo-list, .ac-list { animation: popIn .15s ease; }
.cr-bg:not([hidden]) { animation: popIn .15s ease; }
.cr-bg:not([hidden]) .cr-modal { animation: dayInUp .22s cubic-bezier(.2,.8,.25,1); }
@media (prefers-reduced-motion: reduce) {
  .modal-overlay, .modal-overlay .modal, .day-in-r, .day-in-l, .day-in-up, .combo-list, .ac-list { transition: none !important; animation: none !important; }
}
@media (max-width: 640px) {
  .day-modal-box { padding: 40px 14px 28px; }
}

/* ---------- タスク行(案件モーダル・個人ページ共通) ---------- */
.task-list, .cs-tasks { margin: 4px 0 8px; }
.task-row { display: flex; gap: 10px; align-items: flex-start; padding: 7px 4px; border-bottom: 1px solid var(--divider); }
.task-row:hover { background: var(--hover); border-radius: 6px; }
.task-st { border: none; border-radius: 12px; padding: 3px 11px; font-size: 12px; font-weight: 600; white-space: nowrap; cursor: pointer; font-family: inherit; }
.task-st.st-gray { background: var(--tag-gray); }
.task-st.st-blue { background: var(--tag-blue); }
.task-st.st-green { background: var(--tag-green); }
.task-main { flex: 1; min-width: 0; cursor: pointer; }
.task-title { font-size: 13.5px; font-weight: 500; }
.task-meta { display: block; font-size: 11.5px; color: var(--text-light); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.task-row.done .task-title { color: var(--text-faint); text-decoration: line-through; }

/* 経過メモ: 本文クリックで編集モードへ */
.note-body-click { cursor: pointer; border-radius: 6px; padding: 2px 4px; margin: -2px -4px; }
.note-body-click:hover { background: var(--hover); outline: 1px dashed var(--divider); }

/* タスク一覧: PCでは2列(縦の長さを半分に)。完了の折りたたみは全幅 */
@media (min-width: 900px) {
  .task-list { column-count: 2; column-gap: 36px; }
  .task-list .task-row { break-inside: avoid; }
  .task-list > details { column-span: all; }
}

/* 時刻コンボ: コンパクト表示 */
.combo:has(> select.time-combo) .combo-input { font-variant-numeric: tabular-nums; }
.pay-input { font: inherit; font-size: 13px; border: 1px solid var(--divider); border-radius: 6px; padding: 3px 6px; background: #fff; }
/* ログ入力: 営業担当チップと新規営業先ポップ */
.log-me { display: inline-flex; align-items: center; gap: 6px; font-size: 13.5px; padding: 6px 12px; background: rgba(0,0,0,.04); border-radius: 18px; white-space: nowrap; }
.ac-item.ac-new { color: #337ea9; font-weight: 600; background: #f6fafd; }
.ref-quick { position: absolute; top: calc(100% + 6px); left: 0; z-index: 60; background: #fff; border: 1px solid var(--divider); border-radius: 10px; box-shadow: 0 8px 30px rgba(0,0,0,.16); padding: 12px; width: 320px; }
.ref-quick input, .ref-quick select { font: inherit; font-size: 13px; padding: 6px 8px; border: 1px solid var(--divider); border-radius: 6px; }
/* 営業ログ: 訪問回数バッジとヒント */
.visit-badge { display: inline-block; font-size: 11px; color: #337ea9; background: #e7f3f8; border-radius: 10px; padding: 0 7px; margin-left: 6px; vertical-align: 1px; white-space: nowrap; }
.visit-hint { margin-top: 5px; font-size: 12.5px; color: var(--text-light); }
.visit-hint b { color: #337ea9; }
/* 訪問回数バッジは営業先セルの右端に揃える */
.lt-wrap { display: flex; align-items: center; gap: 8px; max-width: 640px; }
.lt-wrap .lt-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lt-wrap .visit-badge { flex: none; }
/* 請求管理: 一覧の直接入力欄と合計行 */
.bill-input { font: inherit; font-size: 13px; border: 1px solid transparent; border-radius: 6px; padding: 3px 6px; background: transparent; width: 100%; min-width: 150px; }
.bill-input:hover { border-color: var(--divider); background: #fff; }
.bill-input:focus { border-color: var(--accent, #2383e2); background: #fff; outline: none; }
.bill-memo { min-width: 200px; }
.sum-row td { border-top: 2px solid var(--divider); background: var(--bg-subtle, #f7f7f5); font-size: 13.5px; color: var(--text-light); padding-top: 8px; padding-bottom: 8px; }
.sum-row td b { color: var(--text); font-size: 14.5px; }
/* 案件追加フォーム: 詳細項目つき */
.nc-modal { width: min(860px, calc(100vw - 40px)); }
.nc-me { display: flex; align-items: center; gap: 8px; margin: 0 0 12px; padding: 8px 12px; background: var(--callout-gray); border-radius: 8px; font-size: 14px; }
.nc-me .dot { width: 14px; height: 14px; }
.nc-me .nc-me-store { color: var(--text-light); }
.nc-me .pill-btn { margin-left: auto; }
.nc-ext-title { margin: 18px 0 4px; font-size: 14px; font-weight: 600; }
.nc-ext-title span { font-weight: 400; color: var(--text-faint); font-size: 12.5px; }
#nc-ext .pgroup:first-child { border-top: none; }
/* カンバン: 折りたたみ表示ボタン */
.bcol-more { display: block; width: 100%; margin: 2px 0 6px; padding: 6px 8px; border: 1px dashed rgba(0,0,0,.18); border-radius: 6px; background: rgba(255,255,255,.6); color: var(--text-light); font: inherit; font-size: 12.5px; cursor: pointer; }
.bcol-more:hover { background: #fff; color: var(--text); }
.nc-row[hidden] { display: none; }
/* 案件追加フォーム: プルダウンを色付きタグ表示に(詳細画面と同じ見た目) */
.nc-me[hidden] { display: none; }
#new-case-modal select.nsel { appearance: none; -webkit-appearance: none; width: auto; max-width: 100%; border: none; border-radius: 12px; padding: 6px 30px 6px 14px; font-size: 14px; font-weight: 500; cursor: pointer;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'><path d='M1 1l4 4 4-4' fill='none' stroke='%2337352f' stroke-width='1.5' stroke-linecap='round'/></svg>"); background-repeat: no-repeat; background-position: right 12px center; }
#new-case-modal select.nsel.tagc-none { background-color: var(--callout-gray); color: var(--text-light); }
#new-case-modal .nc-field select.nsel { display: block; }
/* 案件詳細: ふりがなはタイトル直下に小さく */
.cs-furigana { margin-top: -4px; min-height: 26px; }
.cs-furigana .prop-value input { font-size: 13px; color: var(--text-light); }
/* ---------- 営業マップ ---------- */
.map-body { overflow: hidden; }
.map-wrap { display: flex; height: calc(100vh - 44px); }
.map-panel { width: 250px; flex: none; overflow-y: auto; border-right: 1px solid var(--divider); padding: 10px 12px 16px; font-size: 13px; background: #fff; }
#map { flex: 1; min-width: 0; }
.map-list { width: 280px; flex: none; overflow-y: auto; border-left: 1px solid var(--divider); background: #fff; }
.mp-seg { display: flex; border: 1px solid var(--divider); border-radius: 8px; overflow: hidden; margin-bottom: 6px; }
.mp-seg button { flex: 1; border: none; background: #fff; padding: 7px 4px; font: inherit; font-size: 13px; cursor: pointer; color: var(--text-light); }
.mp-seg button.active { background: #37352f; color: #fff; font-weight: 600; }
.mp-hint { font-size: 11.5px; color: var(--text-light); margin-bottom: 10px; line-height: 1.5; }
.mp-row { display: flex; align-items: center; gap: 8px; margin: 6px 0; }
.mp-row label { width: 44px; color: var(--text-light); font-size: 12px; flex: none; }
.mp-row select { flex: 1; font: inherit; font-size: 13px; padding: 4px 6px; border: 1px solid var(--divider); border-radius: 6px; background: #fff; min-width: 0; }
.mp-sec { font-size: 12px; font-weight: 600; color: var(--text-light); margin: 14px 0 4px; display: flex; align-items: center; gap: 6px; }
.mp-mini { font: inherit; font-size: 11px; border: 1px solid var(--divider); background: #fff; border-radius: 4px; padding: 1px 6px; cursor: pointer; color: var(--text-light); }
.mp-mini:first-of-type { margin-left: auto; }
.mp-checks { display: flex; flex-direction: column; gap: 2px; }
.mp-check { display: flex; align-items: center; gap: 6px; padding: 3px 4px; border-radius: 4px; cursor: pointer; }
.mp-check:hover { background: var(--hover); }
.mp-check input { margin: 0; }
.mp-dot { width: 11px; height: 11px; border-radius: 50%; flex: none; display: inline-block; }
.mp-n { color: var(--text-faint); font-size: 11px; margin-left: auto; }
.mp-only { margin-top: 14px; border: 1px solid var(--divider); }
.mp-foot { margin-top: 14px; }
.mp-note { font-size: 11px; color: var(--text-faint); line-height: 1.5; margin-top: 6px; }
#unlocated-note { color: #b45309; background: #fef3c7; padding: 6px 8px; border-radius: 6px; }
.mk { color: #fff; font-weight: 700; text-align: center; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 1px 4px rgba(0,0,0,.35); font-family: -apple-system, sans-serif; }
.pp { font-size: 12.5px; line-height: 1.5; min-width: 200px; }
.pp-type { font-size: 11px; font-weight: 700; }
.pp-name { font-size: 14px; font-weight: 700; margin: 1px 0 4px; }
.pp-sub { font-size: 11.5px; color: var(--text-light); }
.pp-stats { margin: 6px 0; font-size: 12px; }
.pp-stats b { font-size: 15px; }
.pp-bys { display: flex; flex-wrap: wrap; gap: 4px 10px; font-size: 11.5px; margin: 4px 0; }
.pp-by { display: inline-flex; align-items: center; gap: 4px; }
.pp-links { display: flex; gap: 10px; margin-top: 6px; padding-top: 6px; border-top: 1px solid var(--divider); font-size: 12px; }
.pp-links a { text-decoration: none; color: var(--blue-btn); }
.leaflet-popup-content { margin: 10px 12px; }
.ml-head { font-size: 12px; font-weight: 600; color: var(--text-light); padding: 10px 12px 6px; position: sticky; top: 0; background: #fff; }
.ml-row { display: flex; align-items: center; gap: 7px; padding: 6px 12px; cursor: pointer; border-bottom: 1px solid #f1f1ef; }
.ml-row:hover { background: var(--hover); }
.ml-rank { width: 18px; font-size: 11px; color: var(--text-faint); text-align: right; flex: none; }
.ml-name { flex: 1; min-width: 0; font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ml-name small { display: block; font-size: 10.5px; color: var(--text-faint); }
.ml-n { font-size: 15px; flex: none; }
.ml-n small { font-size: 10px; font-weight: 400; color: var(--text-light); margin-left: 1px; }
.mp-toggle { display: none; }
@media (max-width: 900px) {
  .map-list { display: none; }
  .map-panel { position: absolute; left: 0; top: 44px; bottom: 0; z-index: 1200; transform: translateX(-100%); transition: transform .15s; box-shadow: 4px 0 16px rgba(0,0,0,.15); }
  body.mp-open .map-panel { transform: none; }
  .mp-toggle { display: block; position: fixed; left: 12px; bottom: 16px; z-index: 1300; font: inherit; font-size: 13px; padding: 8px 14px; border-radius: 999px; border: 1px solid var(--divider); background: #fff; box-shadow: 0 2px 8px rgba(0,0,0,.2); }
}
/* ダッシュボードの入口バナー2つ並び */
.banner-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin: 12px 0 18px; }
.banner-row .board-banner { margin: 0; }
.board-banner.map-banner { background: linear-gradient(135deg, #0d9488, #0f766e); box-shadow: 0 2px 10px rgba(13,148,136,.35); }
.board-banner.map-banner:hover { box-shadow: 0 4px 14px rgba(13,148,136,.45); }
@media (max-width: 760px) { .banner-row { grid-template-columns: 1fr; } }
/* 請求管理: 請求書発行日・請求方法の直接入力 */
.bill-input.bill-date { min-width: 0; width: auto; border-color: var(--divider); background: #fff; }
.bill-sel.nsel { min-width: 0; width: auto; padding: 3px 24px 3px 10px; appearance: none; -webkit-appearance: none; border-radius: 10px; font-size: 12.5px; background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'><path d='M1 1l4 4 4-4' fill='none' stroke='%2337352f' stroke-width='1.5' stroke-linecap='round'/></svg>"); background-repeat: no-repeat; background-position: right 8px center; }
.bill-sel.nsel.tagc-none { background-color: var(--callout-gray); color: var(--text-light); }
.inv-btn { white-space: nowrap; font-size: 12px; padding: 3px 9px; }
.bill-tools { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: 6px 0 8px; }
.bill-tools-hint { font-size: 12px; color: var(--text-faint); }
.bill-tools { justify-content: flex-end; }
.bill-tools .bill-tools-hint { margin-right: auto; }
.inv-all { background: #fdebe9; color: #b3261e; border-color: #f3c1bb; font-weight: 600; padding: 5px 14px; }
.inv-all:hover { background: #fadad6; }
/* 要対応 */
.al-count { font-size: 13px; font-weight: 600; background: var(--tag-gray); padding: 2px 10px; border-radius: 999px; margin-left: 8px; }
.al-count.hot { background: #ffe2dd; color: #b3261e; }
.al-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 12px; margin: 8px 0 14px; }
.al-box { border: 1px solid var(--divider); border-radius: 8px; padding: 8px 10px; background: #fff; }
.al-box.red { border-color: #f3c1bb; background: #fff7f6; } .al-box.orange { border-color: #f4c9a4; background: #fff9f3; }
.al-box.blue { border-color: #b8d0ec; background: #f6fafd; } .al-box.purple { border-color: #d9c8ea; background: #faf8fc; }
.al-head { font-size: 13px; font-weight: 600; margin-bottom: 4px; } .al-head b { margin-left: 4px; }
.al-row { display: flex; align-items: center; gap: 6px; padding: 4px 4px; border-radius: 4px; cursor: pointer; font-size: 13px; }
.al-row:hover { background: var(--hover); }
.al-name { font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 45%; }
.al-sub { color: var(--text-light); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.al-more { font-size: 12px; color: var(--text-faint); padding: 2px 4px; }
.na-badge { font-size: 11.5px; background: var(--tag-gray); padding: 1px 8px; border-radius: 999px; }
.na-badge.over { background: #ffe2dd; color: #b3261e; font-weight: 600; } .na-badge.today { background: #fdecc8; color: #8a5a00; font-weight: 600; }
.cs-next .prop-value.cs-next-v, .cs-contract .prop-value.cs-next-v { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.cs-next-v input[type="text"] { min-width: 220px; flex: 1; }
.cs-next-lbl { font-size: 12px; color: var(--text-light); }
.sb-badge { display: inline-block; min-width: 18px; padding: 0 5px; margin-left: 6px; border-radius: 999px; background: #e03e3e; color: #fff; font-size: 11px; text-align: center; line-height: 18px; }
.notif { border: 1px solid var(--divider); border-radius: 8px; padding: 8px 12px; margin: 8px 0; background: #fff; }
.notif.unread { border-color: #b8d0ec; background: #f6fafd; }
.notif summary { cursor: pointer; list-style: none; } .notif summary::-webkit-details-marker { display: none; }
.notif-ts { color: var(--text-faint); font-size: 12px; margin-right: 8px; }
.notif-lw { font-size: 11px; color: #448361; background: var(--tag-green); padding: 1px 8px; border-radius: 999px; margin-left: 8px; }
.notif-body { white-space: pre-wrap; font-size: 13px; line-height: 1.6; margin-top: 6px; color: var(--text); }
.lock-btn.locked { background: #ffe2dd; color: #b3261e; border-color: #f3c1bb; }
.lock-note { font-size: 12px; color: #b3261e; background: #ffe2dd; padding: 2px 8px; border-radius: 999px; }
.dun-cell { white-space: nowrap; }
.dun-badge { font-size: 11.5px; background: var(--tag-yellow); color: #8a5a00; padding: 1px 8px; border-radius: 999px; margin-right: 6px; }
.dun-btn { font-size: 12px; padding: 3px 9px; }
tr.rc-auto td { background: #eef8f1 !important; }
.fs-list { display: flex; flex-direction: column; gap: 6px; max-height: 65vh; overflow-y: auto; }
.fs-row { display: flex; gap: 10px; align-items: flex-start; border: 1px solid var(--divider); border-radius: 8px; padding: 8px 10px; }
.fs-main { flex: 1; min-width: 0; font-size: 13px; }
.fs-sub { font-size: 12px; color: var(--text-light); margin: 2px 0; }
.fs-why { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 3px; }
.pp-act { display: flex; gap: 6px; margin-top: 6px; flex-wrap: wrap; }
.pp-act .pill-btn { font-size: 11.5px; padding: 2px 8px; }
.ppf { display: flex; flex-direction: column; gap: 5px; margin-top: 8px; padding-top: 8px; border-top: 1px dashed var(--divider); font-size: 12px; }
.ppf input, .ppf select, .ppf textarea { font: inherit; font-size: 12.5px; border: 1px solid var(--divider); border-radius: 6px; padding: 4px 6px; }
.ppf .btn-new { align-self: flex-end; }
.chk-field { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; font-size: 13.5px; }
.chk-field input { width: 16px; height: 16px; }
.ct-badge { font-size: 11.5px; background: var(--tag-green); color: #1b5e20; padding: 1px 8px; border-radius: 999px; font-weight: 600; }
/* 要対応: 契約書未締結 */
.al-box.yellow { border-left-color: #cb912f; }
.al-box.yellow .al-head { color: #8a5a00; }
/* 添付ファイル */
.file-add { position: relative; cursor: pointer; }
.cs-files { display: flex; flex-direction: column; gap: 4px; margin: 4px 0 14px; }
.file-line { display: flex; align-items: center; gap: 10px; padding: 6px 8px; border: 1px solid var(--divider); border-radius: 6px; background: #fff; min-height: 40px; }
.file-thumb { width: 40px; height: 40px; object-fit: cover; border-radius: 4px; border: 1px solid var(--divider); display: block; }
.file-ico { font-size: 20px; width: 40px; text-align: center; }
.file-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text); text-decoration: underline; text-decoration-color: var(--divider); }
.file-meta { font-size: 11.5px; color: var(--text-faint); white-space: nowrap; }
.file-dl { text-decoration: none; color: var(--text-light); padding: 2px 6px; }
@media (max-width: 640px) { .file-meta { display: none; } }
/* どこからでも検索 */
.gs-overlay { position: fixed; inset: 0; background: rgba(15,15,15,.45); z-index: 1200; display: none; align-items: flex-start; justify-content: center; padding-top: 10vh; }
.gs-overlay.open { display: flex; }
.gs-box { width: min(640px, 94vw); background: #fff; border-radius: 10px; box-shadow: 0 12px 40px rgba(15,15,15,.3); overflow: hidden; }
.gs-head { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-bottom: 1px solid var(--divider); font-size: 16px; }
.gs-head input { flex: 1; border: none; outline: none; font-size: 16px; padding: 6px 4px; background: transparent; }
.gs-close { border: none; background: transparent; cursor: pointer; color: var(--text-faint); font-size: 14px; }
.gs-results { max-height: 60vh; overflow: auto; padding: 6px 0; }
.gs-sec { font-size: 11.5px; color: var(--text-faint); padding: 8px 14px 3px; font-weight: 600; }
.gs-item { display: flex; align-items: center; gap: 8px; padding: 8px 14px; cursor: pointer; flex-wrap: wrap; }
.gs-item.sel, .gs-item:hover { background: var(--callout-gray); }
.gs-main { font-weight: 600; }
.gs-sub { font-size: 12px; color: var(--text-light); }
.gs-hint { padding: 14px; color: var(--text-faint); font-size: 13px; }
.sb-kbd { font-size: 10px; color: var(--text-faint); border: 1px solid var(--divider); border-radius: 4px; padding: 0 4px; margin-left: 4px; }
/* カンバンの絞り込み */
.bfilter { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 6px 0 10px; padding: 8px 10px; border: 1px solid var(--divider); border-radius: 8px; background: #fff; }
.bfilter.active { border-color: #5b9bd5; background: #f3f8fd; }
.fchip { border: 1px solid var(--divider); background: #fff; border-radius: 999px; padding: 3px 10px; font-size: 12.5px; cursor: pointer; color: var(--text); display: inline-flex; align-items: center; gap: 4px; }
.fchip.on { background: #1f4e79; border-color: #1f4e79; color: #fff; }
.fchip.saved { background: #fff7e6; border-color: #e6c27a; }
.fchip-x { border: none; background: transparent; cursor: pointer; font-size: 10px; color: var(--text-faint); padding: 0 0 0 2px; }
.fsel { border: 1px solid var(--divider); border-radius: 6px; padding: 3px 6px; font-size: 12.5px; background: #fff; max-width: 150px; }
.bcard.f-hide { display: none; }
/* 二重登録チェック */
.nc-dup { border: 1px solid #e6c27a; background: #fff7e6; border-radius: 6px; padding: 8px 10px; margin: -6px 0 12px; font-size: 13px; }
.nc-dup-title { font-weight: 600; color: #8a5a00; margin-bottom: 4px; }
.dup-row { display: flex; gap: 8px; align-items: center; padding: 3px 0; flex-wrap: wrap; }
/* スマホ切替バナー(狭い画面だけ) */
.m-switch { display: none; }
@media (max-width: 640px) { .m-switch { display: block; margin: 8px 0 12px; padding: 10px 14px; border-radius: 8px; background: #1f4e79; color: #fff; text-decoration: none; font-weight: 600; } }
.ref-wrap { display: inline-flex; gap: 4px; align-items: center; margin-left: 6px; }
/* 線画アイコン(絵文字の置き換え) */
.ic { width: 1.05em; height: 1.05em; vertical-align: -0.17em; display: inline-block; flex-shrink: 0; }
.ic-dot { display: inline-block; width: .8em; height: .8em; border-radius: 50%; vertical-align: -0.05em; }
.sb-nav a .ic, .sb-nav summary .ic { margin-right: 6px; color: var(--text-light); }
.bb-icon .ic { width: 1.2em; height: 1.2em; }
.tb-btn .ic { width: 18px; height: 18px; }
.bill-fee { width: 100px; text-align: right; }
/* スマホ幅のときの共通下部ナビ */
.mb-nav { display: none; }
@media (max-width: 640px) {
  body { padding-bottom: calc(64px + env(safe-area-inset-bottom)); }
  .mb-nav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 90; display: flex; background: #fff; border-top: 1px solid var(--divider); padding-bottom: env(safe-area-inset-bottom); box-shadow: 0 -2px 10px rgba(0,0,0,.05); }
  .mb-nav a { flex: 1; text-align: center; padding: 7px 0 6px; font-size: 10.5px; color: var(--text-light); text-decoration: none; }
  .mb-nav a span { display: block; height: 24px; }
  .mb-nav a span .ic { width: 22px; height: 22px; }
  .mb-nav a.on { color: #1f4e79; font-weight: 700; }
  .mb-nav a.mb-nav-add { color: #fff; }
  .mb-nav a span.mb-nav-plus { display: block; height: 44px; width: 44px; margin: -22px auto 4px; line-height: 44px; border-radius: 50%; background: #d44c47; color: #fff; font-size: 26px; font-weight: 700; text-align: center; box-shadow: 0 4px 12px rgba(212,76,71,.4); border: 3px solid #fff; box-sizing: content-box; }
  .mb-nav a.mb-nav-add { color: #d44c47; font-weight: 700; }
  .modal-overlay .modal { padding-bottom: 100px; }
}
.bill-fee { width: 96px; text-align: right; font-variant-numeric: tabular-nums; }
.bill-date { width: 96px; }
.cs-contract input[type="date"] { width: auto; flex: 0 0 auto; }
/* 空室の変化: 細い罫線だけの控えめな行。PCは3列 */
.vac-list { display: grid; grid-template-columns: 1fr; gap: 4px 12px; }
@media (min-width: 1000px) { .vac-list { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.vac-row { display: grid; grid-template-columns: minmax(0, 1fr) max-content; grid-template-areas: "name chg" "sub sub"; column-gap: 8px; row-gap: 1px; padding: 5px 2px 5px 8px; border-bottom: 1px solid var(--divider); color: var(--text); text-decoration: none; font-size: 13px; line-height: 1.35; min-width: 0; overflow: hidden; }
.vac-row:hover { background: var(--callout-gray); }
.vac-name { grid-area: name; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vac-chg { grid-area: chg; white-space: nowrap; font-size: 12.5px; color: var(--text-light); }
.vac-chg b { color: var(--text); }
.vac-row.opened .vac-chg b { color: #1b5e20; }
.vac-row.closed .vac-name, .vac-row.closed .vac-chg { color: var(--text-light); }
.vac-sub { grid-area: sub; display: flex; gap: 6px; min-width: 0; overflow: hidden; white-space: nowrap; font-size: 11px; color: var(--text-faint); }
.vac-sub > span { flex: 0 0 auto; }
.vac-sub > .vac-note { flex: 0 1 auto; min-width: 0; }
.vac-date { white-space: nowrap; } .vac-src { white-space: nowrap; }
.vac-note { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.vac-sub > span + span::before { content: '·'; margin-right: 6px; }
/* AIに聞く */
.ai-box { width: min(760px, 96vw); display: flex; flex-direction: column; max-height: 86vh; }
.ai-msgs { flex: 1; overflow: auto; padding: 12px 14px; display: flex; flex-direction: column; gap: 10px; min-height: 240px; background: #fafafa; }
.ai-hint { font-size: 13px; color: var(--text-light); line-height: 1.6; }
.ai-ex { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }
.ai-msg { max-width: 92%; padding: 9px 12px; border-radius: 12px; font-size: 13.5px; line-height: 1.65; }
.ai-msg.user { align-self: flex-end; background: #1f4e79; color: #fff; white-space: pre-wrap; }
.ai-msg.ai { align-self: flex-start; background: #fff; border: 1px solid var(--divider); }
.ai-msg.ai ul { margin: 4px 0 4px 18px; padding: 0; } .ai-msg.ai li { margin: 2px 0; }
.ai-msg.ai a { color: #1f4e79; text-decoration: underline; }
.ai-h { font-weight: 700; margin-top: 6px; } .ai-gap { height: 6px; }
.ai-tools { font-size: 11px; color: var(--text-faint); margin-top: 6px; border-top: 1px dashed var(--divider); padding-top: 4px; }
.ai-input { display: flex; gap: 8px; padding: 10px 12px; border-top: 1px solid var(--divider); background: #fff; }
.ai-input textarea { flex: 1; font: inherit; font-size: 14px; padding: 8px 10px; border: 1px solid var(--divider); border-radius: 8px; resize: none; }
.ai-spin { display: inline-block; width: 12px; height: 12px; border: 2px solid #ccc; border-top-color: #1f4e79; border-radius: 50%; animation: aispin .8s linear infinite; vertical-align: -2px; }
@keyframes aispin { to { transform: rotate(360deg); } }
@media (max-width: 640px) { .gs-overlay { padding-top: 0; } .ai-box { width: 100vw; max-height: 100dvh; height: 100dvh; border-radius: 0; } .ai-input textarea { font-size: 16px; } }
/* 契約書の締結の行: 薄い枠で囲む */
.cs-contract { border: 1px solid var(--divider); border-radius: 8px; padding: 4px 8px; margin: 4px 0; background: #fff; }
.cs-contract .prop-value.cs-next-v { padding-left: 4px; }
/* AIに聞く: 常時表示の丸ボタン */
.ai-fab { position: fixed; right: 18px; bottom: 18px; z-index: 850; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 0; border: none; background: transparent; cursor: pointer; }
.ai-fab .ai-fab-img { width: 50px; height: 50px; border-radius: 50%; clip-path: circle(46% at 50% 50%); box-shadow: 0 5px 14px rgba(31,78,121,.4); transition: transform .12s ease; display: block; }
.ai-fab { filter: drop-shadow(0 5px 10px rgba(31,78,121,.35)); }
.ai-fab:hover .ai-fab-img { transform: scale(1.06); }
.ai-fab .ai-fab-txt { font-size: 11px; font-weight: 700; color: #1f4e79; background: rgba(255,255,255,.92); padding: 1px 8px; border-radius: 999px; box-shadow: 0 1px 3px rgba(0,0,0,.12); }
/* スマホ画面(/m)では画面幅に関係なく、案件追加ボタンのすぐ上に縦並び(上=AIに聞く、下=案件追加) */
.mb-page .ai-fab, .ai-fab.ai-fab-stack { right: 14px; bottom: calc(143px + env(safe-area-inset-bottom)); }
.mb-page .ai-fab .ai-fab-img { width: 46px; height: 46px; }
.mb-page .ai-fab .ai-fab-txt { font-size: 10px; }
@media (max-width: 640px) {
  .ai-fab { right: 14px; bottom: calc(143px + env(safe-area-inset-bottom)); }
  .ai-fab .ai-fab-img { width: 46px; height: 46px; }
  .ai-fab .ai-fab-txt { font-size: 10px; }
  /* 他のページはスマホ幅でも案件追加ボタンがないので、下部ナビのすぐ上に */
  body:not(.mb-page) .ai-fab { bottom: calc(74px + env(safe-area-inset-bottom)); }
}
/* 空室の要確認・ワンタップ確認 */
.warn-tag { font-size: 11.5px; font-weight: 700; color: #b25a00; background: #fff1e6; border: 1px solid #f0c9a6; padding: 1px 8px; border-radius: 999px; white-space: nowrap; }
.ok-tag { font-size: 11.5px; font-weight: 600; color: #1b5e20; background: #e8f3ec; padding: 1px 8px; border-radius: 999px; white-space: nowrap; }
.fs-side { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; flex-shrink: 0; }
.fs-quick { display: inline-flex; gap: 3px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.fs-q { border: 1px solid var(--divider); background: #fff; border-radius: 999px; padding: 1px 7px; font-size: 11px; cursor: pointer; color: var(--text-light); }
.fs-q:hover { background: #e8f3ec; color: #1b5e20; border-color: #b7dfc3; }

/* 2026-09-06 案件詳細: 紹介元ブロック(1列)と提案施設の下の道具(候補探し・紹介シート発行) */
.cs-ref .prop-row { margin: 2px 0; }
.ref-tools { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin: 8px 0 4px; }
.ref-tools .ref-wrap { margin-left: 0; flex-wrap: wrap; }
.ref-tools #ref-to { font: inherit; font-size: 13px; border: 1px solid var(--divider); border-radius: 6px; padding: 4px 8px; min-width: 200px; }

/* 本人氏名と社内用案件メモ */
.case-identity .nc-field { flex: 1; min-width: 0; }
.case-identity small, .case-memo { display:block; font-size:12px; color:var(--text-light); overflow-wrap:anywhere; white-space:pre-wrap; }
.case-identity { align-items:flex-start; }
.case-identity input { width:100%; height:42px; box-sizing:border-box; font-size:16px; line-height:22px; padding:9px 10px; }
@media (max-width:640px) { .case-identity { flex-direction:column; } }

/* カンバンの氏名・案件メモは1行。長さに応じてJSで文字サイズを調整。 */
.bcard .bname-inline { display:flex; align-items:center; gap:3px; white-space:nowrap; overflow-wrap:normal; }
.bname-inline > .tag { flex-shrink:0; }
.bname-fit { flex:1; min-width:0; overflow:hidden; }
.bname-content { display:inline-block; white-space:nowrap; vertical-align:middle; }
.bname-memo { color:var(--text-light); }

/* ボードの日付は用途を併記する */
.bdate { display:flex; align-items:center; gap:6px; flex-wrap:wrap; }
.bdate-label { font-size:11px; color:var(--text-light); white-space:nowrap; }

.proposal-sheets { display:grid; gap:8px; margin-bottom:12px; }
.proposal-sheet { border:1px solid var(--divider); border-radius:8px; padding:10px 12px; background:#fff; }
.proposal-heading { display:flex; align-items:center; justify-content:space-between; gap:8px; margin-bottom:6px; }
.proposal-heading strong { flex:1; min-width:0; overflow-wrap:anywhere; }
.proposal-heading [data-ref-issue], .proposal-heading .chip-del { flex-shrink:0; }
.proposal-sheet label { display:block; font-size:13px; color:var(--text-light); margin-top:0; }
.proposal-sheet input, .proposal-sheet textarea { display:block; width:100%; box-sizing:border-box; margin-top:3px; padding:6px 8px; border:1px solid var(--divider); border-radius:6px; font:inherit; font-size:14px; color:var(--text); background:#fff; }
.proposal-sheet textarea { resize:vertical; height:52px; min-height:36px; line-height:19px; }
.proposal-sheet .note-meta { margin:3px 0 0; font-size:11px; }
.proposal-save-status { display:block; }
.proposal-save-status:empty { display:none; }
.proposal-actions { display:flex; align-items:center; justify-content:space-between; gap:8px; margin-top:12px; }
@media(max-width:640px) { .proposal-sheet input, .proposal-sheet textarea { font-size:16px; } }

.proposal-add { margin:12px 0; }
.proposal-add [data-proposal-add-panel] { margin-top:10px; }
.proposal-add [data-proposal-add-panel][hidden] { display:none; }
.proposal-add label { display:block; font-size:13px; color:var(--text-light); }
.proposal-add select { display:block; max-width:100%; margin-top:5px; padding:8px; }

.proposal-fields { display:grid; grid-template-columns:minmax(0,1fr) minmax(0,1fr); gap:12px; align-items:start; }
.proposal-field { min-width:0; }
@media(max-width:640px) { .proposal-fields { grid-template-columns:minmax(0,1fr); gap:6px; } }
@media(max-width:640px) {
  .proposal-heading { display:grid; grid-template-columns:minmax(0,1fr) auto; gap:4px 8px; }
  .proposal-heading strong { grid-column:1; grid-row:1; }
  .proposal-heading .chip-del { grid-column:2; grid-row:1; }
  .proposal-heading [data-ref-issue] { grid-column:1 / -1; grid-row:2; justify-self:end; }
}

/* 防災入口は営業マップの右隣。狭い画面では既存の縦並びを維持。 */
.banner-row .board-banner { min-width: 0; }
.board-banner.safety-banner { background: linear-gradient(135deg, #b76619, #924611); box-shadow: 0 2px 10px rgba(146,70,17,.25); }
.board-banner.safety-banner:hover { box-shadow: 0 4px 14px rgba(146,70,17,.4); }

.proposal-document textarea[data-doc-brief]::placeholder { font-weight:400; color:#999; opacity:1; }

.proposal-sheet .proposal-recommended { display:flex; align-items:center; gap:5px; white-space:nowrap; cursor:pointer; color:#80501f; }
.proposal-sheet .proposal-recommended input { width:17px; height:17px; margin:0; padding:0; accent-color:#d8882c; }
.proposal-sheet:has([data-recommended]:checked) { border-color:#dda052; background:#fffaf2; }
@media(max-width:640px) { .proposal-heading { flex-wrap:wrap; } .proposal-heading strong { flex-basis:calc(100% - 130px); } }
