/* branca AIオフィス */
:root {
  --bg: #f2f4f8;
  --panel: #ffffff;
  --ink: #1e2433;
  --sub: #6b7385;
  --line: #e3e7ef;
  --brand: #4f5dd6;
  --brand-ink: #ffffff;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(20, 28, 50, .06), 0 8px 24px rgba(20, 28, 50, .07);
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Noto Sans JP", sans-serif;
  font-size: 15px;
  line-height: 1.6;
}
a { color: inherit; text-decoration: none; }
code { background: #eef0f6; border-radius: 6px; padding: 1px 6px; font-size: .9em; }

/* ===== シェル ===== */
.app { min-height: 100vh; display: flex; flex-direction: column; }
.topbar {
  display: flex; align-items: center; gap: 18px;
  background: var(--panel); border-bottom: 1px solid var(--line);
  padding: 10px 20px; position: sticky; top: 0; z-index: 20;
}
.brand { display: flex; align-items: center; gap: 10px; font-size: 15px; }
.brand-name b { color: var(--brand); }
.brand-mark {
  display: inline-flex; align-items: center; justify-content: center;
  width: 30px; height: 30px; border-radius: 9px;
  background: linear-gradient(135deg, #4f5dd6, #7c6cf0);
  color: #fff; font-weight: 700;
}
.brand-mark.big { width: 52px; height: 52px; border-radius: 14px; font-size: 24px; }
.topnav { display: flex; gap: 6px; flex: 1; }
.tn-item { padding: 7px 14px; border-radius: 10px; color: var(--sub); font-weight: 500; }
.tn-item:hover { background: #eef0f6; color: var(--ink); }
.tn-item.cur { background: #eceefc; color: var(--brand); font-weight: 700; }
.who { display: flex; align-items: center; gap: 12px; font-size: 13px; }
.who-name { font-weight: 600; }
.logout { color: var(--sub); }
.logout:hover { color: var(--ink); }
.main { flex: 1; width: 100%; max-width: 1160px; margin: 0 auto; padding: 26px 20px 60px; }

/* ===== ボタン ===== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 9px 16px; border-radius: 11px; border: 1px solid var(--line);
  background: var(--panel); color: var(--ink); font-size: 14px; font-weight: 600;
  cursor: pointer; transition: filter .15s, transform .05s;
}
.btn:hover { filter: brightness(.97); }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.btn.wide { width: 100%; }
.btn:disabled { opacity: .5; cursor: default; }

/* ===== フロア ===== */
.floor-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.floor-title { margin: 0; font-size: 22px; }
.floor-date { margin: 4px 0 0; color: var(--sub); font-size: 13px; }
.mode-badge {
  font-size: 12.5px; font-weight: 700; padding: 7px 13px; border-radius: 99px;
}
.mode-badge.demo { background: #fff3d6; color: #8a6100; border: 1px solid #f2dfae; }
.mode-badge.live { background: #e2f7ec; color: #147a48; border: 1px solid #bfe9d3; }

.avatar {
  flex: none; width: 52px; height: 52px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; font-size: 26px;
  background: color-mix(in srgb, var(--dept, var(--brand)) 14%, #fff);
  border: 2px solid color-mix(in srgb, var(--dept, var(--brand)) 40%, #fff);
}
.avatar.lg { width: 76px; height: 76px; font-size: 38px; margin: 0 auto; }
.avatar.sm { width: 36px; height: 36px; font-size: 18px; }
.dept-name { font-size: 12px; font-weight: 700; color: var(--dept, var(--brand)); letter-spacing: .04em; }
.emp-name { font-size: 16.5px; font-weight: 700; }
.emp-title { font-size: 12px; color: var(--sub); font-weight: 500; margin-left: 4px; }
.emp-tagline { font-size: 12px; color: var(--sub); margin-top: 2px; }

.ctx-list { list-style: none; margin: 0; padding: 10px 12px; background: #f7f8fb; border-radius: 10px; display: flex; flex-direction: column; gap: 5px; }
.ctx-list li { display: flex; justify-content: space-between; gap: 10px; font-size: 13px; }
.ctx-list.small li { font-size: 12.5px; }
.ctx-label { color: var(--sub); }
.ctx-value { font-weight: 700; text-align: right; }
.ctx-note { font-style: normal; font-size: 11px; color: var(--sub); font-weight: 500; }
.ctx-note.warn { color: #c2410c; font-weight: 700; }
.ctx-empty { margin: 0; padding: 12px; background: #f7f8fb; border-radius: 10px; color: var(--sub); font-size: 13px; }

/* ===== チャット ===== */
.chat-wrap { display: flex; gap: 20px; align-items: stretch; min-height: calc(100vh - 160px); }
.chat-side { flex: none; width: 250px; display: flex; flex-direction: column; gap: 14px; }
.back { color: var(--sub); font-size: 13px; }
.back:hover { color: var(--ink); }
.chat-emp {
  background: var(--panel); border-radius: var(--radius); box-shadow: var(--shadow);
  border-top: 4px solid var(--dept, var(--brand));
  padding: 18px; text-align: center;
}
.chat-emp .dept-name { margin-top: 10px; }
.chat-emp .emp-name { font-size: 18px; }
.side-ctx { background: var(--panel); border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px; }
.side-ctx-title { font-size: 12px; font-weight: 700; color: var(--sub); margin-bottom: 8px; }
.side-ctx .ctx-list { background: transparent; padding: 0; }

.chat-main {
  flex: 1; min-width: 0; display: flex; flex-direction: column;
  background: var(--panel); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden;
}
.chat-log { flex: 1; overflow-y: auto; padding: 20px; display: flex; flex-direction: column; gap: 14px; }
.msg { display: flex; gap: 10px; max-width: 85%; }
.msg.user { align-self: flex-end; flex-direction: row-reverse; }
.msg-avatar {
  flex: none; width: 36px; height: 36px; border-radius: 50%; font-size: 18px;
  display: flex; align-items: center; justify-content: center;
  background: color-mix(in srgb, var(--dept, var(--brand)) 14%, #fff);
}
.msg-bubble {
  padding: 10px 14px; border-radius: 14px; font-size: 14.5px; white-space: pre-wrap; word-break: break-word;
  background: #f3f4f9; border: 1px solid var(--line);
}
.msg.user .msg-bubble { background: var(--brand); border-color: var(--brand); color: #fff; }
.demo-tag {
  display: inline-block; margin-left: 8px; padding: 1px 7px; border-radius: 99px;
  font-size: 10.5px; font-weight: 700; background: #fff3d6; color: #8a6100; vertical-align: middle;
}
.demo-tag.kb { background: #e6f5ec; color: #1e7d4b; }
.chat-input { display: flex; gap: 10px; padding: 14px; border-top: 1px solid var(--line); }
.chat-input textarea {
  flex: 1; resize: none; border: 1px solid var(--line); border-radius: 11px;
  padding: 10px 13px; font: inherit; font-size: 14.5px; outline: none;
}
.chat-input textarea:focus { border-color: var(--brand); }

/* ===== 掲示板 ===== */
.board-head { margin-bottom: 20px; }
.board-filter { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.chip {
  padding: 6px 13px; border-radius: 99px; font-size: 13px; font-weight: 600;
  background: var(--panel); border: 1px solid var(--line); color: var(--sub);
}
.chip.cur { background: var(--dept, var(--brand)); border-color: var(--dept, var(--brand)); color: #fff; }
.board-empty {
  background: var(--panel); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 40px 20px; text-align: center; color: var(--sub);
}
.board-empty .hint { font-size: 12.5px; }
.board-day { margin-bottom: 26px; }
.board-date { font-size: 15px; color: var(--sub); margin: 0 0 12px; }
.board-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); }
.note {
  background: var(--panel); border-radius: var(--radius); box-shadow: var(--shadow);
  border-left: 4px solid var(--dept, var(--brand)); padding: 16px;
}
.note.alert { background: #fffaf6; }
.note-head { display: flex; gap: 10px; align-items: center; margin-bottom: 8px; }
.note-emp { font-size: 13px; font-weight: 700; }
.note-kind { font-size: 11.5px; color: var(--sub); }
.note-title { margin: 0 0 6px; font-size: 15px; }
.note-body { font-size: 13.5px; color: #39404f; white-space: pre-wrap; }

/* ===== ログイン ===== */
.login-body { display: flex; align-items: center; justify-content: center; min-height: 100vh; background: linear-gradient(160deg, #eef0fb, #f4f0fa); }
.login-card {
  width: min(400px, 92vw); background: var(--panel); border-radius: 18px; box-shadow: var(--shadow);
  padding: 34px 30px; text-align: center;
}
.login-card h1 { font-size: 21px; margin: 14px 0 4px; }
.login-sub { color: var(--sub); font-size: 13px; margin: 0 0 18px; }
.login-error { background: #fdecec; color: #b3261e; border-radius: 10px; padding: 10px; font-size: 13px; margin-bottom: 14px; }
.login-card form { display: flex; flex-direction: column; gap: 14px; text-align: left; }
.login-card label { font-size: 12.5px; font-weight: 700; color: var(--sub); display: flex; flex-direction: column; gap: 6px; }
.login-card input {
  border: 1px solid var(--line); border-radius: 11px; padding: 11px 13px; font: inherit; outline: none;
}
.login-card input:focus { border-color: var(--brand); }

/* ===== スマホ ===== */
@media (max-width: 760px) {
  .topbar { flex-wrap: wrap; gap: 10px; padding: 10px 14px; }
  .topnav { order: 3; width: 100%; }
  .main { padding: 18px 14px 50px; }
  .chat-wrap { flex-direction: column; }
  .chat-side { width: 100%; }
  .side-ctx { display: none; }
  .chat-main { min-height: 60vh; }
  .msg { max-width: 95%; }
}

/* ===== ピクセルオフィス(フロア) ===== */
.scene { font-family: 'DotGothic16', 'Hiragino Sans', monospace; }
.scene-rooms {
  display: grid; gap: 16px;
  grid-template-columns: repeat(auto-fill, minmax(235px, 1fr));
  padding: 18px;
  background:
    repeating-linear-gradient(90deg, transparent 0 46px, rgba(43,35,32,.12) 46px 48px),
    repeating-linear-gradient(0deg, rgba(255,255,255,.05) 0 10px, transparent 10px 20px),
    #b98a52;
  border: 4px solid #2b2320; border-radius: 4px;
  box-shadow: 6px 6px 0 rgba(43, 35, 32, .25);
  image-rendering: pixelated;
}
.room {
  position: relative;
  background:
    repeating-conic-gradient(rgba(255,255,255,.35) 0% 25%, transparent 0% 50%) 0 0/28px 28px,
    var(--floor, #eee);
  border: 3px solid #2b2320;
  min-height: 150px;
  box-shadow: inset 0 5px 0 rgba(255, 255, 255, .45), inset 0 -6px 0 rgba(43, 35, 32, .12);
  display: flex; flex-direction: column;
}
.room-tag {
  position: absolute; top: -3px; left: -3px; z-index: 3;
  background: #2b2320; color: #fff; font-size: 12px; letter-spacing: .08em;
  padding: 3px 10px 4px;
}
.room-board-link {
  position: absolute; top: -3px; right: -3px; z-index: 3;
  background: var(--dept, #555); color: #fff; font-size: 11px; padding: 3px 9px 4px;
  border-left: 3px solid #2b2320; border-bottom: 3px solid #2b2320;
}
.room-board-link:hover { filter: brightness(1.1); }
.room-inner {
  flex: 1; display: flex; flex-direction: column; align-items: center;
  padding: 30px 12px 8px; cursor: pointer;
}
.room-inner.static { cursor: default; }
.room-inner:not(.static):hover .plaque { background: #fff7c8; }
.plaque {
  background: #fffef4; border: 2px solid #2b2320; padding: 3px 9px 4px;
  box-shadow: 2px 2px 0 rgba(43, 35, 32, .3); text-align: center; z-index: 2;
}
.plaque-name { font-size: 12px; font-weight: 700; color: #2b2320; }
.plaque-name span { font-weight: 400; font-size: 10.5px; color: #6f675f; }
.plaque-status { font-size: 10.5px; color: #4c453e; display: flex; align-items: center; gap: 5px; justify-content: center; }
.plaque-status i { width: 8px; height: 8px; display: inline-block; border: 1px solid #2b2320; }
.plaque-status.st-alert i, .plaque-status.st-work i { animation: blink 1.2s steps(2, end) infinite; }
@keyframes blink { 50% { opacity: .25; } }

.workstation { position: relative; width: 132px; height: 102px; margin-top: 6px; }
.sprite { position: absolute; bottom: 24px; left: 50%; transform: translateX(-50%); z-index: 1; }
.sprite-svg { width: 58px; height: auto; display: block; image-rendering: pixelated; }
.sprite.typing .sprite-svg { animation: bob .55s steps(2, end) infinite; }
@keyframes bob { 50% { transform: translateY(2px); } }
.desk {
  position: absolute; bottom: 0; left: 0; right: 0; height: 28px; z-index: 2;
  background: #a2734a; border: 3px solid #2b2320;
  box-shadow: inset 0 6px 0 #c08c5c;
}
.pc { position: absolute; bottom: 25px; left: 16px; z-index: 3; }
.pc-screen {
  display: block; width: 30px; height: 21px; background: #1d222e; border: 3px solid #2b2320;
  box-shadow: inset 3px 3px 0 #3ecf7a44, inset -6px -5px 0 #10131b;
}
.st-on .pc-screen { animation: flicker 2s steps(3, end) infinite; }
@keyframes flicker { 50% { box-shadow: inset 3px 3px 0 #3ecf7a77, inset -6px -5px 0 #10131b; } }
.pc-stand { display: block; width: 10px; height: 4px; background: #2b2320; margin: 0 auto; }
.room-note {
  margin-top: 8px; font-size: 10.5px; background: #fff; border: 2px solid #2b2320;
  padding: 2px 7px 3px; box-shadow: 2px 2px 0 rgba(43, 35, 32, .2);
  max-width: 95%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.room-data {
  border-top: 2px dashed rgba(43, 35, 32, .35);
  margin: 4px 10px 8px; padding-top: 5px;
  display: flex; flex-direction: column; gap: 2px;
}
.rd-row { display: flex; justify-content: space-between; gap: 8px; font-size: 11px; color: #4c453e; }
.rd-row b { color: #2b2320; }

/* 休憩室 */
.lounge-stuff { display: flex; align-items: flex-end; gap: 14px; margin-top: 12px; height: 86px; }
.coffee {
  position: relative; width: 44px; height: 66px; background: #7a4a3a; border: 3px solid #2b2320;
  box-shadow: inset 0 5px 0 #96604c;
}
.coffee-label {
  position: absolute; top: 7px; left: 0; right: 0; text-align: center;
  font-size: 7px; color: #ffe9b0; letter-spacing: .06em;
}
.coffee-cup {
  position: absolute; bottom: 8px; left: 50%; transform: translateX(-50%);
  width: 12px; height: 10px; background: #fffef4; border: 2px solid #2b2320;
}
.plant span {
  display: block; width: 26px; height: 26px; background: #3f9d5a; border: 3px solid #2b2320;
  clip-path: polygon(50% 0, 100% 60%, 80% 100%, 20% 100%, 0 60%);
}
.plant::after { content: ''; display: block; width: 18px; height: 12px; background: #b06a3c; border: 3px solid #2b2320; margin: -3px auto 0; }
.sofa { width: 74px; height: 30px; background: #cf7d5a; border: 3px solid #2b2320; box-shadow: inset 0 7px 0 #e29a76; border-radius: 4px 4px 0 0; }
.lounge-note { margin-top: 10px; font-size: 11px; color: #4c453e; }

/* 下段パネル */
.scene-bottom { display: grid; grid-template-columns: 1.25fr 1fr 1.25fr; gap: 16px; margin-top: 16px; }
.panel {
  border: 3px solid #2b2320; padding: 12px 14px;
  box-shadow: 4px 4px 0 rgba(43, 35, 32, .22);
  background: #fdf8ec; font-family: 'DotGothic16', 'Hiragino Sans', monospace;
}
.panel-title { font-size: 13px; font-weight: 700; color: #2b2320; display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.urgent { background: #d8383f; color: #fff; font-size: 10.5px; padding: 2px 7px 3px; animation: blink 1.2s steps(2, end) infinite; }
.casebook {
  background:
    radial-gradient(rgba(43,35,32,.12) 12%, transparent 13%) 0 0/14px 14px,
    #c8a06a;
}
.casebook:hover { filter: brightness(1.03); }
.notes { display: flex; flex-wrap: wrap; gap: 8px; }
.sticky {
  background: #fff9ae; border: 2px solid #2b2320; border-top: 6px solid var(--dept, #e8c33a);
  font-size: 11px; padding: 6px 8px; max-width: 46%;
  box-shadow: 2px 3px 0 rgba(43, 35, 32, .25); transform: rotate(-1.5deg); color: #2b2320;
}
.sticky:nth-child(2n) { transform: rotate(1.5deg); background: #ffe1ef; }
.sticky.calm { background: #dcf3e2; border-top-color: #3ecf7a; }
.sticky.calm2 { background: #dfe8f6; border-top-color: #5b8def; }
.legend { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 6px; font-size: 12px; color: #4c453e; }
.legend i { width: 10px; height: 10px; display: inline-block; border: 2px solid #2b2320; margin-right: 6px; vertical-align: -1px; }
.sb-foot { margin-top: 10px; font-size: 11px; color: #6f675f; border-top: 2px dashed rgba(43,35,32,.3); padding-top: 8px; }
.monitor { background: #1d222e; color: #cfe3ff; }
.monitor .panel-title { color: #ffe9b0; }
.mon-row { display: flex; justify-content: space-between; gap: 10px; font-size: 12px; margin-bottom: 6px; }
.mon-row.small { font-size: 11px; color: #93a4c8; }
.mon-label { color: #93a4c8; }
.mon-val { text-align: right; }
.mon-val.ok { color: #3ecf7a; }
.mon-bar { height: 12px; border: 2px solid #46536e; background: #10131b; margin: 4px 0 10px; }
.mon-bar span { display: block; height: 100%; background: repeating-linear-gradient(90deg, #3ecf7a 0 6px, #2da562 6px 12px); min-width: 2px; }
.mon-bar span.warn { background: repeating-linear-gradient(90deg, #e8b93c 0 6px, #c99a22 6px 12px); }
.mon-bar span.danger { background: repeating-linear-gradient(90deg, #ff7a3c 0 6px, #d95f28 6px 12px); }
.mon-sub { font-size: 10px; color: #93a4c8; font-weight: 400; margin-left: 8px; }
.mon-cost { display: flex; align-items: baseline; gap: 8px; margin: 2px 0 4px; }
.mon-cost b { font-size: 20px; color: #ffe9b0; }
.mon-cost i { font-style: normal; font-size: 11px; color: #93a4c8; }

@media (max-width: 900px) {
  .scene-bottom { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .scene-rooms { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); padding: 12px; gap: 12px; }
}

/* ===== アイソメトリック(3D風)フロア ===== */
.iso-stage {
  background: linear-gradient(180deg, #cfe3ea 0%, #e7eef2 55%, #dfe6ea 100%);
  border: 4px solid #2b2320; border-radius: 4px;
  box-shadow: 6px 6px 0 rgba(43, 35, 32, .25);
  padding: 6px 4px 0;
}
.iso-stage svg { display: block; width: 100%; height: auto; }
.iso-room { cursor: pointer; }
.iso-room:hover { filter: brightness(1.06); }
.iso-char.typing { animation: bob .55s steps(2, end) infinite; }
.blinkdot { animation: blink 1.2s steps(2, end) infinite; }
.screen-on { animation: flickerop 2s steps(3, end) infinite; }
@keyframes flickerop { 50% { opacity: .82; } }

/* 部署ミニボード */
.dept-strip {
  display: grid; gap: 12px; margin-top: 14px;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}
.mini-board {
  background: #fdf8ec; border: 3px solid #2b2320; border-top: 6px solid var(--dept, #555);
  box-shadow: 3px 3px 0 rgba(43, 35, 32, .22);
  padding: 8px 11px 10px; font-family: 'DotGothic16', 'Hiragino Sans', monospace;
  display: flex; flex-direction: column; gap: 3px;
}
.mini-board:hover { filter: brightness(1.03); transform: translateY(-1px); }
.mb-head {
  display: flex; justify-content: space-between; align-items: baseline;
  font-size: 12.5px; font-weight: 700; color: #2b2320;
  border-bottom: 2px dashed rgba(43, 35, 32, .3); padding-bottom: 4px; margin-bottom: 3px;
}
.mb-head span { font-size: 10px; color: #6f675f; font-weight: 400; }

/* ===== 部屋タブ(ルームバー) ===== */
.rooms-bar {
  display: flex; gap: 6px; align-items: center;
  background: #f7f8fc; border-bottom: 1px solid var(--line);
  padding: 8px 20px; overflow-x: auto; white-space: nowrap;
  position: sticky; top: 53px; z-index: 19;
}
.rb-item {
  flex: none; font-size: 12.5px; font-weight: 600; color: var(--sub);
  padding: 5px 12px; border-radius: 99px; border: 1px solid var(--line); background: #fff;
}
.rb-item:hover { border-color: var(--dept); color: var(--ink); }
.rb-item.cur { background: var(--dept); border-color: var(--dept); color: #fff; }

/* ===== 部屋ページ ===== */
.room-hero {
  display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap;
  background: var(--panel); border-radius: var(--radius); box-shadow: var(--shadow);
  border-top: 4px solid var(--dept); padding: 18px 20px; margin-bottom: 18px;
}
.rh-emp { display: flex; gap: 14px; align-items: center; }
.rh-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.room-grid { display: grid; grid-template-columns: 1fr 300px; gap: 18px; align-items: start; }
.room-main { display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.room-side { display: flex; flex-direction: column; gap: 18px; }
.card {
  background: var(--panel); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px 18px;
}
.card-title { margin: 0 0 12px; font-size: 15.5px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ct-sub { font-size: 12px; color: var(--sub); font-weight: 500; }
.ct-badge { font-size: 11.5px; font-weight: 700; background: #fff3d6; color: #8a6100; padding: 2px 10px; border-radius: 99px; }
.ct-badge.done { background: #e2f7ec; color: #147a48; }
.empty-note { color: var(--sub); font-size: 13px; margin: 4px 0; }
.report-card.alert { border-left: 4px solid #ff7a3c; }
.report-body { font-size: 12.5px; color: #39404f; white-space: pre-wrap; }

/* タスクリスト */
.task-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.task-item {
  display: flex; gap: 10px; align-items: flex-start;
  border: 1px solid var(--line); border-radius: 11px; padding: 9px 12px; background: #fbfcfe;
}
.task-item.done { opacity: .55; }
.task-item.done .task-title { text-decoration: line-through; }
.task-check { border: none; background: none; font-size: 20px; line-height: 1.2; cursor: pointer; padding: 0; color: var(--dept); }
.task-body { flex: 1; min-width: 0; }
.task-title { font-size: 14px; font-weight: 600; }
.task-meta { font-size: 11.5px; color: var(--sub); }
.task-freq {
  flex: none; font-size: 10.5px; font-weight: 700; color: #fff;
  padding: 3px 8px; border-radius: 7px; margin-top: 2px;
}
.task-del { border: none; background: none; color: #b9c0cf; font-size: 14px; cursor: pointer; padding: 2px 4px; }
.task-del:hover { color: #d8383f; }

/* 追加フォーム */
.task-add { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.task-add input[type="text"], .task-add input[type="date"], .task-add select {
  border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; font: inherit; font-size: 13.5px; outline: none;
}
.task-add input#taTitle { flex: 2 1 220px; }
.task-add input#taNote { flex: 1 1 140px; }
.task-add select:focus, .task-add input:focus { border-color: var(--dept); }
.ta-hide { display: none !important; }

/* 月間カレンダー */
.cal-nav { display: inline-flex; gap: 10px; align-items: center; font-size: 13px; margin-left: auto; }
.cal-nav a { color: var(--sub); padding: 2px 8px; border: 1px solid var(--line); border-radius: 8px; }
.cal-nav a:hover { color: var(--ink); border-color: var(--dept); }
.cal { width: 100%; border-collapse: collapse; table-layout: fixed; }
.cal th { font-size: 11px; color: var(--sub); padding: 4px 2px; border-bottom: 1px solid var(--line); font-weight: 600; }
.cal th.sun, .cal td.sun .cal-d { color: #d8383f; }
.cal th.sat, .cal td.sat .cal-d { color: #3b6fd4; }
.cal td { vertical-align: top; border: 1px solid #eef0f6; padding: 3px 4px 5px; height: 58px; }
.cal td.off { background: #f7f8fb; }
.cal td.today { background: color-mix(in srgb, var(--dept) 10%, #fff); box-shadow: inset 0 0 0 2px var(--dept); border-radius: 4px; }
.cal-d { font-size: 11px; font-weight: 700; color: var(--ink); margin-bottom: 2px; }
.cal-chip {
  display: block; font-size: 10px; line-height: 1.35; margin-top: 2px; padding: 2px 5px;
  background: color-mix(in srgb, var(--dept) 16%, #fff);
  border-left: 3px solid var(--dept); border-radius: 4px; cursor: pointer;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.cal-chip:hover { filter: brightness(.96); }
.cal-chip.done { text-decoration: line-through; opacity: .5; }

/* 年間 */
.year-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; }
.year-month { border: 1px solid var(--line); border-radius: 11px; padding: 9px 12px; }
.year-month.cur { border-color: var(--dept); box-shadow: inset 0 0 0 1px var(--dept); }
.ym-label { font-size: 12px; font-weight: 700; color: var(--dept); margin-bottom: 4px; }
.ym-task { font-size: 12px; margin-top: 3px; }
.ym-task b { color: var(--sub); font-weight: 600; font-size: 11px; margin-right: 4px; }

@media (max-width: 900px) {
  .room-grid { grid-template-columns: 1fr; }
  .rooms-bar { top: 96px; padding: 8px 14px; }
  .cal td { height: 48px; }
  .cal-chip { font-size: 9px; }
}

/* ===== フロア切替・チーム ===== */
.floor-tabs { display: flex; gap: 8px; margin-bottom: 10px; font-family: 'DotGothic16', monospace; }
.ft {
  padding: 7px 16px 8px; font-size: 13.5px; font-weight: 700; color: #6f675f;
  background: #efe9db; border: 3px solid #2b2320; box-shadow: 3px 3px 0 rgba(43, 35, 32, .22);
}
.ft:hover { filter: brightness(1.04); }
.ft.cur { background: #2b2320; color: #ffe9b0; }
.rb-floor {
  flex: none; font-size: 10.5px; font-weight: 700; color: #fff; background: #2b2320;
  padding: 3px 8px; border-radius: 6px; letter-spacing: .06em;
}
.team-members { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 18px; }
.tm-chip {
  display: flex; align-items: center; gap: 10px; flex: 1 1 220px; max-width: 320px;
  background: var(--panel); border-radius: var(--radius); box-shadow: var(--shadow);
  border: 1px solid var(--line); padding: 10px 14px;
}
.tm-chip.lead { border: 2px solid var(--dept); }
.tm-chip:hover { transform: translateY(-1px); }
.tm-emoji {
  width: 40px; height: 40px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-size: 20px; background: color-mix(in srgb, var(--dept) 14%, #fff);
}
.tm-info { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.tm-info b { font-size: 14px; }
.tm-info i { font-style: normal; font-size: 11.5px; color: var(--sub); }
.tm-talk { font-size: 12px; font-weight: 700; color: var(--dept); }
/* サイドバーのチャット一覧(縦積み) */
.chat-side .card-title { margin-bottom: 10px; }
.chat-list { display: flex; flex-direction: column; gap: 8px; }
.chat-list .tm-chip { flex: none; max-width: none; width: 100%; box-sizing: border-box; padding: 8px 12px; box-shadow: none; }
.chat-list .tm-emoji { width: 34px; height: 34px; font-size: 17px; flex: none; }
.chat-list .tm-info b { font-size: 13px; }
.chat-list .tm-info i { font-size: 10.5px; }
.chat-list .tm-chip:hover { transform: none; border-color: var(--dept); background: color-mix(in srgb, var(--dept) 6%, var(--panel)); }
.tm-assign { font-size: 10px !important; color: var(--sub); }
.assign-toggle {
  float: right; border: 1px solid var(--line); background: var(--panel); border-radius: 8px;
  font-size: 11px; padding: 2px 8px; cursor: pointer; color: var(--sub);
}
.assign-toggle:hover, .assign-toggle.on { border-color: var(--dept); color: var(--dept); }
.chat-item .assign-form { display: none; margin: 4px 0 2px; }
.chat-list.assigning .assign-form { display: block; }
.assign-form select {
  width: 100%; font: inherit; font-size: 11.5px; padding: 5px 8px;
  border: 1px solid var(--line); border-radius: 8px; background: #fff; color: var(--ink);
}

/* 学習ノート(AI社員に教えた知識) */
.kn-item { border-bottom: 1px solid var(--line); padding: 6px 0; font-size: 12px; }
.kn-item summary { cursor: pointer; font-weight: 700; color: var(--ink); display: flex; align-items: center; gap: 6px; }
.kn-scope { font-style: normal; font-size: 9.5px; color: var(--sub); background: #eef0f5; border-radius: 6px; padding: 1px 6px; margin-left: auto; flex: none; }
.kn-body { margin: 6px 0 4px; color: #39404f; line-height: 1.6; font-size: 11.5px; }
.kn-del { border: none; background: none; color: #b3261e; font-size: 10.5px; cursor: pointer; padding: 2px 0; }
.kn-empty { font-size: 11.5px; color: var(--sub); padding: 4px 0; }
.kn-add { padding: 8px 0 2px; font-size: 12px; }
.kn-add summary { cursor: pointer; font-weight: 700; color: var(--dept); }
.kn-form { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
.kn-form input[type=text], .kn-form textarea, .kn-form select {
  font: inherit; font-size: 12px; border: 1px solid var(--line); border-radius: 8px; padding: 6px 9px; background: #fff;
}
.kn-form textarea { resize: vertical; }
.kn-note { font-size: 10.5px; color: #a8720e; background: #fdf3e0; border-radius: 8px; padding: 6px 9px; margin-top: 8px; }
.kn-pdf { display: inline-block; font-size: 11px; font-weight: 700; color: var(--dept); text-decoration: none; margin: 2px 0 4px; }
.kn-pdf:hover { text-decoration: underline; }

/* チャット内の生成画像 */
.chat-img { display: block; max-width: 100%; border-radius: 12px; margin-top: 8px; border: 1px solid var(--line); }

/* フェロー育成マニュアル(A4リッチ文書エディタ) */
.fd-ribbon {
  display: flex; align-items: center; gap: 4px; flex-wrap: wrap;
  border: 1px solid var(--line); background: var(--panel); border-radius: 10px;
  padding: 6px 8px; margin-bottom: 12px; position: sticky; top: 8px; z-index: 5;
  box-shadow: 0 2px 8px rgba(0,0,0,.06);
}
.fd-ribbon button { border: 1px solid transparent; background: none; border-radius: 7px; padding: 6px 9px; cursor: pointer; font-size: 13px; }
.fd-ribbon button:hover { background: #eef1f6; border-color: var(--line); }
.fd-ribbon select { padding: 5px 8px; border: 1px solid var(--line); border-radius: 7px; font-size: 12.5px; }
.fd-rib-sep { width: 1px; height: 20px; background: var(--line); margin: 0 4px; }
.fd-hint-inline { font-size: 11px; color: var(--sub); margin-left: auto; }
/* 日時作業表(エクセル風グリッド) */
.ds-wrap { overflow-x: auto; border: 1px solid #c9ced6; border-radius: 8px; }
.ds-tbl { border-collapse: collapse; width: 100%; font-size: 12.5px; background: #fff; }
.ds-tbl th { background: #2b2320; color: #fff; padding: 6px 8px; border: 1px solid #4a4440; font-size: 12px; text-align: left; position: sticky; top: 0; z-index: 2; }
.ds-tbl td { border: 1px solid #c9ced6; padding: 6px 8px; vertical-align: top; white-space: pre-wrap; min-width: 150px; line-height: 1.55; }
.ds-tbl td.ds-time { background: #eceef2; font-weight: 700; width: 66px; min-width: 66px; white-space: nowrap; }
.ds-tbl tr.ds-band td.ds-band-c { background: #f6d98a; font-weight: 800; border-color: #d9b45a; }
.ds-tbl td[contenteditable]:focus { outline: 2px solid #4f46e5; outline-offset: -2px; background: #fbfbff; }
.ds-tbl th.ds-ops, .ds-tbl td.ds-ops { width: 112px; min-width: 112px; background: #fafbfc; white-space: nowrap; vertical-align: middle; }
.ds-b { border: 1px solid #d5dae2; background: #fff; border-radius: 6px; padding: 2px 6px; cursor: pointer; font-size: 11px; margin-right: 2px; }
.ds-b:hover { background: #eef1f6; }
.ds-del { color: #b3261e; }
.ds-status { font-size: 12px; color: #64708a; margin-left: 8px; align-self: center; }

/* 2画面ボタン */
.rt-split { text-decoration: none; color: #4f46e5 !important; border-style: dashed !important; }

/* 提携先マスタ・提案作成 */
.pt-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; align-items: start; }
@media (max-width: 860px) { .pt-grid { grid-template-columns: 1fr; } }
.pt-box { border: 1px solid var(--line); border-radius: 12px; padding: 14px; background: var(--panel); margin-bottom: 14px; }
.pt-h { margin: 0 0 10px; font-size: 14px; }
.pt-cat { font-size: 11px; font-weight: 800; color: var(--sub); border-bottom: 1px solid var(--line); padding: 8px 2px 3px; margin-bottom: 4px; }
.pt-item { display: flex; justify-content: space-between; gap: 8px; padding: 6px 8px; border-radius: 7px; cursor: pointer; font-size: 12.5px; }
.pt-item:hover { background: #eef1f6; }
.pt-item span { color: var(--sub); flex: none; }
.pt-form { border-bottom: 1px dashed var(--line); padding-bottom: 10px; margin-bottom: 6px; }
.pt-form-row { display: flex; gap: 6px; margin-bottom: 6px; }
.pt-form-row input, .pt-form-row select { flex: 1; min-width: 0; padding: 7px 9px; border: 1px solid var(--line); border-radius: 8px; font-size: 12.5px; }
.pt-pick { max-height: 300px; overflow-y: auto; border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; margin: 8px 0; background: #fff; }
.pt-pick-row { display: block; font-size: 12.5px; padding: 4px 2px; cursor: pointer; }
.pt-pick-row i { font-style: normal; color: var(--sub); font-size: 11px; }
.pt-note { font-size: 10.5px; color: var(--sub); margin-top: 8px; }
.pt-prop { display: flex; align-items: center; gap: 8px; padding: 7px 4px; border-bottom: 1px solid #f0f2f7; }
.pt-prop a { flex: 1; text-decoration: none; color: inherit; display: flex; justify-content: space-between; gap: 8px; }
.pt-prop a:hover b { text-decoration: underline; }
.pt-prop span { color: var(--sub); font-size: 11px; }

/* Canva型キャンバス */
.cv-wrap { display: grid; grid-template-columns: 96px 1fr; gap: 12px; }
.cv-pages { max-height: 76vh; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; padding: 4px; background: #eef0f4; border-radius: 10px; }
.cv-thumb { aspect-ratio: 210/297; background: #fff; border: 2px solid var(--line); border-radius: 6px; cursor: pointer; position: relative; flex: none; overflow: hidden; }
.cv-thumb-page { width: 660px; height: 933.4px; position: absolute; top: 0; left: 0; transform-origin: top left; background: #fff center/cover no-repeat; pointer-events: none; }
.cv-thumb.on { border-color: #2e7d4f; box-shadow: 0 0 0 2px rgba(46,125,79,.25); }
.cv-thumb span { position: absolute; left: 3px; bottom: 2px; font-size: 10px; font-weight: 700; color: #fff; background: rgba(31,36,48,.65); border-radius: 4px; padding: 0 4px; }
.cv-stage-bar { display: flex; align-items: center; gap: 6px; margin-bottom: 8px; font-size: 12.5px; color: var(--sub); font-weight: 700; }
.cv-stage { background: #e8eaee; border-radius: 12px; padding: 18px; display: flex; justify-content: center; overflow: auto; }
.cv-page { width: min(660px, 100%); aspect-ratio: 210/297; background: #fff center/cover no-repeat; box-shadow: 0 3px 18px rgba(0,0,0,.18); position: relative; overflow: hidden; }
.cv-item { position: absolute; box-sizing: border-box; user-select: none; }
.cv-item.sel { outline: 2px solid #3b82f6; outline-offset: 1px; }
/* 1行テキストは折り返さない(元PDFと同じ行組みを保ち、下の行との重なりを防ぐ) */
.cv-text .cv-text-in { white-space: pre; line-height: 1.45; cursor: default; min-height: 1em; }
.cv-text .cv-text-in[contenteditable="true"] { white-space: pre-wrap; }
.cv-text .cv-text-in[contenteditable="true"] { cursor: text; background: rgba(59,130,246,.06); outline: none; }
.cv-image img { width: 100%; height: 100%; object-fit: contain; display: block; pointer-events: none; }
.cv-hdl { position: absolute; right: -7px; bottom: -7px; width: 14px; height: 14px; background: #3b82f6; border: 2px solid #fff; border-radius: 50%; cursor: nwse-resize; }
/* グリッド(5%間隔・25%は濃く)と整列ガイド */
.cv-page.grid-on::after {
  content: ''; position: absolute; inset: 0; pointer-events: none; z-index: 900;
  background-image:
    linear-gradient(to right, rgba(46,125,79,.28) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(46,125,79,.28) 1px, transparent 1px),
    linear-gradient(to right, rgba(46,125,79,.10) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(46,125,79,.10) 1px, transparent 1px);
  background-size: 25% 25%, 25% 25%, 5% 5%, 5% 5%;
}
.cv-marquee { position: absolute; border: 1.5px dashed #3b82f6; background: rgba(59,130,246,.08); z-index: 960; pointer-events: none; }
.cv-guide-v { position: absolute; top: 0; bottom: 0; width: 0; border-left: 1.5px dashed #e01e8a; z-index: 950; pointer-events: none; }
.cv-guide-h { position: absolute; left: 0; right: 0; height: 0; border-top: 1.5px dashed #e01e8a; z-index: 950; pointer-events: none; }
.fd-ribbon button.on { background: #2e7d4f; color: #fff; border-color: #2e7d4f; }
/* 章(目次)サイドバー(役職グループごと) */
.cv-layout { display: grid; grid-template-columns: 210px 1fr; gap: 14px; align-items: start; }
.cv-chapters { display: flex; flex-direction: column; gap: 4px; max-height: 80vh; overflow-y: auto; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 10px; position: sticky; top: 8px; }
.cv-chp-grp { display: flex; flex-direction: column; gap: 3px; margin-top: 8px; }
.cv-chp-lbl { font-size: 11px; font-weight: 800; color: var(--sub); padding: 2px 6px; border-bottom: 1px solid var(--line); margin-bottom: 2px; }
.cv-chp { display: flex; align-items: center; justify-content: space-between; gap: 6px; width: 100%; text-align: left; border: 1px solid transparent; background: none; border-radius: 8px; padding: 6px 9px; cursor: pointer; font-size: 12.5px; font-weight: 700; color: #444; }
.cv-chp:hover { background: #eef1f6; }
.cv-chp.on { background: #2e7d4f; color: #fff; }
.cv-chp.on .cv-chp-pg { color: rgba(255,255,255,.75); }
.cv-chp-pg { font-size: 10px; font-weight: 400; color: var(--sub); flex: none; }
.cv-chp-all { border: 1px solid var(--line); }
@media (max-width: 900px) { .cv-layout { grid-template-columns: 1fr; } .cv-chapters { position: static; max-height: 200px; } }

/* 流し読み(全ページ縦スクロール) */
.cv-mode-tg { display: flex; gap: 4px; margin-right: 8px; }
.cv-mode-tg .editbtn.on { background: #2e7d4f; color: #fff; border-color: #2e7d4f; }
.cv-scroll { display: flex; flex-direction: column; gap: 4px; width: min(660px, 100%); max-height: 78vh; overflow-y: auto; }
.cv-sp { flex: none; }
.cv-page-ro { width: 100%; }
.cv-page-ro .cv-item { pointer-events: none; }
.cv-sp-no { text-align: center; font-size: 11px; color: var(--sub); padding: 4px 0 10px; }
.cv-hdl-line { bottom: -7px; }
@media (max-width: 720px) { .cv-wrap { grid-template-columns: 64px 1fr; } }

.fd-desk { background: #e8eaee; border-radius: 12px; padding: 24px 12px; overflow-x: auto; }
.fd-paper-wrap { display: flex; justify-content: center; }
.fd-paper.a4 {
  width: 210mm; min-height: 297mm; max-width: 100%;
  background: #fff; box-shadow: 0 3px 18px rgba(0,0,0,.18);
  padding: 18mm 16mm; box-sizing: border-box;
  font-size: 14px; line-height: 1.85; color: #1f2430;
}
.fd-paper:focus { outline: 2px solid #3b82f6; outline-offset: 2px; }
.fd-paper h1 { font-size: 26px; text-align: center; margin: 0 0 18px; padding-bottom: 10px; border-bottom: 3px solid #2e7d4f; }
.fd-paper h2 { font-size: 17px; background: #2e7d4f; color: #fff; padding: 8px 14px; border-radius: 7px; margin: 26px 0 12px; }
.fd-paper h3 { font-size: 15px; color: #2e7d4f; border-bottom: 1.5px solid #cfd8d3; padding-bottom: 4px; margin: 20px 0 8px; }
.fd-paper h4 { font-size: 14px; margin: 14px 0 6px; }
.fd-paper p { margin: 0 0 8px; }
.fd-paper ul, .fd-paper ol { margin: 0 0 10px 1.4em; }
.fd-paper li { margin: 2px 0; }
.fd-paper img { max-width: 100%; border-radius: 6px; }
.fd-paper table { border-collapse: collapse; width: 100%; margin: 8px 0 14px; }
.fd-paper th, .fd-paper td { border: 1px solid #9aa5a0; padding: 5px 9px; font-size: 12.5px; }
.fd-paper th { background: #eef4f1; }
.fd-paper .note, .fd-paper .doc-note { background: #fdf7e8; border: 1px solid #e3d3a3; border-radius: 8px; padding: 10px 14px; margin: 10px 0; }
.fd-paper a { color: #1f6feb; }
.fd-paper hr { border: none; border-top: 1px solid #cfd8d3; margin: 14px 0; }
.fd-paper .page-break { border-top: 2px dashed #b3bcc8; margin: 18px -16mm; position: relative; }
.fd-paper .page-break::after { content: '⤓ 改ページ'; position: absolute; right: 8px; top: -9px; font-size: 10px; color: #8a94a4; background: #fff; padding: 0 6px; }
@media (max-width: 860px) { .fd-paper.a4 { width: 100%; padding: 8mm 6mm; } }

/* マニュアル(ネイティブ編集) */
.man-toolbar { display: flex; gap: 8px; margin-bottom: 10px; }
.man-cat { font-size: 11px; font-weight: 800; color: var(--sub); margin: 10px 0 4px; }
.man-cat:first-child { margin-top: 0; }
.manual-body { font-size: 13.5px; line-height: 1.75; }
.manual-body h3 { font-size: 15px; margin: 14px 0 6px; padding-bottom: 4px; border-bottom: 2px solid var(--line); }
.manual-body h4 { font-size: 13.5px; margin: 10px 0 4px; color: var(--dept); }
.manual-body ul { margin: 4px 0 8px 1.2em; }
.manual-body li { margin: 2px 0; }
.manual-body a { color: #1f6feb; }
.manual-body .elearn-btn { display: inline-block; margin: 8px 0; padding: 8px 16px; border-radius: 8px; background: #3bb661; color: #fff !important; font-weight: 700; font-size: 13px; text-decoration: none; }
.manual-body .elearn-btn:hover { background: #2f9b51; }
.man-edit { display: flex; flex-direction: column; gap: 10px; }
.man-edit label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; font-weight: 700; color: var(--sub); }
.man-edit input, .man-edit select, .man-edit textarea { padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; font-size: 13px; font-family: inherit; font-weight: 400; color: var(--ink, #2b2320); }
.man-edit textarea { resize: vertical; line-height: 1.6; }
.man-edit-acts { display: flex; gap: 8px; }

/* 人事評価表(ネイティブ編集) */
.hr-modes { display: flex; gap: 6px; margin: 10px 0; }
.hr-mode { border: 1px solid var(--line); background: var(--panel); border-radius: 999px; padding: 7px 16px; cursor: pointer; font-size: 13px; font-weight: 700; }
.hr-mode.on { background: var(--dept); color: #fff; border-color: var(--dept); }
.hr-skillbar { display: flex; gap: 16px; flex-wrap: wrap; align-items: center; margin: 6px 0 12px; font-size: 13px; }
.hr-skillbar select, .hr-skillbar input { padding: 6px 10px; border: 1px solid var(--line); border-radius: 8px; font-size: 13px; }
.hr-kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin: 8px 0 14px; }
.hr-kpi { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 12px; text-align: center; }
.hr-kpi-v { display: block; font-size: 22px; font-weight: 800; color: var(--dept); }
.hr-kpi-v small { font-size: 12px; font-weight: 700; }
.hr-kpi-l { display: block; font-size: 11px; color: var(--sub); margin-top: 3px; }
.hr-muted { color: var(--sub); font-size: 12px; font-weight: 700; }
.hr-hint, .hr-tasks + .hr-cat { margin-top: 12px; }
.hr-hint { font-size: 12px; color: var(--sub); }
.hr-tasks { display: flex; flex-direction: column; gap: 4px; }
.hr-task { display: flex; align-items: center; gap: 10px; padding: 7px 4px; border-bottom: 1px solid #f0f2f7; }
.hr-task-n { flex: 1; font-size: 13px; }
.hr-trainer-sel { font-size: 11.5px; padding: 4px 6px; border: 1px solid var(--line); border-radius: 7px; max-width: 130px; color: #2e7d4f; }
.hr-trainer-sel:disabled { color: var(--sub); }
.hr-tag { font-style: normal; font-size: 10.5px; background: #eef1f6; color: #64708a; border-radius: 5px; padding: 1px 6px; margin-left: 4px; }
.hr-lv { display: flex; gap: 4px; }
.hr-lvb { width: 34px; height: 30px; border: 1px solid var(--line); background: var(--panel); border-radius: 8px; cursor: pointer; font-size: 14px; font-weight: 700; }
.hr-lvb:disabled { cursor: default; opacity: .55; }
.hr-lvb.l2.on { background: #2e7d4f; color: #fff; border-color: #2e7d4f; }
.hr-lvb.l1.on { background: #e0a52e; color: #fff; border-color: #e0a52e; }
.hr-lvb.l0.on { background: #b3b9c4; color: #fff; border-color: #b3b9c4; }
@media (max-width: 720px){ .hr-kpis { grid-template-columns: repeat(2, 1fr); } }
.hr-wrap { display: grid; grid-template-columns: 240px 1fr; gap: 16px; margin-top: 10px; }
.hr-side { display: flex; flex-direction: column; gap: 6px; }
.hr-tpl { text-align: left; border: 1px solid var(--line); background: var(--panel); border-radius: 10px; padding: 10px 12px; cursor: pointer; }
.hr-tpl:hover { background: rgba(0,0,0,.03); }
.hr-tpl.on { border-color: var(--dept); background: rgba(0,0,0,.05); }
.hr-tpl b { display: block; font-size: 13px; }
.hr-tpl span { font-size: 11px; color: var(--sub); }
.hr-det-head { display: flex; align-items: center; gap: 10px; }
.hr-det-head h4 { margin: 0; flex: 1; }
.hr-acts { display: flex; gap: 6px; }
.editbtn.danger { color: #b3261e; }
.hr-desc { font-size: 12.5px; color: var(--sub); margin: 4px 0 10px; }
.hr-cat { margin: 16px 0 4px; font-size: 12px; color: var(--dept); font-weight: 800; }
.hr-tbl .hr-cdesc { font-size: 11.5px; color: var(--sub); }
.hr-tbl td { white-space: normal; }
.hr-crow-acts { white-space: nowrap; text-align: right; }
@media (max-width: 720px){ .hr-wrap { grid-template-columns: 1fr; } }

/* ログイン情報(ネイティブ表示) */
.lg-pw { font-family: monospace; letter-spacing: 1px; }
.lg-eye, .lg-copy {
  border: 1px solid var(--line); background: var(--panel); border-radius: 6px;
  padding: 2px 6px; cursor: pointer; font-size: 11px; vertical-align: middle; margin-left: 4px;
}
.lg-eye:hover, .lg-copy:hover { background: #f0f2f7; }
.lg-note { white-space: normal !important; max-width: 340px; font-size: 12px; color: var(--sub); }

/* 過去の会話リスト */
.conv-list { list-style: none; margin: 0; padding: 0; }
.conv-list li { border-bottom: 1px solid var(--line); }
.conv-list li:last-child { border-bottom: none; }
.conv-list li a { display: block; padding: 7px 4px; text-decoration: none; color: inherit; border-radius: 8px; }
.conv-list li a:hover { background: rgba(0,0,0,.04); }
.conv-list li.on a { background: rgba(0,0,0,.06); font-weight: 700; }
.conv-list .conv-title { display: block; font-size: 12px; line-height: 1.4; }
.conv-list .conv-meta { display: block; font-size: 10.5px; color: #64708a; margin-top: 1px; }

/* チャット内のPDFダウンロードボタン */
.chat-pdf {
  display: inline-block; margin-top: 8px; padding: 9px 16px; border-radius: 10px;
  background: #2e7d4f; color: #fff !important; font-weight: 700; font-size: 13px;
  text-decoration: none; box-shadow: 0 2px 6px rgba(46,125,79,.3);
}
.chat-pdf:hover { background: #256a42; }

/* 画像添付 */
.attach-btn { padding: 10px 12px; font-size: 15px; flex: none; }
.attach-strip { display: flex; gap: 8px; padding: 0 14px; flex-wrap: wrap; }
.attach-strip:not(:empty) { padding-top: 10px; }
.attach-item { position: relative; display: inline-block; }
.attach-item img { width: 64px; height: 64px; object-fit: cover; border-radius: 10px; border: 1px solid var(--line); display: block; }
.attach-item button {
  position: absolute; top: -6px; right: -6px; width: 20px; height: 20px; border-radius: 50%;
  border: none; background: #2b2320; color: #fff; font-size: 10px; cursor: pointer; line-height: 1;
}

/* ✎編集ボタン(表示⇄編集モード切替の共通スタイル) */
.editbtn {
  border: 1px solid var(--line); background: var(--panel); border-radius: 8px;
  font-size: 11px; padding: 3px 9px; cursor: pointer; color: var(--sub); white-space: nowrap;
}
.editbtn:hover { border-color: var(--dept); color: var(--dept); }
.cp-view { display: inline-flex; align-items: center; gap: 8px; }
[hidden] { display: none !important; }

/* 役割表の直編集(全社管理者) */
.org-editable .org-name {
  font: inherit; font-weight: 700; font-size: 13.5px; color: var(--rc, var(--ink));
  border: 1px solid var(--line); border-radius: 8px; padding: 5px 8px; width: 100%; box-sizing: border-box;
  background: #fff;
}
.org-edit-line { display: flex; align-items: flex-start; gap: 8px; margin-bottom: 6px; }
.org-edit-line b { font-weight: 700; color: var(--sub); font-size: 11px; white-space: nowrap; padding-top: 7px; width: 56px; }
.org-edit-line textarea {
  flex: 1; font: inherit; font-size: 12.5px; color: #39404f; line-height: 1.5;
  border: 1px solid var(--line); border-radius: 8px; padding: 6px 9px; resize: vertical; min-height: 40px;
  background: #fff;
}
.org-edit-line textarea:focus, .org-editable .org-name:focus { outline: none; border-color: var(--dept); }
.org-save { font-size: 12px; padding: 6px 14px; margin-top: 6px; }

/* 業務・責任の「人・物・お金」項目分け */
.pmk {
  display: inline-flex; align-items: center; justify-content: center; flex: none;
  font-style: normal; font-size: 10px; font-weight: 700; width: 30px; padding: 2px 0;
  border-radius: 6px; background: #eef0f5; color: #5b6474; margin-right: 6px;
}
.pmk-hito { background: #e6f5ec; color: #1e7d4b; }
.pmk-mono { background: #e8eefc; color: #3457c4; }
.pmk-kane { background: #fdf3e0; color: #a8720e; }
.pmk-rows { display: flex; flex-direction: column; gap: 3px; }
.pmk-row { display: flex; align-items: flex-start; }
.pmk-edit { flex: 1; display: flex; flex-direction: column; gap: 5px; }
.pmk-input { display: flex; align-items: center; }
.pmk-input input {
  flex: 1; font: inherit; font-size: 12.5px; color: #39404f;
  border: 1px solid var(--line); border-radius: 8px; padding: 6px 9px; background: #fff;
}
.pmk-input input:focus { outline: none; border-color: var(--dept); }

/* 組織図(自由配置ドラッグ) */
.orgchart {
  position: relative; min-height: 320px; overflow: hidden;
  border: 1px solid var(--line); border-radius: var(--radius);
  background:
    linear-gradient(90deg, color-mix(in srgb, var(--line) 45%, transparent) 1px, transparent 1px),
    linear-gradient(color-mix(in srgb, var(--line) 45%, transparent) 1px, transparent 1px);
  background-size: 24px 24px;
  background-color: color-mix(in srgb, var(--panel) 70%, #f5f7fb);
}
.orgchart-edges { position: absolute; inset: 0; pointer-events: none; }
.orgchart-edges path { fill: none; stroke: #b9c1d1; stroke-width: 2; stroke-dasharray: 1 0; }
.org-node {
  position: absolute; width: 188px; box-sizing: border-box; cursor: grab; user-select: none;
  background: var(--panel); border: 1px solid var(--line); border-left: 5px solid var(--rc, #888);
  border-radius: 12px; box-shadow: var(--shadow); padding: 9px 12px;
  display: flex; flex-direction: column; gap: 2px; touch-action: none;
}
.org-node.dragging { cursor: grabbing; box-shadow: 0 8px 22px rgba(30, 40, 70, .18); z-index: 5; }
.org-node b { font-size: 13.5px; color: var(--rc, var(--ink)); }
.org-node i { font-style: normal; font-size: 11.5px; color: var(--ink); }
.org-node em { font-style: normal; font-size: 10.5px; color: var(--sub); }
.org-node.squad { border-radius: 999px 12px 12px 999px; }

/* 資料・フォーム(リンク集) */
.link-group { font-size: 12px; color: var(--sub); margin: 14px 0 8px; letter-spacing: .04em; }
.link-group:first-of-type { margin-top: 4px; }
.link-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; }
.link-card {
  display: flex; flex-direction: column; gap: 4px; padding: 12px 14px;
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel);
  text-decoration: none; color: var(--ink);
}
.link-card:hover { border-color: var(--dept); background: color-mix(in srgb, var(--dept) 6%, var(--panel)); }
.link-card b { font-size: 13.5px; color: var(--dept); }
.link-card span { font-size: 11.5px; color: var(--sub); }

/* ===== チーム管理 ===== */
.flash { border-radius: 11px; padding: 10px 14px; font-size: 13.5px; margin-bottom: 14px; }
.flash.error { background: #fdecec; color: #b3261e; }
.flash.ok { background: #e2f7ec; color: #147a48; }
.team-admin { border-top: 4px solid var(--dept); margin-bottom: 18px; }
.ta-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 10px; }
.ta-row input[type="text"], .ta-row select {
  border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; font: inherit; font-size: 13.5px; outline: none;
}
.ta-emoji { width: 58px; text-align: center; }
.ta-name { font-weight: 700; min-width: 160px; }
.ta-tagline { flex: 1 1 180px; }
.ta-color { width: 42px; height: 36px; border: 1px solid var(--line); border-radius: 8px; padding: 2px; background: #fff; }
.ta-member-edit summary { font-size: 11.5px; color: var(--sub); cursor: pointer; margin-top: 2px; }
.ta-member-form { margin-top: 8px; }
.ta-member-form textarea {
  width: 100%; border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px;
  font: inherit; font-size: 13px; margin: 6px 0; resize: vertical;
}
.ta-archive { margin-top: 12px; text-align: right; }
.ta-archive-btn { border: none; background: none; color: #b9c0cf; font-size: 12px; cursor: pointer; text-decoration: underline; }
.ta-archive-btn:hover { color: #d8383f; }

/* ===== ダブルチェック・現場連絡 ===== */
.counterpart { font-size: 12px; color: var(--sub); margin-top: 6px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.counterpart b { color: var(--ink); }
.cp-form { display: inline-flex; gap: 6px; align-items: center; }
.cp-form input { border: 1px solid var(--line); border-radius: 8px; padding: 5px 9px; font: inherit; font-size: 12.5px; width: 200px; }
.cp-form .btn { padding: 5px 10px; font-size: 12px; }
.note-foot { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-top: 10px; padding-top: 8px; border-top: 1px dashed var(--line); font-size: 11.5px; flex-wrap: wrap; }
.check-done { color: #147a48; font-weight: 700; }
.check-wait { color: #8a6100; font-weight: 700; }
.note-foot-actions { display: inline-flex; gap: 10px; align-items: center; }
.check-btn { border: 1px solid var(--line); background: #fff; border-radius: 8px; padding: 4px 10px; font-size: 11.5px; font-weight: 700; cursor: pointer; color: var(--ink); }
.check-btn:hover { border-color: #147a48; color: #147a48; }
.notify-link { font-weight: 700; color: var(--brand); }
.notify-form .ops-block { display: block; font-size: 12px; font-weight: 700; color: var(--sub); margin-bottom: 12px; }
.notify-form input[type="text"], .notify-form select, .notify-form textarea {
  width: 100%; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; font: inherit; font-size: 14px; font-weight: 400; margin-top: 4px;
}
.ops-actions-row { display: flex; gap: 10px; }

/* ===== 店舗作り込みキット(チーム部屋) ===== */
.team-kit { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 18px; margin-bottom: 18px; }
.kit-org { grid-column: 1 / -1; }
.org-ladder { display: flex; flex-direction: column; gap: 8px; }
.org-row {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  border: 1px solid var(--line); border-left: 6px solid var(--rc, #888);
  border-radius: 11px; padding: 9px 14px; background: #fbfcfe;
}
.org-rank { flex: none; min-width: 168px; font-weight: 700; font-size: 14px; color: var(--rc, #333); }
.org-duties { flex: 1 1 240px; font-size: 13px; color: #39404f; }
.org-badges { display: inline-flex; gap: 6px; flex-wrap: wrap; }
.org-b { font-size: 11px; font-weight: 700; background: #eef0f6; color: #4c5468; border-radius: 99px; padding: 3px 9px; }
.org-b.ai { background: #eceefc; color: #4f5dd6; }
.org-b.task { background: #fff3d6; color: #8a6100; }
.kit-links { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.kit-links.col { flex-direction: column; align-items: stretch; }
.kit-links .btn { font-size: 13px; }
.card-title .ct-sub a { color: var(--brand); text-decoration: underline; }

/* ===== 店舗ツール(タブ埋め込み) ===== */
.kit-embed { margin-bottom: 18px; }
.embed-open { margin-left: auto; font-size: 12px; padding: 6px 12px; }
.embed-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.embed-tabs .et {
  border: 1px solid var(--line); background: #fff; border-radius: 99px;
  padding: 7px 14px; font-size: 13px; font-weight: 600; color: var(--sub); cursor: pointer;
}
.embed-tabs .et:hover { border-color: var(--dept); color: var(--ink); }
.embed-tabs .et.cur { background: var(--dept); border-color: var(--dept); color: #fff; }
.embed-frame {
  width: 100%; height: 78vh; border: 1px solid var(--line); border-radius: 12px; background: #fff;
}
.org-detail { flex: 1 1 300px; display: flex; flex-direction: column; gap: 2px; }
.org-line { font-size: 12.5px; color: #39404f; }
.org-line b { font-weight: 700; color: var(--sub); font-size: 11px; margin-right: 6px; }


/* 部屋ページ: 右サイドバーをヒーロー直下から並走・スクロール追従 */
.room-side { position: sticky; top: 110px; }
@media (max-width: 900px) { .room-side { position: static; } }

/* チャット一覧の折りたたみ(既定は畳んで本画面をフル幅に) */
.side-rail {
  display: none; width: 46px; padding: 12px 0; border: 1px solid var(--line); border-radius: 12px;
  background: var(--panel); box-shadow: var(--shadow); cursor: pointer; color: var(--sub);
  flex-direction: column; align-items: center; gap: 6px; font-size: 17px;
}
.side-rail span { writing-mode: vertical-rl; font-size: 11px; font-weight: 700; letter-spacing: .12em; }
.side-rail:hover { border-color: var(--dept); color: var(--dept); }
.room-grid.side-collapsed { grid-template-columns: 1fr 46px; }
.room-grid.side-collapsed .chat-side { display: none; }
.room-grid.side-collapsed .side-rail { display: flex; }
.side-close { float: right; margin-left: 6px; }
@media (max-width: 900px) {
  .room-grid.side-collapsed { grid-template-columns: 1fr; }
  .room-grid.side-collapsed .side-rail { flex-direction: row; width: auto; padding: 8px 14px; }
  .room-grid.side-collapsed .side-rail span { writing-mode: horizontal-tb; }
}

/* 店舗ツール: タブを左サイドバー形式に */
.embed-body { display: grid; grid-template-columns: 190px 1fr; gap: 14px; align-items: start; }
.embed-body .embed-tabs { flex-direction: column; gap: 5px; margin-bottom: 0; position: sticky; top: 110px; }
.embed-body .embed-tabs .et { text-align: left; border-radius: 10px; width: 100%; }
@media (max-width: 900px) {
  .embed-body { grid-template-columns: 1fr; }
  .embed-body .embed-tabs { flex-direction: row; flex-wrap: wrap; position: static; }
}

/* ===== 部屋内タブ ===== */
.rtabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.rtabs .rt {
  border: 1px solid var(--line); background: var(--panel); border-radius: 99px;
  padding: 8px 16px; font-size: 13.5px; font-weight: 700; color: var(--sub); cursor: pointer;
}
.rtabs .rt:hover { border-color: var(--dept); color: var(--ink); }
.rtabs .rt.cur { background: var(--dept); border-color: var(--dept); color: #fff; }
.rtab-panel { display: none; }
.rtab-panel.cur { display: block; }
.rtab-panel .card { margin-bottom: 18px; }

/* ===== スタッフ管理一覧 ===== */
.stafftbl-wrap { overflow-x: auto; }
.stafftbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.stafftbl th { text-align: left; font-size: 11.5px; color: var(--sub); font-weight: 700; padding: 8px 10px; border-bottom: 2px solid var(--line); white-space: nowrap; }
.stafftbl td { padding: 9px 10px; border-bottom: 1px solid #f0f2f7; white-space: nowrap; }
.stafftbl tr:hover td { background: #f8f9fc; }
.st-name { font-weight: 700; }
.st-onduty { font-size: 10.5px; color: #147a48; font-weight: 700; }
.st-rank { display: inline-block; font-size: 11px; font-weight: 700; color: var(--rc, #555); border: 1.5px solid var(--rc, #ccc); border-radius: 99px; padding: 2px 10px; background: color-mix(in srgb, var(--rc, #ccc) 8%, #fff); }
.st-ok { color: #147a48; font-weight: 700; font-size: 12px; }
.st-warn { color: #8a6100; font-weight: 700; font-size: 12px; background: #fff3d6; border-radius: 8px; padding: 2px 8px; }
.st-dim { color: #b9c0cf; }
.st-train { display: inline-block; width: 64px; height: 7px; border-radius: 99px; background: #e8ebf2; overflow: hidden; vertical-align: 1px; }
.st-train i { display: block; height: 100%; background: #2fb87a; border-radius: 99px; }
.st-link { font-size: 12px; font-weight: 700; color: var(--brand); }
.jinji-biz { border: 1px solid var(--line); border-radius: 10px; padding: 7px 12px; font: inherit; font-size: 13.5px; font-weight: 600; }
