:root {
  --ink: #17181c;
  --ink-soft: #5a5b63;
  --ink-faint: #8b8c94;
  --paper: #f4f3ef;
  --card: #ffffff;
  --line: #e5e3dd;
  --line-soft: #efeee9;
  --brand: #ee7a00;
  --brand-deep: #c85e00;
  --stop: #d92c20;
  --stop-bg: #fdeceb;
  --clear: #12925a;
  --clear-bg: #e9f6ef;
  --caution: #e08a00;
  --caution-bg: #fef3e0;
  --neutral: #6b6c74;
  --neutral-bg: #eeedea;
  --sh: 0 1px 2px rgba(20, 20, 25, 0.05), 0 6px 20px rgba(20, 20, 25, 0.06);
  --sh-lg: 0 12px 40px rgba(20, 20, 25, 0.14);
  --jp: "Hiragino Kaku Gothic ProN", "Hiragino Sans", "Yu Gothic", YuGothic, "Noto Sans JP", Meiryo, system-ui, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: var(--jp);
  background: var(--paper);
  color: var(--ink);
  line-height: 1.6;
  font-size: 15px;
}
header {
  position: sticky; top: 0; z-index: 20;
  background: #1a1b20; color: #f4f3ef;
}
/* 環境バー（prod 以外）。js/env.js が body 先頭に挿入する */
.envbar {
  position: sticky; top: 0; z-index: 21;
  display: flex; align-items: center; justify-content: center; gap: 10px; flex-wrap: wrap;
  box-sizing: border-box; height: 30px; padding: 0 16px; font-size: 12px; line-height: 1.3; letter-spacing: .04em; overflow: hidden;
  background: repeating-linear-gradient(-45deg, #ffd23f 0 14px, #ffc400 14px 28px); color: #3a2a00;
  border-bottom: 1px solid #d9a800;
}
.envbar b { font-weight: 800; }
.envbar-note { color: #5a4300; }
.envbar.env-local { background: repeating-linear-gradient(-45deg, #dfe3ea 0 14px, #d2d7e0 14px 28px); color: #2b3140; border-bottom-color: #b9c0cc; }
.envbar.env-local .envbar-note { color: #4a5160; }
/* dev はヘッダ色も変える（本番の黒と見分ける） */
html[data-env="dev"] header { background: #1d2a4a; }
html[data-env="dev"] header .modes { background: #2a3960; }
html[data-env="dev"] .envbar + header { top: 30px; }
html[data-env="local"] .envbar + header { top: 30px; }
@media print { .envbar { display: none; } }
.bar {
  max-width: var(--page-w, 1180px); margin: 0 auto; padding: 11px 20px;
  display: flex; align-items: center; gap: 14px;
}
.logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: inherit;
}
.logo-mark {
  width: 28px;
  height: 28px;
  border-radius: 7px;
  display: block;
  flex: 0 0 auto;
  object-fit: cover;
  background: #ee7a00;
  box-shadow: 0 0 0 1px rgba(255,255,255,.08);
}
.logo b { font-size: 17px; }
.logo .jp { font-size: 11.5px; color: #a9aab2; margin-left: 2px; letter-spacing: .14em; }
.spacer { flex: 1; }
.modes { display: flex; background: #26272e; border-radius: 9px; padding: 3px; gap: 2px; }
.modes a, .modes button {
  border: 0; background: transparent; color: #b7b8c0;
  font-size: 12.5px; font-weight: 600; padding: 6px 13px; border-radius: 6px;
  text-decoration: none; cursor: pointer; font-family: inherit;
}
.modes a.on, .modes button.on { background: var(--brand); color: #231400; }
/* 未実装の機能（会議Bot）はグレー表示にする */
.modes a.soon { opacity: .5; }
.modes a.soon:hover { opacity: .75; }
.modes a.soon.on { opacity: 1; background: #4a4b55; color: #e8e8ec; }
.soon-badge {
  display: inline-block; margin-left: 8px; padding: 2px 8px; border-radius: 20px;
  background: var(--neutral-bg); color: var(--ink-faint); font-size: 11.5px; font-weight: 700;
  vertical-align: 3px;
}
/* ヘッダ右端: ログイン中の利用者 */
.userbox {
  display: flex; align-items: center; gap: 8px; margin-left: 4px;
  padding-left: 12px; border-left: 1px solid #33343c;
}
.ub-avatar {
  width: 26px; height: 26px; border-radius: 50%; flex: 0 0 auto;
  background: linear-gradient(135deg, var(--brand), var(--brand-deep)); color: #231400;
  display: grid; place-items: center; font-weight: 800; font-size: 12px;
}
.ub-text { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; }
.ub-name { font-size: 12.5px; font-weight: 700; color: #f4f3ef; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 180px; }
.ub-role { font-size: 10.5px; color: #a9aab2; letter-spacing: .06em; }
.ub-env {
  display: inline-block; padding: 0 5px; border-radius: 4px; font-family: var(--mono); font-size: 9.5px;
  background: #3a2a10; color: var(--brand); text-transform: uppercase; vertical-align: 1px;
}
.ub-viewas { display: flex; align-items: center; gap: 5px; font-size: 10.5px; color: #a9aab2; letter-spacing: .06em; }
.ub-viewas select {
  font: inherit; font-size: 11.5px; font-weight: 700; color: #f4f3ef; background: #26272e;
  border: 1px solid #3f4049; border-radius: 6px; padding: 2px 6px; cursor: pointer;
}
.userbox.viewing-as .ub-viewas select { border-color: var(--brand); color: var(--brand); }
.ub-gear {
  display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 8px;
  color: #b7b8c0; border: 1px solid transparent; text-decoration: none; transition: transform .25s;
}
.ub-gear:hover { color: #fff; background: #26272e; border-color: #3f4049; transform: rotate(30deg); }
.ub-gear.on { color: var(--brand); background: #26272e; border-color: #3f4049; }
#view-settings .lede .page-title { margin-bottom: 4px; }
#view-settings .lede .page-sub { max-width: 720px; }
html[data-env="dev"] .ub-gear:hover { background: #2a3960; }
.ub-logout {
  border: 1px solid #3f4049; background: transparent; color: #b7b8c0; font-family: inherit;
  font-size: 11.5px; font-weight: 600; padding: 4px 9px; border-radius: 6px; cursor: pointer;
}
.ub-logout:hover { border-color: #b7b8c0; color: #fff; }
@media (max-width: 720px) { .ub-name { display: none; } .userbox { padding-left: 8px; } }
/* ページ幅: 既定は読みやすさ優先。データ画面（body.wide）は画面を広く使う */
:root { --page-w: 1180px; }
body.wide { --page-w: min(1860px, 100%); }
main { max-width: var(--page-w); margin: 0 auto; padding: 26px 24px 80px; }
/* 利用者（検索）画面は読みやすさ優先で中央寄せ。ヘッダは全幅のまま */
#view-user { max-width: 1180px; }
.lede h1 { font-size: 24px; margin: 0 0 4px; letter-spacing: .01em; font-weight: 800; }
.lede p { margin: 0; color: var(--ink-faint); font-size: 13.5px; font-weight: 500; }
.searchwrap { position: relative; max-width: 760px; }

/* ── 利用者の検索ページ ──────────────────────────────────────
   ヘッダーは画面幅いっぱい（body.wide）のまま、本文だけ読みやすい幅に寄せる。
   検索窓・結果カードの左右が揃うので、片側に寄って見えない。
   結果が無いあいだは検索を画面の中央に置き、結果が出たら上に詰める。 */
body.user-search main { --page-w: 1180px; }
body.user-search .searchwrap { max-width: 720px; }
body.user-search:not(.has-result) main {
  min-height: min(70vh, 600px);
  display: flex; flex-direction: column; justify-content: center; padding-bottom: 40px;
}
body.user-search:not(.has-result) .lede { text-align: center; margin-bottom: 4px; }
body.user-search:not(.has-result) .lede h1 { font-size: 30px; }
body.user-search:not(.has-result) .lede p { font-size: 14px; }
body.user-search:not(.has-result) .searchwrap { max-width: 640px; margin: 18px auto 0; }
body.user-search:not(.has-result) .chips { justify-content: center; }
@media (max-width: 720px) {
  body.user-search:not(.has-result) main { min-height: 0; display: block; padding-bottom: 80px; }
  body.user-search:not(.has-result) .lede h1 { font-size: 24px; }
  body.user-search:not(.has-result) .searchwrap { margin-top: 14px; }
}
.searchbox {
  display: flex; align-items: center; gap: 10px;
  background: var(--card); border: 1.5px solid var(--line);
  border-radius: 13px; padding: 4px 4px 4px 16px; box-shadow: var(--sh);
  transition: border-color .15s, box-shadow .15s;
}
.searchbox:focus-within {
  border-color: var(--brand); box-shadow: 0 0 0 3px rgba(238, 122, 0, .15);
}
.searchbox svg { flex: 0 0 auto; color: var(--ink-faint); }
.searchbox input {
  flex: 1; border: 0; outline: 0; font-size: 16.5px; padding: 12px 0;
  background: transparent; color: var(--ink); font-family: inherit;
}
.searchbox input::placeholder { color: var(--ink-faint); }
.searchbox .clearq {
  border: 0; background: transparent; color: var(--ink-faint); cursor: pointer;
  font-size: 18px; line-height: 1; padding: 4px 6px; border-radius: 6px; flex: 0 0 auto;
}
.searchbox .clearq:hover { color: var(--ink); background: var(--line-soft); }
.co-head-r { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; }
.btn-copy-card { font-size: 12px; padding: 5px 10px; }
.cand:focus-visible { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(238, 122, 0, .2); }
.searchbox .go {
  border: 0; background: var(--ink); color: #fff; font-weight: 700;
  font-size: 14px; padding: 11px 20px; border-radius: 10px; cursor: pointer; font-family: inherit;
}
.searchbox .go:hover { background: #000; }
.chips { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 12px; align-items: center; }
.chips .lab { font-size: 11.5px; color: var(--ink-faint); margin-right: 2px; letter-spacing: .04em; }
.chip {
  border: 1px solid var(--line); background: var(--card); color: var(--ink-soft);
  font-size: 12.5px; padding: 5px 11px; border-radius: 20px; cursor: pointer; font-family: inherit;
}
.chip:hover { border-color: var(--brand); color: var(--brand-deep); }
.chips .chip-clear { color: var(--ink-faint); padding-left: 9px; padding-right: 9px; }
/* 検索中 */
.notice.searching { color: var(--ink-soft); }
.spin {
  width: 16px; height: 16px; flex: 0 0 auto; border-radius: 50%; margin-top: 2px;
  border: 2px solid var(--line); border-top-color: var(--brand);
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spin { animation: none; } }
.planned {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 10px; font-weight: 800; letter-spacing: .06em;
  color: #7a4b00; background: #fff3df; border: 1px dashed #e0a94e;
  border-radius: 6px; padding: 2px 8px;
}
.mockflag {
  display: inline-flex; align-items: center; gap: 5px; margin-left: 6px;
  font-size: 10px; font-weight: 800; letter-spacing: .04em;
  color: #5a3fd6; background: #f3efff; border: 1px dashed #c9b8f0;
  border-radius: 6px; padding: 1px 7px; text-transform: none;
}
.mockflag .d { width: 6px; height: 6px; border-radius: 50%; background: #5a3fd6; }

.result { margin-top: 26px; max-width: 1100px; }
.api-status-line {
  font-size: 11.5px; color: var(--ink-faint); font-family: var(--mono); margin: 0 0 10px;
}

/* candidates */
.cand-wrap {
  background: var(--card); border: 1px solid var(--line); border-radius: 14px;
  box-shadow: var(--sh); padding: 12px 14px; margin-bottom: 14px; animation: rise .25s ease;
}
.cand-h {
  font-size: 12px; color: var(--ink-faint); font-weight: 700; letter-spacing: .03em;
  margin-bottom: 9px; display: flex; align-items: center; gap: 9px; flex-wrap: wrap;
}
.cand-h b { color: var(--ink); font-size: 13px; }
.cand-note {
  font-size: 11px; color: #5a3fd6; background: #f3efff; border: 1px solid #ddd3f2;
  border-radius: 20px; padding: 2px 10px; font-weight: 700;
  display: inline-flex; align-items: center; gap: 5px;
}
.cand-note svg { width: 12px; height: 12px; }

.cand {
  display: flex; align-items: center; gap: 11px; width: 100%; text-align: left;
  border: 1px solid var(--line); background: #fff; border-radius: 11px;
  padding: 10px 13px; cursor: pointer; font-family: inherit;
  transition: border-color .12s, box-shadow .12s;
}
.cand:hover { border-color: var(--brand); }
.cand.on {
  border-color: var(--brand); box-shadow: 0 0 0 3px rgba(238, 122, 0, .14); background: #fffdf9;
}
.cand .cdot { width: 10px; height: 10px; border-radius: 50%; flex: 0 0 auto; }
.cand .cmain { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.cand .cnm { font-weight: 800; font-size: 14.5px; line-height: 1.25; }
.cand .cmeta { font-size: 11.5px; color: var(--ink-faint); }
.cand .cand-tag {
  font-size: 10.5px; font-weight: 800; padding: 3px 10px; border-radius: 20px;
  background: var(--neutral-bg); color: var(--ink-soft); white-space: nowrap; flex: 0 0 auto;
}
.cand .cand-tag.ai { background: #f3efff; color: #5a3fd6; }
.cand .chev { color: var(--ink-faint); flex: 0 0 auto; }

/* verdict card */
.vcard {
  background: var(--card); border: 1px solid var(--line); border-radius: 16px;
  overflow: hidden; box-shadow: var(--sh); animation: rise .28s cubic-bezier(.2, .7, .3, 1);
  max-width: 1100px;
}
@keyframes rise {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  .vcard, .cand-wrap { animation: none; }
}
.vgrid { display: grid; grid-template-columns: 212px 1fr; }
@media (max-width: 680px) { .vgrid { grid-template-columns: 1fr; } }
.cand-list { display: flex; flex-direction: column; gap: 7px; }

.rail {
  padding: 22px 20px; border-right: 1px solid var(--line);
  display: flex; flex-direction: column; gap: 12px; background: #fbfaf7;
}
@media (max-width: 680px) {
  .rail { border-right: 0; border-bottom: 1px solid var(--line); }
}
.eqlabel {
  font-family: var(--mono); font-size: 9.5px; letter-spacing: .18em;
  color: var(--ink-faint); text-transform: uppercase;
}
.lamp { width: 56px; height: 56px; border-radius: 50%; position: relative; margin-top: 2px; }
.lamp::after {
  content: ""; position: absolute; inset: 12px; border-radius: 50%; background: rgba(255, 255, 255, .5);
}
.lamp.on { animation: pop .4s ease; }
@keyframes pop {
  0% { transform: scale(.7); opacity: .4; }
  60% { transform: scale(1.08); }
  100% { transform: scale(1); }
}
@media (prefers-reduced-motion: reduce) { .lamp.on { animation: none; } }
.verdict-word { font-size: 19px; font-weight: 800; line-height: 1.25; letter-spacing: .01em; }
.verdict-sub { font-size: 12.5px; color: var(--ink-soft); margin-top: -4px; }
.statusline {
  font-family: var(--mono); font-size: 10.5px; letter-spacing: .06em;
  color: var(--ink-faint); margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--line);
}

.body { padding: 22px 24px; }
.co-head {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; flex-wrap: wrap;
}
.co-name { font-size: 23px; font-weight: 800; letter-spacing: .01em; margin: 0; }
.co-code {
  font-family: var(--mono); font-size: 11px; color: var(--ink-faint);
  background: var(--neutral-bg); padding: 3px 8px; border-radius: 6px;
  white-space: nowrap; margin-top: 6px; display: inline-block;
}
.trail {
  display: flex; align-items: center; gap: 7px; flex-wrap: wrap;
  margin: 10px 0 2px; font-size: 13px; color: var(--ink-soft);
}
.trail .node { background: var(--neutral-bg); padding: 3px 9px; border-radius: 7px; }
.trail .node.spon { background: var(--stop-bg); color: var(--stop); font-weight: 700; }
.trail .arw { color: var(--ink-faint); }
.metarow { display: flex; flex-wrap: wrap; gap: 7px; margin: 14px 0 4px; }
.tag {
  font-size: 12px; padding: 4px 10px; border-radius: 7px;
  background: var(--neutral-bg); color: var(--ink-soft); font-weight: 600;
}
.tag.type { background: #eef1f6; color: #39435a; }
.tag.cat { background: #f1efe9; color: #6a5a3a; }
.tag.via { background: var(--stop-bg); color: var(--stop); }

.sect { margin-top: 20px; }
.sect > h3 {
  font-size: 12px; letter-spacing: .1em; color: var(--ink-faint);
  text-transform: uppercase; margin: 0 0 10px; font-weight: 700;
  display: flex; align-items: center; gap: 8px;
}
.sect > h3::after { content: ""; flex: 1; height: 1px; background: var(--line-soft); }
/* 見出しに企業名を差し込むとき、大文字化されると別名に見えるので原文のまま出す */
.sect > h3 .asis { text-transform: none; letter-spacing: normal; }

.owner {
  display: flex; align-items: center; gap: 14px; background: #fbfaf7;
  border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px;
  flex-wrap: wrap; margin: 0 0 8px;
}
.avatar {
  width: 44px; height: 44px; border-radius: 11px;
  background: linear-gradient(135deg, var(--brand), var(--brand-deep));
  color: #fff; display: grid; place-items: center; font-weight: 800; font-size: 17px; flex: 0 0 auto;
}
.owner .who { flex: 1; min-width: 150px; }
.owner .nm { font-weight: 800; font-size: 16px; }
.owner .rl { font-size: 12.5px; color: var(--ink-soft); }
.owner .meta { font-family: var(--mono); font-size: 11px; color: var(--ink-faint); margin-top: 2px; }
.owner .actions { display: flex; gap: 8px; flex-wrap: wrap; }
.btn-teams {
  display: inline-flex; align-items: center; gap: 8px; border: 0;
  background: #4b53bc; color: #fff; font-weight: 700; font-size: 13.5px;
  padding: 10px 15px; border-radius: 9px; cursor: pointer; font-family: inherit;
}
.btn-teams:hover { background: #3f47a8; }
.btn-teams svg { width: 16px; height: 16px; }
.btn, button.primary {
  border: 0; background: var(--brand); color: #231400; font-weight: 800;
  padding: 10px 16px; border-radius: 9px; cursor: pointer; font-family: inherit;
}
.btn-ghost {
  border: 1px solid var(--line); background: var(--card); color: var(--ink-soft);
  font-weight: 600; font-size: 13px; padding: 9px 13px; border-radius: 9px;
  cursor: pointer; font-family: inherit;
}
.btn-ghost:hover { border-color: var(--ink-faint); color: var(--ink); }
.no-owner {
  color: var(--ink-soft); font-size: 13.5px; background: #fbfaf7;
  border: 1px dashed var(--line); border-radius: 12px; padding: 14px 16px;
}

.cnote {
  display: flex; gap: 11px; background: var(--caution-bg); border: 1px solid #f3d391;
  border-radius: 12px; padding: 13px 15px; margin-top: 4px;
}
.cnote.info { background: #eef3fb; border-color: #cfe0f5; }
.cnote .ic { flex: 0 0 auto; color: var(--caution); }
.cnote.info .ic { color: #3f6fb0; }
.cnote .tx { font-size: 13.5px; color: #7a5200; }
.cnote.info .tx { color: #33517d; }

.cov { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0; }
.cov li {
  display: grid; grid-template-columns: 78px 1fr; gap: 14px;
  padding: 12px 0; border-top: 1px solid var(--line-soft);
}
.cov li:first-child { border-top: 0; }
.cov .date { font-family: var(--mono); font-size: 11.5px; color: var(--ink-faint); padding-top: 2px; }
.cov .prog { font-size: 12px; font-weight: 700; color: var(--ink); display: inline-block; margin-right: 8px; }
.cov .dir {
  font-size: 10.5px; color: var(--clear); border: 1px solid #bfe6d1;
  border-radius: 5px; padding: 1px 6px; vertical-align: middle;
}
.cov .ttl { font-size: 14px; margin: 2px 0; }
.cov .det { font-size: 12.5px; color: var(--ink-soft); }
.cov-empty { color: var(--ink-faint); font-size: 13px; }

.conns { display: flex; flex-direction: column; gap: 8px; }
.conn {
  display: flex; align-items: center; gap: 12px; background: #fbfaf7;
  border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; flex-wrap: wrap;
}
.conn .av {
  width: 36px; height: 36px; border-radius: 9px; background: #e8e6e0;
  color: var(--ink-soft); display: grid; place-items: center; font-weight: 800; font-size: 13px;
}
.conn .who { flex: 1; min-width: 140px; }
.conn .nm { font-weight: 800; font-size: 14px; }
.conn .rl { font-size: 12px; color: var(--ink-soft); }
.btn-ask {
  border: 0; background: #4b53bc; color: #fff; font-weight: 700; font-size: 12.5px;
  padding: 8px 13px; border-radius: 9px; display: inline-flex; align-items: center; gap: 7px;
  cursor: pointer; font-family: inherit;
}

.ai-launch {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  background: linear-gradient(180deg, #f7f4ff, #f1edfb); border: 1px solid #ddd3f2;
  border-radius: 13px; padding: 13px 15px;
}
.ai-launch .ic {
  width: 36px; height: 36px; border-radius: 10px;
  background: linear-gradient(135deg, #7b5cff, #5a3fd6); color: #fff;
  display: grid; place-items: center; flex: 0 0 auto;
}
.ai-launch .tx { flex: 1; min-width: 180px; }
.ai-launch .tx b { font-size: 14px; }
.ai-launch .tx p { margin: 1px 0 0; font-size: 12px; color: var(--ink-soft); }
.btn-ai {
  border: 0; background: #5a3fd6; color: #fff; font-weight: 800; font-size: 13px;
  padding: 10px 16px; border-radius: 10px; display: inline-flex; align-items: center; gap: 8px;
  white-space: nowrap; cursor: pointer; font-family: inherit;
}
.btn-ai:hover { background: #492fc0; }
.ai-out {
  margin-top: 12px; border: 1px solid #ddd3f2; border-radius: 13px;
  overflow: hidden; background: #fff; animation: rise .3s cubic-bezier(.2, .7, .3, 1);
}
.ai-out .ah {
  display: flex; align-items: center; gap: 8px; background: #f7f4ff;
  border-bottom: 1px solid #e7defa; padding: 9px 14px; font-size: 12px;
  font-weight: 700; color: #5a3fd6;
}
.ai-body { padding: 4px 16px 16px; }
.ai-body h4 { font-size: 12.5px; color: #5a3fd6; margin: 14px 0 5px; }
.ai-body p { margin: 0 0 4px; font-size: 13.5px; }
.ai-body ul { margin: 3px 0 4px; padding-left: 19px; }
.ai-foot {
  font-size: 11px; color: var(--ink-faint); border-top: 1px dashed var(--line);
  margin-top: 12px; padding-top: 9px;
}

.related { display: flex; flex-wrap: wrap; gap: 7px; }
.rchip {
  border: 1px solid var(--line); background: var(--card); font-size: 12.5px;
  padding: 5px 11px; border-radius: 20px; color: var(--ink-soft); cursor: pointer; font-family: inherit;
}
.rchip:hover { border-color: var(--brand); color: var(--brand-deep); }
.rchip .dot {
  display: inline-block; width: 7px; height: 7px; border-radius: 50%;
  margin-right: 6px; vertical-align: middle;
}
.corp-cand {
  border: 1px solid #ddd3f2; border-radius: 12px; background: #faf8ff; padding: 12px 14px;
}
.corp-cand .h {
  display: flex; align-items: center; gap: 7px; font-size: 12px;
  font-weight: 800; color: #5a3fd6; margin-bottom: 9px;
}
.corp-cand .h svg { width: 14px; height: 14px; }
.corp-root { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; margin-bottom: 6px; }
.corp-lab { font-size: 11px; color: var(--ink-faint); font-weight: 700; letter-spacing: .03em; }
.corp-sub { font-size: 11.5px; color: var(--ink-faint); margin: 11px 0 6px; font-weight: 700; }
.corp-badge {
  font-size: 10px; font-weight: 800; padding: 2px 8px; border-radius: 20px;
  background: var(--neutral-bg); color: var(--ink-soft); white-space: nowrap;
}
.corp-badge.spon { background: var(--stop-bg); color: var(--stop); }
.corp-badge.miss { background: #fff3df; color: #8a5a00; border: 1px dashed #e0a94e; }
.corp-badge.sm { padding: 1px 6px; margin-left: 3px; }
.hitbox {
  display: flex; gap: 11px; border-radius: 12px; padding: 12px 14px;
  margin-bottom: 9px; border: 1px solid;
}
.hitbox .ic { flex: 0 0 auto; }
.hitbox .tx { font-size: 13.5px; line-height: 1.55; }
.hitbox .tx b { display: block; margin-bottom: 1px; font-size: 14px; }
.hitbox.spon { background: var(--stop-bg); border-color: #f3c7c3; color: #7a1b13; }
.hitbox.spon .ic { color: var(--stop); }
.hitbox.caut { background: var(--caution-bg); border-color: #f3d391; color: #7a5200; }
.hitbox.caut .ic { color: var(--caution); }
.hitbox.pro { background: #f3efff; border-color: #ddd3f2; color: #3a2b7a; }
.hitbox.pro .ic { color: #5a3fd6; }
.hitbox.clear { background: var(--clear-bg); border-color: #bfe6d1; color: #0d5a38; }
.hitbox.clear .ic { color: var(--clear); }
.miss {
  font-size: 12.5px; color: var(--ink-faint); background: #fbfaf7;
  border: 1px dashed var(--line); border-radius: 10px; padding: 11px 13px;
}

.rolebadge {
  display: inline-flex; align-items: center; gap: 8px; background: #fff;
  border: 1px solid var(--line); border-radius: 20px; padding: 6px 12px 6px 14px;
  font-size: 12.5px; font-weight: 700; box-shadow: var(--sh);
}
.rolebadge.hidden { display: none !important; }
/* 認証確認中は本文を出さない（api.js の ready で解除） */
body.auth-pending main, body.auth-pending .userbox { visibility: hidden; }
/* 設定タブ */
.settings-body { display: flex; flex-direction: column; gap: 14px; }
.settings-body .fsect { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 16px 18px; }
.settings-body .fsect-h { margin-bottom: 4px; font-size: 12px; }
.settings-body .fsect-h .tb-sub { font-weight: 500; letter-spacing: 0; }
.settings-body .field label { display: block; font-size: 11px; font-weight: 700; color: var(--ink-faint); margin-bottom: 5px; letter-spacing: .04em; }
.settings-body .field input { width: 100%; box-sizing: border-box; font: inherit; font-size: 14px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 9px; background: #fff; }
.settings-body .field input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(238,122,0,.15); }
.settings-body .sm { font-size: 11.5px; color: var(--ink-faint); margin-top: 4px; }
.settings-body .grid2,
.settings-body .grid3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 10px 14px; }
.settings-body .field input, .settings-body .chip-field { max-width: 720px; }
@media (max-width: 720px) { .settings-body .grid3 { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .settings-body .grid2, .settings-body .grid3 { grid-template-columns: 1fr; } }
.chip-admin { border-color: var(--brand); color: var(--brand-deep); background: #fff7ee; font-weight: 700; }
/* 会議Bot: 実装予定の流れ */
.flowgrid {
  margin-top: 18px; display: grid; gap: 14px;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}
.flowcard {
  background: var(--card); border: 1px solid var(--line); border-radius: 14px;
  padding: 16px 18px; position: relative;
}
.flowcard .fnum {
  display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 8px;
  background: var(--brand); color: #231400; font-weight: 800; font-size: 13px; margin-bottom: 10px;
}
.flowcard b { display: block; font-size: 14.5px; margin-bottom: 4px; }
.flowcard p { margin: 0; font-size: 13px; color: var(--ink-soft); line-height: 1.6; }
.rule-list { display: flex; flex-direction: column; gap: 8px; }
.rule-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 13px; }
.rule-row input.rule-match { width: 180px; }
.rule-row .rule-del { padding: 4px 10px; line-height: 1; }
/* ログインページ */
.login-wrap { min-height: calc(100vh - 60px); display: grid; place-items: center; padding: 24px 16px; }
.login-card {
  width: min(440px, 100%); background: var(--card); border: 1px solid var(--line); border-radius: 18px;
  padding: 34px 32px 28px; text-align: center; box-shadow: 0 10px 40px rgba(0,0,0,.06);
}
.login-card .mark { width: 64px; height: 64px; border-radius: 16px; margin: 0 auto 14px; display: block; }
.login-card h1 { font-size: 22px; margin: 0 0 4px; font-weight: 800; }
.login-card .sub { color: var(--ink-faint); font-size: 12.5px; letter-spacing: .12em; margin: 0 0 18px; }
.login-card p { color: var(--ink-soft); font-size: 13.5px; margin: 0 0 22px; line-height: 1.7; }
.login-btn {
  width: 100%; border: 0; background: var(--brand); color: #231400; font: inherit; font-weight: 800; font-size: 15px;
  padding: 13px 16px; border-radius: 12px; cursor: pointer; display: inline-flex; justify-content: center; align-items: center; gap: 8px;
}
.login-btn:hover { background: var(--brand-deep); color: #fff; }
.login-btn:disabled { opacity: .6; cursor: progress; }
.login-note { margin-top: 16px; font-size: 12px; color: var(--ink-faint); }
.login-err { margin-top: 14px; }
.rolebadge .lab { color: var(--ink-soft); font-weight: 700; font-size: 11.5px; }
.rolebadge select {
  border: 1px solid var(--line); border-radius: 8px; padding: 4px 8px;
  font: inherit; font-weight: 700; color: var(--brand-deep); background: #fff;
  cursor: pointer;
}
.tablewrap {
  background: var(--card); border: 1px solid var(--line); border-radius: 14px; overflow: hidden;
}
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { padding: 10px 16px; border-bottom: 1px solid #efeee9; text-align: left; }
th { font-size: 11px; color: var(--ink-faint); text-transform: uppercase; }
.status { font-size: 11px; color: var(--ink-faint); font-family: var(--mono); }
.notice {
  display: flex; gap: 10px; align-items: flex-start;
  background: #fff7ee; border: 1px solid #f4d8ac; border-radius: 10px;
  padding: 10px 14px; font-size: 12.5px; color: #7a5200; margin-bottom: 18px;
}
.notice svg { flex: 0 0 auto; margin-top: 1px; }
.toast {
  position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%);
  background: var(--ink); color: #fff; padding: 11px 18px; border-radius: 10px;
  opacity: 0; transition: .25s; pointer-events: none; z-index: 50;
}
.toast.show { opacity: 1; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin: 18px 0 20px; }
.tabs button {
  border: 0; background: transparent; color: var(--ink-soft); font-weight: 700;
  padding: 11px 16px; border-bottom: 2.5px solid transparent; cursor: pointer; font-family: inherit;
}
.tabs button.on { color: var(--brand-deep); border-bottom-color: var(--brand); }
.hidden { display: none !important; }
/* 認証確認中は本文を出さない（api.js の ready で解除） */
body.auth-pending main, body.auth-pending .userbox { visibility: hidden; }
/* ログインページ */
.login-wrap { min-height: calc(100vh - 60px); display: grid; place-items: center; padding: 24px 16px; }
.login-card {
  width: min(440px, 100%); background: var(--card); border: 1px solid var(--line); border-radius: 18px;
  padding: 34px 32px 28px; text-align: center; box-shadow: 0 10px 40px rgba(0,0,0,.06);
}
.login-card .mark { width: 64px; height: 64px; border-radius: 16px; margin: 0 auto 14px; display: block; }
.login-card h1 { font-size: 22px; margin: 0 0 4px; font-weight: 800; }
.login-card .sub { color: var(--ink-faint); font-size: 12.5px; letter-spacing: .12em; margin: 0 0 18px; }
.login-card p { color: var(--ink-soft); font-size: 13.5px; margin: 0 0 22px; line-height: 1.7; }
.login-btn {
  width: 100%; border: 0; background: var(--brand); color: #231400; font: inherit; font-weight: 800; font-size: 15px;
  padding: 13px 16px; border-radius: 12px; cursor: pointer; display: inline-flex; justify-content: center; align-items: center; gap: 8px;
}
.login-btn:hover { background: var(--brand-deep); color: #fff; }
.login-btn:disabled { opacity: .6; cursor: progress; }
.login-note { margin-top: 16px; font-size: 12px; color: var(--ink-faint); }
.login-err { margin-top: 14px; }
.owner {
  display: flex; gap: 12px; align-items: center; background: #fbfaf7;
  border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; margin: 6px 0;
}
.tag {
  display: inline-block; font-size: 12px; padding: 4px 10px; border-radius: 7px;
  background: #eeedea; color: var(--ink-soft); font-weight: 600; margin-right: 6px;
}
.panel-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  margin-bottom: 10px; flex-wrap: wrap;
}
.panel-head b { font-size: 15px; }
.panel-head .cnt { font-size: 12px; color: var(--ink-faint); font-family: var(--mono); }
.filterbar {
  display: flex; flex-wrap: wrap; gap: 8px; align-items: center;
  margin-bottom: 10px; padding: 10px 12px;
  background: #fbfaf7; border: 1px solid var(--line); border-radius: 10px;
}
.filterbar .fl { font-size: 11px; font-weight: 700; color: var(--ink-faint); letter-spacing: .06em; }
.filterbar select, .filterbar input, .modal-body input, .modal-body select, .modal-body textarea {
  border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px;
  font: inherit; background: #fff; min-width: 0; color: var(--ink);
}
.modal-body input:focus, .modal-body select:focus, .modal-body textarea:focus {
  outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(238, 122, 0, .12);
}
.filterbar input.fq { flex: 1; min-width: 140px; }
.filterbar .clr {
  border: 0; background: transparent; color: var(--brand-deep);
  font-weight: 700; font-size: 12.5px; cursor: pointer; font-family: inherit;
}
.tb-name { font-weight: 700; }
.tb-sub { font-size: 12px; color: var(--ink-faint); }
.ps {
  display: inline-block; font-size: 11.5px; font-weight: 800; padding: 3px 9px;
  border-radius: 999px; background: #eeedea; color: var(--ink-soft);
}
.ps.mikomi { background: #eef2ff; color: #3b4db8; }
.ps.shodan { background: #f3efff; color: #5a3fd6; }
.ps.juchu { background: #e9f6ef; color: #12925a; }
.ps.shitsu { background: #fdeceb; color: #d92c20; }
.ps.hoyu { background: #f4f3ef; color: #5a5b63; }
.rowops { display: flex; gap: 6px; }
.rowops button {
  border: 1px solid var(--line); background: #fff; border-radius: 7px;
  padding: 4px 10px; font-size: 12px; font-weight: 700; cursor: pointer; font-family: inherit;
}
.rowops .rowdel { color: var(--stop); }
.scrollbox { max-height: min(72vh, calc(100dvh - 240px)); overflow: auto; }
/* 長い一覧を下までスクロールしても列の意味が分かるように見出しを固定 */
.scrollbox thead th {
  position: sticky; top: 0; z-index: 2; background: #faf9f6;
  box-shadow: inset 0 -1px 0 var(--line);
}
/* 並べ替えできる列 */
.scrollbox th.sortable { cursor: pointer; user-select: none; white-space: nowrap; }
.scrollbox th.sortable:hover { color: var(--ink); }
.scrollbox th.sortable .ind { margin-left: 4px; opacity: .35; font-size: 9px; }
.scrollbox th.sortable.on { color: var(--brand-deep); }
.scrollbox th.sortable.on .ind { opacity: 1; }
.modal-bg {
  position: fixed; inset: 0; background: rgba(18, 20, 26, .48);
  display: none; align-items: center; justify-content: center; z-index: 40; padding: 16px;
}
.modal-bg.show { display: flex; }
.modal {
  background: #fff; border-radius: 16px; width: min(520px, 100%);
  max-height: min(92vh, 920px);
  display: flex; flex-direction: column;
  overflow: hidden;
  box-shadow: var(--sh-lg);
  border: 1px solid rgba(20, 22, 28, .06);
}
/* PC 前提。縦スクロールを避けるため横に広く取る */
.modal.size-sm { width: min(480px, 96vw); }
.modal.size-md { width: min(880px, 96vw); }
.modal.size-lg { width: min(1180px, 96vw); }
.modal.size-xl { width: min(1320px, 96vw); }
/* 2 段組みフォーム（左右に fsect を並べる） */
.modal-body .fgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 14px; align-items: start; }
.modal-body .fcol { display: grid; gap: 12px; align-content: start; }
@media (max-width: 900px) { .modal-body .fgrid { grid-template-columns: 1fr; } }
.modal-h {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 12px;
  padding: 16px 20px 14px; border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, #fcfbf9 0%, #fff 100%);
  flex: 0 0 auto;
}
.modal-h-text { display: grid; gap: 2px; min-width: 0; }
.modal-kicker {
  font-size: 11px; font-weight: 700; color: var(--brand-deep);
  letter-spacing: .08em; text-transform: none;
}
.modal-kicker:empty { display: none; }
.modal-h b { font-size: 17px; letter-spacing: .01em; line-height: 1.3; }
.modal-h .x {
  border: 0; background: transparent; font-size: 22px; cursor: pointer; color: var(--ink-faint);
  line-height: 1; padding: 0 2px; margin-top: -2px;
}
.modal-h .x:hover { color: var(--ink); }
.modal-body {
  padding: 14px 20px 16px; display: grid; gap: 10px;
  overflow: auto; flex: 1 1 auto; min-height: 0;
  align-content: start;
}
.modal-body .field label {
  display: block; font-size: 11px; font-weight: 700; color: var(--ink-faint);
  margin-bottom: 5px; letter-spacing: .04em;
}
.modal-body .field.primary label {
  font-size: 11.5px; color: var(--ink-soft); letter-spacing: .06em;
}
.modal-body .field.primary input,
.modal-body .field.primary .view-val {
  font-size: 17px; font-weight: 750; letter-spacing: .01em;
}
.modal-body .field.primary input { padding: 10px 12px; }
.modal-body .grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 14px; }
.modal-body .grid3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px 14px; }
@media (max-width: 720px) {
  .modal-body .grid3 { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 560px) {
  .modal-body .grid2,
  .modal-body .grid3 { grid-template-columns: 1fr; }
}
.fsect {
  display: grid; gap: 10px;
  padding: 12px 12px 12px;
  background: #faf9f6;
  border: 1px solid var(--line-soft);
  border-radius: 12px;
}
.fsect-h {
  font-size: 11px; font-weight: 800; color: var(--ink-soft);
  letter-spacing: .08em; margin: 0 0 2px;
  padding-bottom: 6px; border-bottom: 1px solid var(--line);
}
.modal-body .field .sm,
.modal-body > .sm {
  font-size: 11px; color: var(--ink-faint); margin-top: 5px; line-height: 1.45;
}
.sdot { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 750; white-space: nowrap; }
.sdot i { width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex: 0 0 auto; }
.row-click { cursor: pointer; }
.row-click:hover td { background: #faf9f6; }
.tb-chips, .chip-wrap, .chip-list { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.chip-field .chip,
.tb-chips .chip,
.chip-wrap .chip {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 12px; font-weight: 650; line-height: 1.2;
  padding: 4px 8px; border-radius: 999px;
  background: #f0eeea; color: var(--ink-soft); border: 1px solid var(--line);
  cursor: default;
}
.chip-field .chip.chip-ro,
.tb-chips .chip.chip-ro,
.chip-wrap .chip.chip-ro { padding: 3px 8px; }
.chip-wrap .chip.chip-link {
  cursor: pointer;
  font: inherit;
  font-size: 12px;
  font-weight: 600;
}
.chip-wrap .chip.chip-link:hover {
  border-color: var(--brand);
  color: var(--brand-deep);
}
.chip-x {
  border: 0; background: transparent; color: var(--ink-faint);
  font-size: 14px; line-height: 1; cursor: pointer; padding: 0 2px; font-family: inherit;
}
.chip-x:hover { color: var(--stop); }
.chip-add { display: flex; gap: 8px; margin-top: 8px; }
.chip-add .chip-input { flex: 1; min-width: 0; }
.chip-add-btn {
  border: 1px solid var(--line); background: #fff; border-radius: 8px;
  padding: 7px 12px; font-weight: 700; font-size: 12.5px; cursor: pointer; font-family: inherit; white-space: nowrap;
}
.view-val { font-size: 14.5px; color: var(--ink); padding: 3px 0; font-weight: 600; line-height: 1.45; }
.view-val.muted { color: var(--ink-soft); font-weight: 500; font-size: 13.5px; }
.view-val.primary { font-size: 20px; font-weight: 800; letter-spacing: .01em; padding: 2px 0 4px; }
.view-pre { white-space: pre-wrap; line-height: 1.55; font-weight: 500; color: var(--ink-soft); }
.entity-f { display: flex; align-items: center; gap: 8px; }
.entity-f-spacer { flex: 1; }
.btn-danger {
  border: 1px solid #f3c7c3; background: var(--stop-bg); color: var(--stop);
  border-radius: 8px; padding: 8px 14px; font-weight: 800; font-size: 13px;
  cursor: pointer; font-family: inherit;
}
.btn-danger:hover { background: #f8d9d6; }
.modal-body .field label.check,
.settings-body .field label.check {
  display: flex; align-items: flex-start; gap: 8px; cursor: pointer;
  font-weight: 650; color: var(--ink); font-size: 13.5px; letter-spacing: 0;
  text-transform: none;
}
.modal-body .field label.check input,
.settings-body .field label.check input { margin-top: 3px; flex: 0 0 auto; width: auto; max-width: none; }
.modal-body select { width: 100%; }
/* 入力欄は列の幅いっぱいに（チェックボックス・ラジオは除く） */
.modal-body input:not([type="checkbox"]):not([type="radio"]) { width: 100%; box-sizing: border-box; }
.modal-body input[type="date"] { max-width: 220px; }
.modal-body textarea {
  min-height: 56px; max-height: 140px; resize: vertical; width: 100%;
  font-size: 13.5px; line-height: 1.5;
}
.modal-body textarea.tall { min-height: 88px; }
.modal-f {
  display: flex; justify-content: flex-end; gap: 8px; align-items: center;
  padding: 12px 20px 16px; border-top: 1px solid var(--line);
  background: #fcfbf9; flex: 0 0 auto;
}
.modal-f .btn {
  min-width: 96px; padding: 10px 16px; font-weight: 800;
}
.modal-f .btn-ghost { padding: 10px 14px; }

/* Page / admin hierarchy */
.page-title {
  margin: 0; font-size: 24px; letter-spacing: .01em; font-weight: 800; line-height: 1.25;
}
.page-sub {
  margin: 4px 0 0; font-size: 13px; color: var(--ink-faint); font-weight: 500;
}
#api-status { margin-top: 8px; }
.tabs {
  display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin: 16px 0 18px;
  overflow-x: auto; -webkit-overflow-scrolling: touch;
}
.tabs button {
  border: 0; background: transparent; color: var(--ink-faint); font-weight: 700;
  font-size: 13px; padding: 12px 14px; border-bottom: 2.5px solid transparent;
  cursor: pointer; font-family: inherit; white-space: nowrap;
}
.tabs button:hover { color: var(--ink-soft); }
.tabs button.on { color: var(--brand-deep); border-bottom-color: var(--brand); }
.thead-row {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--line-soft);
  background: linear-gradient(180deg, #fcfbf9, #f7f6f2);
}
.thead-row b { font-size: 15px; font-weight: 800; letter-spacing: .01em; }
.thead-row .tb-sub { font-size: 12px; font-weight: 500; color: var(--ink-faint); }
.cnt {
  font-size: 12px; font-weight: 700; color: var(--ink-faint);
  font-variant-numeric: tabular-nums;
}
.cnt .filtered { color: var(--brand-deep); }
table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
th, td { padding: 11px 16px; border-bottom: 1px solid #efeee9; text-align: left; vertical-align: top; }
th {
  font-size: 10.5px; color: var(--ink-faint); font-weight: 800;
  letter-spacing: .08em; text-transform: none; background: #faf9f6;
}
.tb-name { font-weight: 750; font-size: 14px; color: var(--ink); }
/* 広い画面でも間延びしないよう、決まった長さの列は幅を固定する（残りは文字の多い列へ） */
th.w-s { width: 110px; }
th.w-m { width: 170px; }
th.w-l { width: 240px; }
th.w-xl { width: 320px; }
/* 画面が広いときだけ出す補助列 */
@media (max-width: 1400px) { .opt-col { display: none; } }
.tb-sub { font-size: 12px; color: var(--ink-faint); font-weight: 500; margin-top: 2px; }
.filterbar {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
  margin-bottom: 10px; padding: 10px 12px;
  background: #fbfaf7; border: 1px solid var(--line); border-radius: 10px;
}
.filterbar .fl {
  font-size: 10.5px; font-weight: 800; color: var(--ink-faint); letter-spacing: .08em;
}
.pf-row { display: flex; align-items: center; gap: 8px; margin: 4px 0; font-size: 13px; }
.pf-genres { max-height: 180px; overflow: auto; border: 1px solid var(--line); border-radius: 8px; padding: 8px; background: #fff; }
.print-area { display: none; }
@media print {
  body * { visibility: hidden !important; }
  .print-area, .print-area * { visibility: visible !important; }
  .print-area { display: block !important; position: absolute; left: 0; top: 0; width: 100%; }
  .modal-bg, header, .toast, #pop { display: none !important; }
}
/* A3 1 枚ぴったりの用紙枠（@page の余白 10mm を引いた内寸。1mm の安全代あり） */
.p-page {
  break-after: page; box-sizing: border-box; overflow: hidden; padding: 4mm;
  background: #fff; color: #000;
}
.p-page:last-child { break-after: auto; }
.p-page.landscape { width: 400mm; height: 276mm; }
.p-page.portrait { width: 277mm; height: 399mm; }
.p-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 4mm; }
.p-head h1 { font-size: 15px; margin: 0; }
.p-meta { font-size: 10.5px; color: #666; white-space: nowrap; }
/* 中身は段組みで流し、入りきらないときだけ縮小する（JS: fitPrintPages） */
.p-fit { transform-origin: top left; }
.p-body { column-gap: 5mm; }
.p-dept {
  font-size: 12px; font-weight: 800; margin: 0 0 3mm; padding-bottom: 2px;
  border-bottom: 2px solid #333; break-inside: avoid; break-after: avoid;
}
.p-col {
  break-inside: avoid; margin: 0 0 3mm;
  border: 1px solid #ddd; border-radius: 6px; padding: 5px 7px; font-size: 11px;
}
.p-owner { font-weight: 800; display: flex; gap: 6px; align-items: baseline; }
.p-n { margin-left: auto; font-family: monospace; color: #888; font-weight: 600; }
.p-col ul { margin: 4px 0 0; padding-left: 14px; }
.p-col li { line-height: 1.4; }
.p-cat { color: #888; font-size: 10px; margin-left: 4px; }
.p-empty { color: #999; font-size: 11px; padding: 4px 0; }

/* ===== Admin toolbar / edit mode ===== */
.admin-toolbar {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: 4px 0 14px;
}
.modeseg {
  display: inline-flex; background: #ecebe6; border: 1px solid var(--line);
  border-radius: 9px; padding: 3px; gap: 2px;
}
.modeseg button {
  border: 0; background: transparent; color: var(--ink-soft); font-weight: 700;
  font-size: 12.5px; padding: 6px 16px; border-radius: 6px; cursor: pointer; font-family: inherit;
}
.modeseg button[aria-current="true"] { background: #fff; color: var(--ink); box-shadow: var(--sh); }
.modeseg button.edit[aria-current="true"] { color: var(--brand-deep); }
.mode-hint { font-size: 12px; color: var(--ink-faint); }
.pendingbar {
  display: none; align-items: center; gap: 10px; margin-left: auto;
  background: var(--caution-bg); border: 1px solid #f3d391; border-radius: 10px;
  padding: 6px 8px 6px 13px;
}
#view-admin.dirty .pendingbar { display: flex; }
.pendingbar .dt {
  font-size: 12.5px; font-weight: 700; color: #7a5200;
  display: flex; align-items: center; gap: 7px;
}
.pendingbar .dt i {
  width: 8px; height: 8px; border-radius: 50%; background: var(--caution);
  display: inline-block; animation: blink 1.4s infinite;
}
@keyframes blink { 50% { opacity: .35; } }
@media (prefers-reduced-motion: reduce) { .pendingbar .dt i { animation: none; } }
.btn-save {
  border: 0; background: var(--clear); color: #fff; font-weight: 800;
  font-size: 12.5px; padding: 8px 14px; border-radius: 8px; cursor: pointer; font-family: inherit;
}
.btn-save:hover { background: #0d7a4a; }
.btn-discard {
  border: 1px solid #e6c98f; background: #fff; color: #8a5a00; font-weight: 700;
  font-size: 12.5px; padding: 8px 12px; border-radius: 8px; cursor: pointer; font-family: inherit;
}
.btn-discard:hover { background: #fff6e8; }
#view-admin:not(.editing) .edit-only { display: none !important; }

/* ===== Assignment board (PoC) ===== */
.board-intro { display: flex; gap: 14px; flex-wrap: wrap; align-items: center; margin: 2px 0 16px; }
.kind-legend {
  display: flex; gap: 14px; flex-wrap: wrap; align-items: center;
  font-size: 12px; color: var(--ink-soft);
}
.kind-legend span { display: inline-flex; align-items: center; gap: 6px; }
.kind-legend i { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }
.kind-legend i.sp { background: var(--brand); }
.kind-legend i.ad { background: #2f6fd0; }
.kind-legend i.bo {
  background: linear-gradient(180deg, var(--brand) 0, var(--brand) 50%, #2f6fd0 50%, #2f6fd0 100%);
}
.verbar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; flex-wrap: wrap; margin: 2px 0 12px;
}
.verbar .vb-l b { font-size: 15px; }
.verbar .vb-sub { font-size: 11.5px; color: var(--ink-faint); margin-left: 7px; }
.verbar .vb-r { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.verbar .fl { font-size: 11px; color: var(--ink-faint); font-weight: 700; }
.verbar select {
  border: 1px solid var(--line); border-radius: 8px; padding: 7px 10px; font: inherit; background: #fff;
}
.verpub {
  border: 0; background: var(--brand); color: #231400; font-weight: 800;
  font-size: 12.5px; padding: 8px 14px; border-radius: 9px; white-space: nowrap;
  cursor: pointer; font-family: inherit;
}
.verpub:hover { background: var(--brand-deep); color: #fff; }
.verghost {
  border: 1px solid var(--brand); background: #fff; color: var(--brand-deep);
  font-weight: 800; font-size: 12.5px; padding: 8px 12px; border-radius: 9px;
  display: inline-flex; align-items: center; gap: 6px; white-space: nowrap;
  cursor: pointer; font-family: inherit;
}
.verghost:hover { background: var(--brand); color: #231400; }
.verprint {
  border: 1px solid var(--line); background: #fff; color: var(--ink-soft);
  font-weight: 700; font-size: 12.5px; padding: 8px 12px; border-radius: 9px;
  display: inline-flex; align-items: center; gap: 6px; white-space: nowrap;
  cursor: pointer; font-family: inherit;
}
.verprint:hover { border-color: var(--ink-faint); color: var(--ink); }
.verrestore {
  border: 1px solid var(--brand); background: #fff; color: var(--brand-deep);
  font-weight: 800; font-size: 13px; padding: 11px 16px; border-radius: 9px;
  cursor: pointer; font-family: inherit;
}
.verrestore:hover { background: var(--brand); color: #231400; }
.filterbar.fb-board {
  border-radius: 12px; margin-bottom: 14px; box-shadow: var(--sh); background: var(--card);
}
.board-subtabs {
  display: flex; gap: 4px; margin: 0 0 12px; border-bottom: 1px solid var(--line); flex-wrap: wrap;
}
.board-subtabs button {
  border: 0; background: transparent; padding: 9px 16px; font-weight: 800;
  font-size: 13.5px; color: var(--ink-soft); border-bottom: 2px solid transparent;
  cursor: pointer; display: inline-flex; align-items: center; gap: 7px; font-family: inherit;
}
.board-subtabs button.on { color: var(--brand-deep); border-bottom-color: var(--brand); }
.board-subtabs .cnt { font-size: 11px; color: var(--ink-faint); font-weight: 600; }
.board-subtabs button.on .cnt { color: var(--brand-deep); }

.region { margin-bottom: 22px; }
.region > h3 {
  font-size: 13px; font-weight: 800; margin: 0 0 10px;
  display: flex; align-items: center; gap: 8px;
}
.region > h3 .rc {
  font-family: var(--mono); font-size: 10.5px; color: var(--ink-faint); font-weight: 600;
}
.cols {
  /* ボード自体をスクロール領域にして、担当者の見出しを貼り付ける（JS が高さを画面に合わせる） */
  display: flex; gap: 12px; overflow: auto; padding-bottom: 8px; align-items: flex-start;
  overscroll-behavior: contain;
}
.ver-board .cols { max-height: 58vh; }
.col {
  flex: 0 0 216px; background: #fbfaf7; border: 1px solid var(--line); border-radius: 12px;
  display: flex; flex-direction: column; min-height: 96px;
  transition: border-color 0.12s, box-shadow 0.12s;
}
.col.unassigned { background: #fdf6ee; border-style: dashed; }
.col.over { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(238, 122, 0, 0.14); }
.col-head {
  display: flex; align-items: center; gap: 9px; padding: 11px 12px;
  border-bottom: 1px solid var(--line-soft);
  position: sticky; top: 0; z-index: 3;      /* 縦スクロールしても担当者名が見える */
  background: #fbfaf7; border-radius: 12px 12px 0 0;
}
.col.unassigned .col-head { background: #fdf6ee; }
.cols.stuck .col-head { box-shadow: 0 3px 8px rgba(20, 20, 25, .07); }
.cols.stuck .col-head .rl { display: none; }   /* 貼り付き時は 1 行に詰める */
.col-head .av {
  width: 32px; height: 32px; border-radius: 9px;
  background: linear-gradient(135deg, var(--brand), var(--brand-deep));
  color: #fff; display: grid; place-items: center; font-weight: 800; font-size: 13px; flex: 0 0 auto;
}
.col-head .nm { font-weight: 800; font-size: 13px; line-height: 1.2; }
.col-head .rl { font-size: 10.5px; color: var(--ink-faint); }
.col-head .n { margin-left: auto; font-family: var(--mono); font-size: 10.5px; color: var(--ink-faint); }
.col-body {
  padding: 9px; display: flex; flex-direction: column; gap: 7px; min-height: 46px; flex: 1;
}
.col-empty { font-size: 11.5px; color: var(--ink-faint); text-align: center; padding: 12px 4px; }

.card {
  background: #fff; border: 1px solid var(--line); border-radius: 9px;
  padding: 8px 10px; box-shadow: 0 1px 1px rgba(20, 20, 25, 0.04); position: relative;
}
#view-admin.editing .card { cursor: grab; }
#view-admin.editing .card:active { cursor: grabbing; }
.card.drag { opacity: 0.45; }
.card .cn {
  font-weight: 700; font-size: 12.5px; display: flex; align-items: center;
  gap: 6px; padding-right: 20px; padding-left: 12px;
}
.card .ct { font-size: 10.5px; color: var(--ink-faint); margin-top: 1px; padding-left: 12px; }
.card .mv {
  position: absolute; top: 6px; right: 6px; border: 0; background: var(--neutral-bg);
  color: var(--ink-soft); font-size: 12px; width: 22px; height: 22px; border-radius: 6px;
  display: none; align-items: center; justify-content: center; cursor: pointer; font-family: inherit;
}
#view-admin.editing .card .mv { display: flex; }
.card .mv:hover { background: var(--brand); color: #231400; }
.kbar { position: absolute; left: 4px; top: 8px; bottom: 8px; width: 5px; border-radius: 3px; }
.kbar.sponsor { background: var(--brand); }
.kbar.ad { background: #2f6fd0; }
.kbar.both {
  background: linear-gradient(180deg, var(--brand) 0 50%, #2f6fd0 50% 100%);
}

.mmap {
  position: relative; height: 30px; margin: 2px 0 10px; border: 1px solid var(--line);
  border-radius: 8px; background: #fbfaf7; overflow: hidden; cursor: pointer; user-select: none;
}
.mmap.fit { cursor: default; background: #faf9f6; }
.mmap-track { display: flex; gap: 2px; height: 100%; padding: 3px; }
.mmap-col {
  flex: 1; min-width: 0; background: #eceae4; border-radius: 4px;
  display: flex; align-items: center; justify-content: center; gap: 4px;
  font-size: 9px; color: var(--ink-faint); overflow: hidden;
}
.mmap-col.un { background: #f2e6d5; }
.mmap-col .mc-i { font-weight: 800; color: var(--ink-soft); }
.mmap-col .mc-n { font-family: var(--mono); }
.mmap-view {
  position: absolute; top: 0; bottom: 0; background: rgba(238, 122, 0, 0.15);
  border: 1.5px solid var(--brand); border-radius: 6px; pointer-events: none;
}
.mmap.fit .mmap-view { background: rgba(120, 120, 120, 0.05); border-color: var(--line); }
.mmap-hint {
  position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
  font-size: 9.5px; color: var(--ink-faint); background: rgba(255, 255, 255, 0.72);
  padding: 1px 6px; border-radius: 4px; display: none; pointer-events: none;
}
.mmap.fit .mmap-hint { display: block; }

.empty-state {
  text-align: center; padding: 36px 16px; color: var(--ink-soft);
  background: #fbfaf7; border: 1px dashed var(--line); border-radius: 12px;
}
.empty-state .big { font-size: 15px; font-weight: 800; color: var(--ink); margin-bottom: 6px; }

.pop {
  position: fixed; z-index: 90; background: #fff; border: 1px solid var(--line);
  border-radius: 11px; box-shadow: var(--sh-lg); padding: 7px; min-width: 210px;
  max-height: 320px; overflow: auto; display: none;
}
.pop.show { display: block; }
.pop .ph {
  font-size: 10px; letter-spacing: 0.08em; color: var(--ink-faint);
  text-transform: uppercase; padding: 6px 8px 3px;
}
.pop button {
  display: flex; align-items: center; gap: 8px; width: 100%; border: 0;
  background: transparent; text-align: left; font-size: 12.5px; padding: 7px 8px;
  border-radius: 7px; cursor: pointer; font-family: inherit;
}
.pop button:hover { background: var(--neutral-bg); }
.pop button.cur { color: var(--brand-deep); font-weight: 800; }
.pop .miniav {
  width: 22px; height: 22px; border-radius: 6px;
  background: linear-gradient(135deg, var(--brand), var(--brand-deep));
  color: #fff; display: grid; place-items: center; font-weight: 800; font-size: 10px;
}

.lamp { transition: transform 0.35s ease, box-shadow 0.35s ease; }
.lamp.on { transform: scale(1.06); box-shadow: 0 0 0 6px rgba(0, 0, 0, 0.04); }
.vbadge {
  display: inline-block; font-size: 11px; font-weight: 800; padding: 2px 8px;
  border-radius: 6px; margin-left: 6px;
}
.vbadge.sponsor { background: var(--stop-bg); color: var(--stop); }
.vbadge.sponsor_ok { background: var(--caution-bg); color: var(--caution); }
.vbadge.clear { background: var(--clear-bg); color: var(--clear); }

/* 企業区分のチェックボックス（複数選択）と、その下の「直接連絡OK」 */
.modal-body .field .checks { display: flex; flex-wrap: wrap; gap: 8px 22px; }
.modal-body .field label.check.check-sub { margin-top: 8px; }
.modal-body .field label.check.is-off { color: var(--ink-faint); cursor: not-allowed; }
.kbar.none { background: var(--line); }
.kind-legend i.no { background: var(--line); }

/* 検索して選ぶ入力（SponPick） */
.pick { position: relative; }
.pick .pick-in { width: 100%; box-sizing: border-box; padding-right: 30px; }
.pick .pick-x {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  width: 22px; height: 22px; border: 0; background: transparent; cursor: pointer;
  color: var(--ink-faint); font-size: 16px; line-height: 1; border-radius: 6px;
}
.pick .pick-x:hover { background: var(--line-soft); color: var(--ink); }
.pick .pick-list {
  position: absolute; z-index: 60; left: 0; right: 0; top: calc(100% + 4px);
  max-height: 260px; overflow: auto; background: #fff;
  border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 12px 28px rgba(0,0,0,.14);
}
.pick.up .pick-list { top: auto; bottom: calc(100% + 4px); }
.pick .pick-op {
  display: flex; align-items: baseline; gap: 8px; width: 100%; text-align: left;
  border: 0; background: transparent; cursor: pointer; font-family: inherit;
  padding: 8px 10px; font-size: 13px; color: var(--ink);
}
.pick .pick-op b { font-weight: 700; }
.pick .pick-op span { color: var(--ink-faint); font-size: 11.5px; }
.pick .pick-op:hover, .pick .pick-op.on { background: var(--caution-bg); }
.pick .pick-op.cur { color: var(--brand); }
.pick .pick-none { padding: 10px; font-size: 12.5px; color: var(--ink-faint); }

/* ===== モード切り替え（ページ見出しの右） ===== */
.page-head { display: flex; align-items: flex-start; gap: 16px; }
.page-head > div:first-child { flex: 1 1 auto; min-width: 0; }
.modeswitch {
  flex: 0 0 auto; margin-top: 6px; display: inline-flex; align-items: center; gap: 9px;
  border: 1px solid var(--line); background: #fff; color: var(--ink-soft);
  border-radius: 999px; padding: 8px 14px 8px 13px; cursor: pointer;
  font-family: inherit; font-size: 13px; font-weight: 800; box-shadow: var(--sh);
}
.modeswitch:hover { border-color: #d9d6cd; }
.modeswitch .ms-ic { opacity: .65; }
.modeswitch .ms-sw {
  width: 34px; height: 19px; border-radius: 999px; background: #d8d6cf;
  position: relative; transition: background .15s;
}
.modeswitch .ms-sw i {
  position: absolute; top: 2px; left: 2px; width: 15px; height: 15px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.25); transition: left .15s;
}
.modeswitch .ms-st { font-family: var(--mono); font-size: 11px; color: var(--ink-faint); letter-spacing: .06em; }
.modeswitch[aria-pressed="true"] {
  border-color: var(--brand); color: var(--brand-deep); background: var(--caution-bg);
}
.modeswitch[aria-pressed="true"] .ms-ic { opacity: 1; }
.modeswitch[aria-pressed="true"] .ms-sw { background: var(--brand); }
.modeswitch[aria-pressed="true"] .ms-sw i { left: 17px; }
.modeswitch[aria-pressed="true"] .ms-st { color: var(--brand-deep); }
/* 編集モード中は本文の左に帯を出して、今どちらかを一目で分かるようにする */
#view-admin.editing > .tabs { border-left: 3px solid var(--brand); padding-left: 9px; }
@media (max-width: 720px) { .page-head { flex-wrap: wrap; } }

/* 担当変更ポップオーバーの検索 */
#pop .pq { padding: 6px 8px; position: sticky; top: 0; background: #fff; border-bottom: 1px solid var(--line-soft); }
#pop .pq input { width: 100%; box-sizing: border-box; font-family: inherit; font-size: 12.5px; padding: 6px 8px; border: 1px solid var(--line); border-radius: 7px; }
#pop .pl { max-height: 260px; overflow: auto; }
/* 閲覧モードのカードはクリックで企業情報を開ける */
#view-admin:not(.editing) .board .card, #view-admin:not(.editing) #board .card { cursor: pointer; }
#view-admin:not(.editing) #board .card:hover { border-color: var(--brand); }

/* ログイン: 社内 SSO を主動線に、ID+パスワードは控えめに */
.login-btn.ghost {
  background: #fff; color: var(--ink); border: 1px solid var(--line); font-weight: 700; font-size: 14px;
}
.login-btn.ghost:hover { background: var(--line-soft); color: var(--ink); border-color: #d9d6cd; }
.login-btn .ms { flex: 0 0 auto; }
.login-card .login-sub { font-size: 11.5px; color: var(--ink-faint); margin: 7px 0 0; }
.login-or {
  display: flex; align-items: center; gap: 10px; margin: 18px 0 14px; color: var(--ink-faint); font-size: 11.5px;
}
.login-or::before, .login-or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
/* display を指定した要素は hidden 属性が効かないので明示する */
.login-btn[hidden], .login-or[hidden] { display: none; }
#btn-partner { margin-top: 12px; }
