/* =========================================================
   합동 비서실 · 비서실 오피스
   따뜻한 크림·베이지 + 딥그린 팔레트 / 모바일 우선
   ========================================================= */

:root {
  --bg: #f6f1e8;
  --bg-deep: #efe7da;
  --card: #ffffff;
  --card-soft: #fdfaf4;
  --line: #ebe1d2;
  --line-soft: #f2ebe0;
  --ink: #1e2e26;
  --ink-2: #48584f;
  --muted: #8b968d;
  --green: #1f4d3a;
  --green-600: #276049;
  --green-soft: #e8f0ea;
  --green-line: #cbddd1;
  --beige: #efe3cf;
  --beige-soft: #f8efe0;
  --pink: #d7728f;
  --pink-soft: #fdecf1;
  --mint: #3e8f6d;
  --mint-soft: #e6f4ec;
  --violet: #6c6fc4;
  --violet-soft: #edecfb;
  --amber: #b07c2f;
  --amber-soft: #fbf1de;
  --danger: #c0453b;
  --shadow-sm: 0 1px 2px rgba(31, 77, 58, 0.05), 0 4px 12px rgba(31, 77, 58, 0.05);
  --shadow-md: 0 2px 8px rgba(31, 77, 58, 0.07), 0 12px 28px rgba(31, 77, 58, 0.06);
  --radius-lg: 20px;
  --radius-md: 16px;
  --radius-sm: 12px;
  --tabbar-h: 46px;
  --msg-line: 1.5;      /* 말풍선 줄간격 — 접기 높이(10줄)도 이 값을 함께 쓴다 */
  --sans: -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Pretendard",
    "Noto Sans KR", "Malgun Gothic", system-ui, sans-serif;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body { height: 100%; }

body {
  margin: 0;
  font-family: var(--sans);
  background: var(--bg);
  color: var(--ink);
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}

button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; padding: 0; }
img { max-width: 100%; display: block; }
a { color: var(--green-600); }
.hidden { display: none !important; }

:focus-visible {
  outline: 2px solid var(--green-600);
  outline-offset: 2px;
  border-radius: 6px;
}

/* ---------------- 로그인 ---------------- */

.login-screen {
  min-height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 18px;
  overflow-y: auto;
  background:
    radial-gradient(1200px 400px at 50% -10%, #fdf7ea 0%, rgba(253, 247, 234, 0) 70%),
    var(--bg);
}

.login-card {
  width: 100%;
  max-width: 420px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 24px 20px 22px;
  box-shadow: var(--shadow-md);
}

.login-faces {
  display: flex;
  justify-content: center;
  margin-bottom: 14px;
}

.login-faces img {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  border: 3px solid var(--card-soft);
  object-fit: cover;
  box-shadow: 0 2px 8px rgba(31, 77, 58, 0.12);
}

.login-faces img + img { margin-left: -14px; }

.login-title {
  font-size: 19px;
  margin: 0 0 6px;
  letter-spacing: -0.4px;
  text-align: center;
}

.login-sub {
  color: var(--muted);
  font-size: 12.5px;
  text-align: center;
  margin: 0 0 18px;
  line-height: 1.6;
}

.field { margin-bottom: 12px; }

.field label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: var(--ink-2);
  margin-bottom: 6px;
}

.field input,
.field select {
  width: 100%;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--card-soft);
  font-size: 14px;
}

.field input:focus,
.field select:focus {
  background: #fff;
  border-color: var(--green-line);
  outline: none;
  box-shadow: 0 0 0 3px rgba(31, 77, 58, 0.08);
}

.btn-primary {
  width: 100%;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  background: var(--green);
  color: #fdfaf3;
  font-weight: 700;
  font-size: 14.5px;
  letter-spacing: -0.2px;
  transition: background 0.15s ease, transform 0.1s ease;
}

.btn-primary:active { transform: translateY(1px); }
.btn-primary:disabled { opacity: 0.6; cursor: not-allowed; }

.login-err {
  min-height: 18px;
  margin-top: 10px;
  color: var(--danger);
  font-size: 12.5px;
  text-align: center;
}

/* ---------------- 앱 셸 ---------------- */

.app {
  height: 100dvh;
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 780px;
  margin: 0 auto;
  background: var(--bg);
  position: relative;
}

.app-header {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 5px 14px 4px;
  background: rgba(246, 241, 232, 0.94);
  backdrop-filter: blur(10px);
}

.brand { display: flex; align-items: center; gap: 10px; min-width: 0; }

.brand-mark {
  width: 32px;
  height: 32px;
  flex: 0 0 auto;
  border-radius: 10px;
  background: var(--card);
  border: 1px solid var(--line);
  display: grid;
  place-items: center;
  font-size: 16px;
  box-shadow: var(--shadow-sm);
}

.brand-text { min-width: 0; }

.brand-title {
  margin: 0;
  font-size: 15.5px;
  font-weight: 800;
  letter-spacing: -0.5px;
  line-height: 1.15;
  white-space: nowrap;
}

.brand-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 1px;
  font-size: 10.5px;
  color: var(--muted);
  white-space: nowrap;
}

.live-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 7px;
  border-radius: 999px;
  background: var(--green-soft);
  border: 1px solid var(--green-line);
  color: var(--green);
  font-weight: 700;
  font-size: 10.5px;
}

.live-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #2e9e6b;
  box-shadow: 0 0 0 3px rgba(46, 158, 107, 0.16);
}

.live-badge.is-off { background: #f1ede5; border-color: var(--line); color: #8e897d; }
.live-badge.is-off .live-dot { background: #b6b1a5; box-shadow: none; }

.meta-sep { color: #c9c2b4; }

.progress-text { font-weight: 700; color: var(--ink-2); }

.header-right { position: relative; flex: 0 0 auto; }

.user-btn {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 3px 6px 3px 3px;
  border-radius: 999px;
  background: var(--card);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
}

.user-avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--green);
  color: #fbf4e6;
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 800;
}

.user-btn svg { color: var(--muted); }

.user-menu {
  position: absolute;
  top: 38px;
  right: 0;
  z-index: 60;
  width: 212px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  padding: 12px;
}

.user-menu-head {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 10px;
}

.user-menu-head strong { color: var(--ink); font-size: 13.5px; }

.menu-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 12px;
  color: var(--ink-2);
  margin-bottom: 10px;
}

.menu-row select {
  padding: 5px 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--card-soft);
  font-size: 12px;
}

.menu-logout {
  width: 100%;
  padding: 9px;
  border-radius: 10px;
  background: #f4f1ea;
  color: var(--ink-2);
  font-size: 12.5px;
  font-weight: 700;
}

.menu-toggle {
  width: 100%;
  margin-bottom: 6px;
  padding: 9px;
  border-radius: 10px;
  background: var(--card);
  border: 1px solid var(--line);
  color: var(--ink-2);
  font-size: 12px;
  font-weight: 700;
  text-align: left;
}

.menu-toggle[data-on="1"] {
  background: var(--green-soft);
  border-color: var(--green-line);
  color: var(--green);
}

/* ---------------- 화면 팝업 알림 (v3) ----------------
   소리가 아니라 화면에 뜨는 알림이 기본이다. 헤더 아래에 쌓이고 6초 뒤 사라진다. */

.notify-stack {
  position: fixed;
  top: calc(env(safe-area-inset-top) + 50px);
  left: 50%;
  transform: translateX(-50%);
  z-index: 95;
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: min(94vw, 420px);
  pointer-events: none;
}

.notify-card {
  pointer-events: auto;
  display: block;
  width: 100%;
  text-align: left;
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.985);
  border: 1px solid var(--line);
  border-left: 4px solid var(--green);
  box-shadow: 0 12px 30px rgba(31, 77, 58, 0.18);
  opacity: 0;
  transform: translateY(-10px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.notify-card.is-on { opacity: 1; transform: translateY(0); }

.notify-card.tone-call { border-left-color: #d09a3c; background: #fffdf5; }
.notify-card.tone-settled { border-left-color: #6d7fc4; background: #fbfbff; }
.notify-card.tone-ask { border-left-color: #4f9d78; }

.nc-head { display: flex; align-items: center; gap: 6px; }
.nc-icon { font-size: 13px; line-height: 1; }
.nc-title { flex: 1; font-size: 12px; font-weight: 800; color: var(--ink); letter-spacing: -0.2px; }
.nc-close { font-size: 14px; color: var(--muted); padding: 0 2px; }
.nc-body {
  margin-top: 3px;
  font-size: 12px;
  line-height: 1.45;
  color: var(--ink-2);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

@media (prefers-reduced-motion: reduce) {
  .notify-card { transition: none; }
}

/* ---------------- 빠른 액션 ---------------- */

.quick-actions {
  flex: 0 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  padding: 0 14px 4px;
}

.qa-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  height: 32px;
  border-radius: 10px;
  background: var(--card);
  border: 1px solid var(--line);
  color: var(--ink);
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: -0.2px;
  box-shadow: var(--shadow-sm);
  transition: transform 0.1s ease;
}

.qa-btn:active { transform: translateY(1px); }

.qa-primary {
  background: var(--green);
  border-color: var(--green);
  color: #fdf8ec;
}

.qa-primary svg { color: #f0d9a8; }

/* ---------------- 뷰 ---------------- */

.app-main {
  flex: 1 1 auto;
  position: relative;
  overflow: hidden;
}

.view {
  position: absolute;
  inset: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 2px 16px 22px;
  -webkit-overflow-scrolling: touch;
}

.view-chat {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 0;
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin: 18px 2px 8px;
}

.section-head h2 {
  margin: 0;
  font-size: 13.5px;
  font-weight: 800;
  letter-spacing: -0.3px;
}

.section-head .section-note {
  font-size: 11px;
  color: var(--muted);
}

/* ---------------- 오피스 ---------------- */

.office-hero {
  margin-top: 4px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 10px;
  box-shadow: var(--shadow-sm);
}

.hero-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 2px 4px 10px;
}

.hero-head h2 {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 14.5px;
  font-weight: 800;
  letter-spacing: -0.4px;
}

.hero-head h2 svg { color: var(--green-600); }

.hero-count {
  font-size: 11px;
  color: var(--green-600);
  background: var(--green-soft);
  border: 1px solid var(--green-line);
  padding: 3px 9px;
  border-radius: 999px;
  font-weight: 700;
  white-space: nowrap;
}

.hero-scene {
  position: relative;
  border-radius: 14px;
  overflow: hidden;
  background: #f3ece0;
}

.hero-scene img {
  width: 100%;
  aspect-ratio: 3 / 2;
  object-fit: cover;
}

.hero-scene::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0) 55%, rgba(255, 252, 244, 0.55) 100%);
  pointer-events: none;
}

.scene-tag {
  position: absolute;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px 2px 2px;
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid rgba(235, 225, 210, 0.9);
  border-radius: 999px;
  box-shadow: 0 3px 10px rgba(31, 77, 58, 0.14);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: -0.3px;
  color: var(--ink);
  white-space: nowrap;
  backdrop-filter: blur(4px);
}

.scene-tag img {
  width: 17px;
  height: 17px;
  border-radius: 50%;
  object-fit: cover;
}

.scene-tag .tag-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #b6b1a5;
}

.scene-tag.is-busy .tag-dot { background: #2e9e6b; box-shadow: 0 0 0 2px rgba(46, 158, 107, 0.18); }

.scene-tag.t-a { left: 19%; top: 36%; }
.scene-tag.t-b { left: 30%; top: 63%; }
.scene-tag.t-c { left: 56%; top: 66%; }

.member-list {
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.member-card {
  display: flex;
  align-items: center;
  gap: 11px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 11px 12px;
  box-shadow: var(--shadow-sm);
}

.member-avatar {
  width: 44px;
  height: 44px;
  flex: 0 0 auto;
  border-radius: 50%;
  object-fit: cover;
  background: var(--beige-soft);
}

.member-avatar.ring-pink { box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--pink-soft); }
.member-avatar.ring-mint { box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--mint-soft); }
.member-avatar.ring-violet { box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--violet-soft); }

.member-main { flex: 1 1 auto; min-width: 0; }

.member-top {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.member-name {
  font-size: 14px;
  font-weight: 800;
  letter-spacing: -0.3px;
}

.member-role {
  font-size: 10.5px;
  color: var(--muted);
  background: #f5f1e8;
  padding: 2px 7px;
  border-radius: 999px;
  white-space: nowrap;
}

.member-task {
  margin: 4px 0 0;
  font-size: 11.5px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.member-task.has-task { color: var(--ink-2); }

.status-badge {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 10.5px;
  font-weight: 800;
  padding: 4px 9px;
  border-radius: 999px;
  background: #f2eee6;
  color: #8b8578;
  white-space: nowrap;
}

.status-badge .dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #b6b1a5;
}

.status-badge.is-busy { background: var(--green-soft); color: var(--green); }
.status-badge.is-busy .dot { background: #2e9e6b; box-shadow: 0 0 0 2px rgba(46, 158, 107, 0.18); }

.office-note {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  margin-top: 14px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: var(--amber-soft);
  border: 1px solid #f0e2c6;
  color: #7d6535;
  font-size: 11px;
  line-height: 1.55;
}

.office-note svg { flex: 0 0 auto; margin-top: 1px; color: #b5893b; }

/* ---------------- 경영지원팀 움직이는 회의실 (team-room-office-art) ---------------- */

.mgmt-hero { padding-bottom: 8px; }

.mgmt-office-art {
  position: relative;
  border-radius: 14px;
  overflow: hidden;
  background: #e8ece6 center / 100% 100% no-repeat;
  min-height: 180px;
}

/* office-art 가 만드는 .oapp 은 폭 100% · 3:2 비율이다 */
.mgmt-office-art .oapp {
  border-radius: 14px;
}

/* 아직 그림이 안 들어왔을 때(스크립트 없음·오류) 보이는 안내 */
.mgmt-office-art:empty::after {
  content: "회의실 그림을 불러오는 중입니다…";
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: #7b8478;
  font-size: 12px;
}

.office-art-note {
  margin: 8px 4px 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.55;
}

.office-art-note b { color: var(--green-600); }

/* ---------------- 채팅 ---------------- */

.chat-toolbar {
  flex: 0 0 auto;
  background: var(--bg);
  padding: 0 0 4px;
  border-bottom: 1px solid var(--line-soft);
}

.chip-row {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding: 1px 10px;
  scrollbar-width: none;
}

.chip-row::-webkit-scrollbar { display: none; }

.chip {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--ink-2);
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

.chip .chip-avatar {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  object-fit: cover;
}

.chip.is-active {
  background: var(--green);
  border-color: var(--green);
  color: #fdf8ec;
}

.chip.is-active .chip-avatar { box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.5); }

.chip .count {
  font-size: 10px;
  opacity: 0.65;
}

.search-wrap {
  position: relative;
  margin: 4px 10px 0;
}

.search-wrap svg {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
}

.search-input {
  width: 100%;
  height: 28px;
  padding: 0 11px 0 29px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--card);
  font-size: 12px;
}

.search-input:focus { outline: none; border-color: var(--green-line); box-shadow: 0 0 0 3px rgba(31, 77, 58, 0.07); }

.chat-list {
  flex: 1 1 auto;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 7px 10px 8px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  background:
    radial-gradient(900px 300px at 50% 0%, #fdf9f0 0%, rgba(253, 249, 240, 0) 70%),
    #faf6ee;
  -webkit-overflow-scrolling: touch;

}

.day-divider {
  align-self: center;
  margin: 1px 0 0;
  padding: 2px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid var(--line-soft);
  font-size: 10px;
  color: var(--muted);
  font-weight: 700;
}

.msg-row {
  display: flex;
  gap: 6px;
  align-items: flex-start;
  max-width: 100%;
  min-width: 0;
}

.msg-avatar {
  width: 30px;
  height: 30px;
  flex: 0 0 auto;
  border-radius: 50%;
  object-fit: cover;
  background: var(--beige-soft);
  box-shadow: 0 1px 3px rgba(31, 77, 58, 0.1);
}

.msg-avatar.placeholder {
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 800;
  color: #fff;
  background: var(--green-600);
}

.msg-avatar.spacer { visibility: hidden; }

.msg-block { min-width: 0; max-width: 92%; display: flex; flex-direction: column; }

.msg-meta {
  display: flex;
  align-items: center;
  gap: 5px;
  margin: 0 2px 2px;
  font-size: 10px;
  color: var(--muted);
}

.msg-name { font-weight: 800; font-size: 11px; }
.msg-name.s-changmin { color: var(--pink); }
.msg-name.s-collab { color: var(--mint); }
.msg-name.s-p3 { color: var(--violet); }

.bubble {
  position: relative;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 4px 13px 13px 13px;
  padding: 5px 11px 5px;
  box-shadow: 0 1px 2px rgba(31, 77, 58, 0.04);
}

.msg-row.from-user { flex-direction: row-reverse; margin-left: auto; }
.msg-row.from-user .msg-block { align-items: flex-end; }
.msg-row.from-user .msg-meta { flex-direction: row-reverse; }

.msg-row.from-user .bubble {
  background: var(--green);
  border-color: var(--green);
  color: #fbf6ea;
  border-radius: 14px 4px 14px 14px;
}

.msg-row.from-user .msg-name { color: var(--ink-2); }

.bubble.is-collapsed { padding-bottom: 3px; }

.msg-text {
  margin: 0;
  font-size: 14.5px;
  line-height: var(--msg-line);
  white-space: pre-wrap;
  word-break: break-word;
  overflow-wrap: anywhere;
  letter-spacing: -0.1px;
}

.msg-text.is-clamped {
  max-height: calc(var(--msg-line) * 10em);
  overflow: hidden;
  -webkit-mask-image: linear-gradient(180deg, #000 72%, rgba(0, 0, 0, 0.18) 100%);
  mask-image: linear-gradient(180deg, #000 72%, rgba(0, 0, 0, 0.18) 100%);
}

.msg-text a {
  color: var(--green-600);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.from-user .msg-text a { color: #d9edc6; }

.msg-text .rich-h {
  font-weight: 800;
  color: var(--ink);
  letter-spacing: -0.2px;
}

.from-user .msg-text .rich-h { color: #fffdf6; }

.more-btn {
  display: inline-block;
  margin-top: 3px;
  font-size: 10.5px;
  font-weight: 800;
  color: var(--green-600);
  background: var(--green-soft);
  border-radius: 999px;
  padding: 2px 9px;
}

.from-user .more-btn { color: #f0e6cf; background: rgba(255, 255, 255, 0.16); }

.msg-time { font-size: 9.5px; color: var(--muted); }

.msg-empty {
  margin: auto;
  text-align: center;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.7;
  padding: 24px;
}

.msg-empty strong { display: block; color: var(--ink-2); font-size: 13px; margin-bottom: 4px; }

.new-pill {
  position: absolute;
  left: 50%;
  bottom: 74px;
  transform: translateX(-50%);
  z-index: 12;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 7px 14px;
  border-radius: 999px;
  background: var(--green);
  color: #fdf8ec;
  font-size: 11.5px;
  font-weight: 800;
  box-shadow: 0 6px 16px rgba(31, 77, 58, 0.28);
}

.composer {
  flex: 0 0 auto;
  background: rgba(255, 255, 255, 0.97);
  border-top: 1px solid var(--line);
  padding: 3px 9px 4px;
}

.composer-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 0 2px 2px;
}

.composer-sender {
  border: 1px solid var(--line);
  background: var(--card-soft);
  border-radius: 999px;
  padding: 1px 7px;
  font-size: 10.5px;
  font-weight: 700;
  color: var(--ink-2);
  max-width: 130px;
}

.char-count { font-size: 10.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.char-count.is-near { color: var(--amber); font-weight: 700; }

.composer-row { display: flex; align-items: flex-end; gap: 6px; }

.chat-input {
  flex: 1 1 auto;
  min-height: 34px;
  max-height: 120px;
  padding: 7px 11px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--card-soft);
  font-size: 14px;
  line-height: 1.4;
  resize: none;
  overflow-y: auto;
}

.chat-input:focus { outline: none; background: #fff; border-color: var(--green-line); box-shadow: 0 0 0 3px rgba(31, 77, 58, 0.07); }

.send-btn {
  flex: 0 0 auto;
  width: 40px;
  height: 34px;
  border-radius: 10px;
  background: var(--green);
  color: #fdf8ec;
  display: grid;
  place-items: center;
  transition: opacity 0.15s ease;
}

.send-btn:disabled { opacity: 0.45; }

/* ---------------- 작업 보드 ---------------- */

.todo-form {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 11px;
  box-shadow: var(--shadow-sm);
  margin-top: 4px;
}

.todo-form input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--card-soft);
  font-size: 13.5px;
}

.todo-form input:focus { outline: none; background: #fff; border-color: var(--green-line); box-shadow: 0 0 0 3px rgba(31, 77, 58, 0.07); }

.todo-form-row { display: flex; gap: 8px; margin-top: 8px; }

.todo-form-row select {
  flex: 1 1 auto;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--card-soft);
  font-size: 12.5px;
}

.todo-form-row button {
  flex: 0 0 auto;
  padding: 9px 18px;
  border-radius: 10px;
  background: var(--green);
  color: #fdf8ec;
  font-size: 12.5px;
  font-weight: 800;
}

.segmented {
  display: flex;
  gap: 4px;
  padding: 4px;
  background: var(--bg-deep);
  border-radius: 12px;
  margin-top: 12px;
}

.segmented button {
  flex: 1 1 0;
  padding: 8px 6px;
  border-radius: 9px;
  font-size: 12px;
  font-weight: 800;
  color: var(--ink-2);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
}

.segmented button.is-active {
  background: var(--card);
  color: var(--green);
  box-shadow: 0 1px 4px rgba(31, 77, 58, 0.1);
}

.segmented .tab-count {
  font-size: 10px;
  padding: 1px 6px;
  border-radius: 999px;
  background: rgba(31, 77, 58, 0.08);
}

.board-chips { margin: 10px 0 4px; padding-left: 0; padding-right: 0; }

.todo-list {
  list-style: none;
  margin: 6px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.todo-card {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 11px 12px;
  box-shadow: var(--shadow-sm);
}

.todo-check {
  flex: 0 0 auto;
  width: 22px;
  height: 22px;
  margin-top: 1px;
  border-radius: 50%;
  border: 1.6px solid #d5cbbb;
  background: #fff;
  display: grid;
  place-items: center;
  color: transparent;
  transition: all 0.15s ease;
}

.todo-check svg { width: 12px; height: 12px; }

.todo-card.is-done .todo-check {
  background: var(--green-600);
  border-color: var(--green-600);
  color: #fff;
}

.todo-body { min-width: 0; flex: 1 1 auto; }

.todo-title {
  margin: 0;
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1.5;
  letter-spacing: -0.15px;
  word-break: break-word;
  white-space: pre-wrap;
}

.todo-card.is-done .todo-title { color: var(--muted); text-decoration: line-through; }

.todo-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 6px;
  flex-wrap: wrap;
}

.assignee-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 10px;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 999px;
  background: #f3efe7;
  color: var(--ink-2);
  white-space: nowrap;
}

.assignee-badge.a-changmin { background: var(--pink-soft); color: #b25a75; }
.assignee-badge.a-collab { background: var(--mint-soft); color: #2f7a59; }
.assignee-badge.a-p3 { background: var(--violet-soft); color: #565aab; }

.todo-date { font-size: 10px; color: var(--muted); }

.list-empty {
  text-align: center;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.7;
  padding: 26px 12px;
}

.list-empty strong { display: block; color: var(--ink-2); font-size: 13px; margin-bottom: 4px; }

/* ---------------- 조직도 ---------------- */

.org-tree { margin-top: 6px; }

.org-node {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 12px;
  box-shadow: var(--shadow-sm);
}

.org-node.owner {
  background: linear-gradient(180deg, #fdf9f0 0%, #ffffff 100%);
  border-color: var(--green-line);
}

.org-node.lead { border-color: var(--green-line); }

.org-node-head {
  display: flex;
  align-items: center;
  gap: 9px;
}

.org-node-title {
  font-size: 13.5px;
  font-weight: 800;
  letter-spacing: -0.3px;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.org-node-sub {
  margin: 5px 0 0;
  font-size: 11px;
  color: var(--muted);
  line-height: 1.55;
}

.org-chip {
  font-size: 10px;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 999px;
  background: var(--green-soft);
  color: var(--green);
}

.org-chip.beige { background: var(--beige-soft); color: #8a7343; }
.org-chip.amber { background: var(--amber-soft); color: #8b5e1c; }

.org-branch {
  width: 2px;
  height: 16px;
  margin: 0 auto;
  background: var(--line);
  border-radius: 2px;
}

.org-children {
  display: grid;
  gap: 8px;
}

.org-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  object-fit: cover;
  flex: 0 0 auto;
  background: var(--beige-soft);
}

.org-avatar.small { width: 26px; height: 26px; font-size: 11px; display: grid; place-items: center; color: #fff; font-weight: 800; background: var(--green); }

.timeline {
  list-style: none;
  margin: 8px 0 0;
  padding: 0 0 0 14px;
  border-left: 2px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.timeline li { position: relative; }

.timeline li::before {
  content: "";
  position: absolute;
  left: -20px;
  top: 7px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid var(--green-line);
}

.timeline li.is-now::before { background: #2e9e6b; border-color: #2e9e6b; }

.tl-time {
  display: inline-block;
  font-size: 10.5px;
  font-weight: 800;
  color: var(--green-600);
  background: var(--green-soft);
  border-radius: 6px;
  padding: 1px 6px;
  margin-bottom: 4px;
  font-variant-numeric: tabular-nums;
}

.tl-title {
  margin: 0;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: -0.2px;
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
}

.tl-desc {
  margin: 3px 0 0;
  font-size: 11px;
  color: var(--muted);
  line-height: 1.55;
}

.org-footnote {
  margin-top: 14px;
  font-size: 10.5px;
  color: var(--muted);
  line-height: 1.6;
  padding: 10px 12px;
  background: var(--card);
  border: 1px dashed var(--line);
  border-radius: var(--radius-sm);
}

/* ---------------- 탭바 ---------------- */

.tabbar {
  flex: 0 0 auto;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 2px;
  padding: 3px 8px calc(3px + env(safe-area-inset-bottom));
  background: rgba(255, 255, 255, 0.98);
  border-top: 1px solid var(--line);
  box-shadow: 0 -4px 16px rgba(31, 77, 58, 0.05);
}

.tab-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  padding: 3px 2px 2px;
  border-radius: 12px;
  color: #8f968c;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: -0.3px;
  transition: background 0.15s ease, color 0.15s ease;
}

.tab-btn svg { width: 19px; height: 19px; }

.tab-btn.is-active {
  color: var(--green);
  background: var(--green-soft);
}

.tab-btn.is-active svg { stroke-width: 2.1; }

/* ---------------- 토스트 ---------------- */

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(var(--tabbar-h) + 12px + env(safe-area-inset-bottom));
  transform: translate(-50%, 12px);
  z-index: 80;
  max-width: 88vw;
  padding: 9px 15px;
  border-radius: 999px;
  background: rgba(30, 46, 38, 0.94);
  color: #fbf6ea;
  font-size: 12px;
  font-weight: 600;
  box-shadow: 0 8px 22px rgba(31, 77, 58, 0.24);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.toast.is-on { opacity: 1; transform: translate(-50%, 0); }

/* ---------------- 큰 화면 ---------------- */

@media (min-width: 760px) {
  body { background: var(--bg-deep); }

  /* 데스크톱·태블릿: 앱 컨테이너를 화면 폭에 가깝게 넓혀 좌우 빈 공간을 없앤다
     (초광폭 모니터에서 한 줄이 지나치게 길어지지 않게 1680px 상한) */
  .app {
    max-width: min(1680px, 100%);
    box-shadow: 0 0 0 1px rgba(235, 225, 210, 0.7), 0 24px 60px rgba(31, 77, 58, 0.1);
  }

  .app-header { padding: 6px 16px 5px; }

  /* 빠른 액션은 채팅 폭에 맞춰 가운데 */
  .quick-actions {
    width: 100%;
    max-width: 900px;
    margin: 0 auto;
    padding: 0 16px 5px;
  }

  /* 채팅 이외 화면(오피스·작업 보드·조직도)은 읽기 좋은 한 단(900px)으로 가운데 정렬 */
  .view:not(.view-chat) {
    padding: 4px max(24px, calc((100% - 900px) / 2)) 26px;
  }

  /* 탭바는 가운데 묶어 버튼이 과하게 벌어지지 않게 */
  .tabbar {
    grid-template-columns: repeat(5, minmax(0, 210px));
    justify-content: center;
    padding-top: 3px;
  }

  /* 채팅 상단: 발신자 칩과 검색을 한 줄로 묶어 메시지 영역을 세로로 더 준다 */
  .chat-toolbar {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 2px 0 4px;
  }
  .chat-toolbar .chip-row { flex: 1 1 auto; min-width: 0; padding: 1px 0 1px 16px; }
  .chat-toolbar .search-wrap { flex: 0 0 auto; width: min(300px, 30%); margin: 0 16px 0 0; max-width: none; }

  /* 채팅 좌우 여백을 줄여 가로 공간을 최대한 쓴다 */
  .chat-list { padding: 8px 16px 10px; gap: 9px; }

  .msg-row { gap: 8px; }
  /* 86% 로 넓히되, 큰 모니터에서는 한 줄이 너무 길어지지 않게 1120px 상한 */
  .msg-block { max-width: min(86%, 1120px); }
  .msg-avatar { width: 34px; height: 34px; }

  .msg-text { font-size: 15px; line-height: 1.5; --msg-line: 1.5; }
  .bubble { padding: 6px 13px 6px; }

  .composer { padding: 4px 16px 6px; }
  .chat-input { max-height: 148px; }

  .org-children { grid-template-columns: 1fr 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}

/* =========================================================
   6인 오피스 (할 일 #16 · 키링 1·2·3 추가)
   - .worker 계열: 책상/휴식 자리에 서고 앉는 캐릭터 6명
   - #71 에서 검증한 구조를 6인으로 확장. HTML 삽입 없음(요소는 app.js가 만든다)
   ========================================================= */

:root {
  --steel: #6f7f8a;
  --steel-soft: #e9eef2;
  --slate: #4f6675;
  --slate-soft: #e4ebf1;
}

/* --- 멤버 색: 키링 팀(앰버·스틸·슬레이트) --- */
.member-avatar.ring-amber { box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--amber-soft); }
.member-avatar.ring-steel { box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--steel-soft); }
.member-avatar.ring-slate { box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--slate-soft); }

.msg-name.s-keyring1 { color: var(--amber); }
.msg-name.s-keyring2 { color: var(--steel); }
.msg-name.s-keyring3 { color: var(--slate); }

.assignee-badge.a-keyring1 { background: var(--amber-soft); color: #8b5e1c; }
.assignee-badge.a-keyring2 { background: var(--steel-soft); color: #4d616d; }
.assignee-badge.a-keyring3 { background: var(--slate-soft); color: #3d5261; }

/* --- 정적 배경(움직이는 장면이 뜨기 전)의 이름표 6자리 --- */
.scene-tag.t-d { left: 44%; top: 68%; }
.scene-tag.t-e { left: 62%; top: 68%; }
.scene-tag.t-f { left: 76%; top: 70%; }

/* --- 장면 컨테이너 --- */
.hero-scene { container-type: inline-size; }
.hero-scene.is-live { background: #e8ece6; border-radius: 14px; aspect-ratio: 3 / 2; }
.hero-scene.is-live > img,
.hero-scene.is-live .scene-tag,
.hero-scene.is-live::after { display: none; }

.woff-layer { position: absolute; inset: 0; z-index: 0; display: none; }
.hero-scene.is-live .woff-layer { display: block; }
.woff-bg { position: absolute; inset: 0; background: #e8ece6 center / 100% 100% no-repeat; }

/* --- 바닥 접촉 그림자: 몸통과 분리. left/top만 따라가고 세로로는 안 움직인다 --- */
.worker-ground {
  position: absolute;
  left: calc(var(--x) * 1%);
  top: calc(var(--y) * 1%);
  width: 0; height: 0;
  z-index: 2;
  pointer-events: none;
  transition: left .78s cubic-bezier(.4, 0, .3, 1), top .78s cubic-bezier(.4, 0, .3, 1);
}
.worker-ground.is-instant { transition: none; }
.worker-shadow {
  position: absolute; left: 0; top: 0;
  width: calc(var(--w) * 0.58cqw);
  height: calc(var(--w) * 0.17cqw);
  transform: translate(-50%, -50%);
  border-radius: 50%;
  opacity: .3;
  background: radial-gradient(50% 50% at 50% 50%, rgba(18, 30, 24, .62) 0%, rgba(18, 30, 24, .32) 52%, rgba(18, 30, 24, 0) 100%);
  transition: width .4s ease, opacity .3s ease;
}
.worker-ground.is-seated .worker-shadow { width: calc(var(--w) * 0.78cqw); opacity: .32; }
.worker-ground.is-walk .worker-shadow { animation: worker-shadow-step .42s ease-in-out infinite; }

/* --- 캐릭터: 상자 아래 끝 = 발끝. 앉으면 (1-hip)만큼 내려 엉덩이를 좌판에 얹는다 --- */
.worker {
  position: absolute;
  left: calc(var(--x) * 1%);
  top: calc(var(--y) * 1%);
  width: calc(var(--w) * 1cqw);
  height: calc(var(--h) * 1cqw);
  margin: 0; padding: 0; border: 0; background: none;
  z-index: 3;
  cursor: pointer;
  transform-origin: 50% 100%;
  scale: 1;
  translate: -50% -100%;
  transition: left .78s cubic-bezier(.4, 0, .3, 1), top .78s cubic-bezier(.4, 0, .3, 1),
    translate .34s cubic-bezier(.34, 1.32, .64, 1), scale .12s ease-out;
  -webkit-tap-highlight-color: transparent;
}
.worker.is-seated { translate: -50% calc(-100% + (1 - var(--hip)) * var(--h) * 1cqw); }
.worker.is-instant { transition: none; }
.worker:focus { outline: none; }
.worker.is-press { scale: .94; }
.worker.is-bounce { scale: 1.02; }

.worker-bob { position: absolute; inset: 0; transform-origin: 50% 100%; }
.worker-lean {
  position: absolute; inset: 0; rotate: 0deg; scale: var(--dir, 1) 1;
  transform-origin: 50% 76%;
  transition: rotate .45s ease, scale .3s ease;
}
.worker-motion { position: absolute; inset: 0; translate: 0 0; transform-origin: 50% 100%; }

.hero-scene img.worker-img {
  position: absolute; left: 0; top: 0; width: 100%; height: 100%;
  object-fit: contain; display: block; pointer-events: none;
  transition: opacity .22s ease;
}
.worker-stand { opacity: 1; }
.worker-sit { opacity: 0; }
.worker.is-seated .worker-stand { opacity: 0; }
.worker.is-seated .worker-sit { opacity: 1; }
.worker.is-walk .worker-stand { opacity: 1; }
.worker.is-walk .worker-sit { opacity: 0; }

/* 스프라이트 PNG 가 없을 때의 대체 얼굴 */
.hero-scene img.worker-face {
  position: absolute; left: 50%; top: 34%;
  width: 54%; height: auto; aspect-ratio: 1 / 1;
  transform: translateX(-50%);
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(255, 255, 255, .92);
  box-shadow: 0 3px 10px rgba(20, 40, 32, .18);
  pointer-events: none;
}

/* --- 걷기 · 포즈 --- */
.worker.is-walk .worker-bob { animation: worker-walk .42s ease-in-out infinite; }
.worker.is-walk .worker-lean { rotate: .5deg; }
.worker.is-settle .worker-motion { animation: worker-settle .3s ease-out 1; }
.worker[data-state=work].is-seated .worker-lean { rotate: 1.6deg; }
.worker[data-state=work].is-seated .worker-motion { animation: worker-type 3.1s ease-in-out infinite; }
.worker[data-state=rest].is-seated .worker-lean { rotate: -3deg; animation: worker-stretch 30s ease-in-out infinite; }
.worker[data-state=rest].is-seated .worker-motion { animation: worker-breathe 4.8s ease-in-out infinite; }
.worker[data-state=rest] .worker-sip { display: block; }
.worker-sip {
  position: absolute; left: 78%; bottom: 56%;
  font-size: clamp(9px, 2.4cqw, 14px); line-height: 1;
  opacity: 0; pointer-events: none; display: none;
  animation: worker-sip 17s linear infinite;
}

/* --- 이름표(6명): 캐릭터 발끝 아래. 가장자리에서는 안쪽으로 민다 --- */
.worker-name {
  position: absolute;
  left: calc(var(--x) * 1%);
  top: calc(var(--y) * 1%);
  transform: translate(-50%, 3px);
  z-index: 12;
  display: inline-flex; align-items: center;
  padding: 1px 6px;
  background: rgba(255, 255, 255, .93);
  border: 1px solid rgba(235, 225, 210, .9);
  border-radius: 999px;
  box-shadow: 0 2px 6px rgba(31, 77, 58, .12);
  font-size: clamp(7.5px, 1.05cqw, 10.5px);
  font-weight: 800;
  letter-spacing: -.3px;
  color: var(--ink);
  white-space: nowrap;
  cursor: pointer;
  transition: left .78s cubic-bezier(.4, 0, .3, 1), top .78s cubic-bezier(.4, 0, .3, 1);
}
.worker-name.is-instant { transition: none; }
.worker-name.is-left { transform: translate(-8%, 3px); }
.worker-name.is-right { transform: translate(-92%, 3px); }
.worker-name.is-rest { color: var(--muted); }
.worker-name .nm-short { display: none; font-style: normal; }
.worker-name .nm-full { font-style: normal; }

/* 좁은 화면(390px 등): 축약 이름으로 바꿔 이름표가 겹치지 않게 한다 */
@container (max-width: 470px) {
  .worker-name .nm-full { display: none; }
  .worker-name .nm-short { display: inline; }
  .worker-name { padding: 0 4px; }
}
@media (max-width: 479px) {
  .worker-name .nm-full { display: none; }
  .worker-name .nm-short { display: inline; }
  .worker-name { padding: 0 4px; }
}

/* --- 말풍선: 6초 알림(is-on) 과 hover 미리보기(is-peek) 구분 --- */
.worker-bubble {
  position: absolute; left: 50%; bottom: calc(100% + 3px);
  transform: translateX(-50%);
  max-width: 30cqw;
  background: rgba(255, 255, 255, .97);
  border: 1px solid #e2e7e3;
  border-radius: 9px;
  padding: 3px 7px;
  font-size: clamp(8.5px, 1.25cqw, 11.5px);
  line-height: 1.25;
  color: #42504a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  box-shadow: 0 2px 8px rgba(20, 40, 32, .16);
  pointer-events: none;
  opacity: 0;
  transition: opacity .18s ease, transform .18s ease;
  z-index: 15;
}
.worker-bubble b { font-weight: 800; color: #1d2a24; }
.worker-bubble.is-peek { opacity: 1; }
.worker-bubble.is-on { opacity: 1; animation: worker-pop .22s ease-out 1; }
/* 겹침 방지: x 가 가까우면 위로 쌓는다 */
.worker-bubble.is-stacked { bottom: calc(100% + 3px + 1.7em); }
/* 장면 위쪽 끝에 가까운 자리에서는 말풍선을 아래로 뒤집는다 */
.worker[data-state=work] .worker-bubble { bottom: calc(100% + 1px); }

/* --- 선택 링 · 나머지 흐리게 --- */
.worker.is-selected .worker-bob {
  box-shadow: 0 0 0 2px rgba(47, 111, 85, .95), 0 0 0 5px rgba(47, 111, 85, .16);
  border-radius: 10px;
}
.worker.is-selected .worker-img { filter: brightness(1.06) saturate(1.05); }
.worker.is-dim { opacity: .72; }
.worker:focus-visible .worker-bob { outline: 2px solid #2f6f55; outline-offset: 3px; border-radius: 10px; }

/* --- 정보 패널: 장면을 가리지 않게 장면 아래에 붙인다 --- */
.worker-panel {
  position: relative;
  margin: 8px 2px 4px;
  background: #fff;
  border: 1px solid #dfe6e1;
  border-radius: 12px;
  box-shadow: 0 6px 18px rgba(20, 40, 32, .10);
  padding: 9px 11px;
  font-size: 12.5px;
  line-height: 1.45;
  color: #33403a;
  text-align: left;
}
.worker-panel[hidden] { display: none; }
.worker-panel .wp-head { display: flex; align-items: center; gap: 6px; }
.worker-panel .wp-head img { width: 26px; height: 26px; border-radius: 50%; object-fit: cover; flex: 0 0 auto; }
.worker-panel .wp-name { font-weight: 800; font-size: 13.5px; color: #1d2a24; }
.worker-panel .wp-role { font-size: 11.5px; color: #7b8983; }
.worker-panel .wp-close {
  margin-left: auto; border: 0; background: #f1f4f1; color: #5b6761;
  width: 26px; height: 26px; border-radius: 50%; font-size: 17px; line-height: 1; cursor: pointer; flex: 0 0 auto;
}
.worker-panel .wp-state { display: flex; flex-wrap: wrap; gap: 4px 8px; margin-top: 5px; font-size: 11.5px; color: #54615b; }
.worker-panel .wp-chip { font-weight: 800; color: #1f6b52; background: #e7f3ec; border-radius: 999px; padding: 1px 7px; }
.worker-panel .wp-chip.is-rest { color: #8a6a2f; background: #f6efe0; }
.worker-panel .wp-talk {
  margin: 5px 0 0; padding-top: 5px; border-top: 1px dashed #e6ece8; color: #3f4d46;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.worker-panel .wp-acts { display: flex; gap: 6px; margin-top: 7px; }
.worker-panel .wp-btn {
  flex: 1 1 0; min-width: 0; border: 1px solid #cfe0d6; background: #f4faf6; color: #1f6b52;
  border-radius: 9px; padding: 7px 4px; font-size: 12.5px; font-weight: 800; cursor: pointer;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.worker-panel .wp-btn[aria-disabled=true] { color: #9aa5a0; background: #f4f5f4; border-color: #e4e7e5; cursor: default; }

/* --- 이동 후 목적지 강조 --- */
.todo-card.is-flash { animation: worker-flash 1.6s ease-out 1; }
.msg-row.is-flash .bubble { animation: worker-flash 1.6s ease-out 1; }

/* --- 좌표 확인용 격자 (?office-grid=1) --- */
.woff-grid { position: absolute; inset: 0; z-index: 6; pointer-events: none; display: none; }
.hero-scene.is-grid .woff-grid { display: block; }
.woff-grid i { position: absolute; background: rgba(200, 40, 40, .26); }
.woff-grid i.is-thin { background: rgba(0, 80, 255, .18); }
.woff-grid i.v { top: 0; bottom: 0; width: 1px; }
.woff-grid i.h { left: 0; right: 0; height: 1px; }
.woff-grid u {
  position: absolute; width: 10px; height: 10px; margin: -5px 0 0 -5px;
  border: 1.5px solid #d33; border-radius: 50%;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, .85);
}
.woff-grid u.s { border-color: #0a7a4f; }

/* --- 애니메이션 --- */
@keyframes worker-walk {
  0%, 100% { transform: translate(-.9px, 0); }
  25% { transform: translate(.9px, -1.4px); }
  50% { transform: translate(-.9px, 0); }
  75% { transform: translate(.9px, -1.4px); }
}
@keyframes worker-shadow-step {
  0%, 100% { transform: translate(-50%, -50%) scaleX(.95); }
  50% { transform: translate(-50%, -50%) scaleX(1.05); }
}
@keyframes worker-type {
  0%, 58%, 100% { translate: 0 0; }
  62% { translate: 0 -1.6px; }
  66% { translate: 0 0; }
  70% { translate: 0 -1.2px; }
  74% { translate: 0 0; }
  96% { translate: 0 .5px; }
}
@keyframes worker-breathe { 0%, 100% { translate: 0 0; } 50% { translate: 0 -1px; } }
@keyframes worker-stretch {
  0%, 90%, 100% { rotate: -3deg; }
  93% { rotate: -6.5deg; translate: 0 -1px; }
  96% { rotate: -1.5deg; }
}
@keyframes worker-sip {
  0%, 72%, 84%, 100% { opacity: 0; translate: 0 0; }
  76% { opacity: 1; translate: 0 -2px; }
  80% { opacity: 1; translate: 0 -1px; }
}
@keyframes worker-settle {
  0% { translate: 0 0; scale: 1.04 .94; }
  55% { translate: 0 -1px; scale: 1 1; }
  100% { translate: 0 0; scale: 1 1; }
}
@keyframes worker-flash {
  0% { box-shadow: 0 0 0 0 rgba(47, 111, 85, .55); }
  35% { box-shadow: 0 0 0 3px rgba(47, 111, 85, .55); }
  100% { box-shadow: 0 0 0 3px rgba(47, 111, 85, 0); }
}
@keyframes worker-pop {
  0% { transform: translateX(-50%) translateY(3px) scale(.94); }
  100% { transform: translateX(-50%) translateY(0) scale(1); }
}

/* --- 움직임 최소화 --- */
@media (prefers-reduced-motion: reduce) {
  .worker, .worker-ground, .worker-bob, .worker-lean, .worker-motion, .worker-name {
    transition: none !important; animation: none !important;
  }
  .worker.is-press, .worker.is-bounce { scale: 1 !important; }
  .worker-bubble { transition: none; }
}

/* =========================================================
   🔔 자체 알림 (알림 설정 버튼 + 새 글 토스트)
   - app.js 의 알림 기능이 쓰는 스타일. 외부 리소스·인라인 스타일 없음.
   ========================================================= */

.header-right { display: flex; align-items: center; gap: 6px; }

.notify-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 30px;
  padding: 0 11px 0 9px;
  border-radius: 999px;
  background: var(--card);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
  color: var(--ink-2);
  font-size: 11.5px;
  font-weight: 700;
  white-space: nowrap;
  transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}

.notify-btn:hover { border-color: #dbd1bf; }
.notify-btn:active { transform: translateY(0.5px); }
.notify-btn .notify-icon { font-size: 12.5px; line-height: 1; }

.notify-btn[data-mode="all"] { background: var(--green-soft); border-color: var(--green-line); color: var(--green); }
.notify-btn[data-mode="call"] { background: var(--beige-soft); border-color: #e8d8bd; color: #8a6420; }
.notify-btn[data-mode="mute"] { background: #f1ede5; border-color: var(--line); color: #8e897d; }

/* 새 글 토스트 (4초) — 헤더를 가리지 않게 그 아래에 내려온다 */
.notify-toast {
  position: fixed;
  top: calc(env(safe-area-inset-top) + 52px);
  left: 50%;
  transform: translate(-50%, -16px);
  z-index: 90;
  width: min(92vw, 380px);
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 10px 13px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.97);
  border: 1px solid var(--line);
  box-shadow: 0 12px 30px rgba(31, 77, 58, 0.18);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s ease, transform 0.22s ease;
}

.notify-toast.is-on {
  opacity: 1;
  transform: translate(-50%, 0);
  pointer-events: auto;
  cursor: pointer;
}

.nt-head { display: flex; align-items: center; gap: 6px; }
.nt-bell { font-size: 12px; line-height: 1; }
.nt-title { font-size: 12px; font-weight: 800; color: var(--ink); letter-spacing: -0.2px; }
.nt-body {
  font-size: 12px;
  line-height: 1.45;
  color: var(--ink-2);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

@media (max-width: 430px) {
  .notify-btn { padding: 0 8px; }
  .notify-label { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .notify-btn, .notify-toast { transition: none; }
}

/* =========================================================
   🧠 공유 기억 & 현황 (5번째 탭)
   - ① 역할·시간표(표) ② 진행 업무(카드 줄) ③ 공유 기억(목록)
   - 새 색을 만들지 않고 기존 토큰(--card/--line/--green/--violet…)과
     컴팩트 간격 토큰만 쓴다. 외부 리소스·인라인 스타일 없음.
   ========================================================= */

.mem-title {
  margin: 6px 2px 8px;
  font-size: 16px;
  font-weight: 800;
  letter-spacing: -0.4px;
}

/* --- 기록 범위 안내 (항상 상단 고정) --- */
.mem-privacy {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 8px 11px;
  border-radius: var(--radius-sm);
  background: var(--violet-soft);
  border: 1px solid #dcdaf6;
  color: #4c4f9f;
  font-size: 11px;
  line-height: 1.5;
}

.mem-privacy p { margin: 0; }
.mem-privacy strong { display: block; font-weight: 800; color: #3f4289; margin-bottom: 1px; }
.mem-privacy-icon { font-size: 12px; line-height: 1.3; flex: 0 0 auto; }

/* --- DB 준비 안내 --- */
.mem-setup {
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: #fdf5e7;
  border: 1px solid #f0dcbb;
  color: #7d6535;
  font-size: 11px;
  line-height: 1.55;
}

.mem-setup strong { display: block; font-size: 11.5px; font-weight: 800; color: #6d5628; margin-bottom: 2px; }
.mem-setup p { margin: 0; }
.mem-setup code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 10.5px;
  background: #fff;
  border: 1px solid #f0dcbb;
  border-radius: 5px;
  padding: 0 4px;
}

/* --- ① 역할·시간표 --- */
.mem-table-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.mem-table { width: 100%; border-collapse: collapse; font-size: 11.5px; }

.mem-table thead th {
  text-align: left;
  padding: 6px 10px;
  background: var(--card-soft);
  border-bottom: 1px solid var(--line);
  font-size: 10px;
  font-weight: 800;
  color: var(--muted);
  white-space: nowrap;
}

.mem-table td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--line-soft);
  vertical-align: top;
  color: var(--ink-2);
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.mem-table tr:last-child td { border-bottom: 0; }

.mem-name {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 800;
  color: var(--ink);
  white-space: nowrap;
}

.mem-name img { width: 22px; height: 22px; border-radius: 50%; object-fit: cover; flex: 0 0 auto; }
.mem-name .mem-name-fallback {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--green-soft);
  color: var(--green);
  font-size: 10px;
  font-weight: 800;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
}

.mem-sched { color: var(--green-600); font-weight: 700; font-variant-numeric: tabular-nums; }
.mem-td-role { min-width: 110px; }
.mem-td-memo { color: var(--muted); font-size: 11px; }
.mem-td-act { text-align: right; white-space: nowrap; }

.mem-row-btn {
  font-size: 10.5px;
  font-weight: 800;
  color: var(--green-600);
  background: var(--green-soft);
  border: 1px solid var(--green-line);
  border-radius: 999px;
  padding: 3px 9px;
  white-space: nowrap;
}

.mem-row-btn:hover { background: #dcebe1; }

.mem-row-btn.is-danger {
  color: var(--danger);
  background: #fdf1ef;
  border-color: #f0cdc9;
}

.mem-row-btn + .mem-row-btn { margin-left: 3px; }

/* --- 공통: 추가 버튼 · 안내문 · 빈 상태 --- */
.mem-add {
  width: 100%;
  margin-top: 8px;
  padding: 8px 12px;
  border-radius: 10px;
  border: 1px dashed var(--line);
  background: var(--card);
  color: var(--ink-2);
  font-size: 12px;
  font-weight: 800;
}

.mem-add:hover { border-color: var(--green-line); color: var(--green); }

.mem-add.is-primary {
  border-style: solid;
  border-color: var(--green-line);
  background: var(--green-soft);
  color: var(--green);
}

.mem-hint {
  margin: 6px 2px 0;
  font-size: 10.5px;
  line-height: 1.55;
  color: var(--muted);
}

.mem-hint b { color: var(--ink-2); }

.mem-empty {
  margin: 8px 0 0;
  padding: 12px;
  border-radius: var(--radius-sm);
  border: 1px dashed var(--line);
  background: var(--card-soft);
  color: var(--muted);
  font-size: 11px;
  line-height: 1.55;
}

.mem-empty b { color: var(--ink-2); }

/* --- ② 진행 업무 --- */
.prog-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 7px; }

.prog-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 8px;
  align-items: start;
  padding: 9px 10px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}

.prog-card.is-mine { border-color: var(--green-line); background: linear-gradient(180deg, #f7fbf8 0%, #ffffff 70%); }

.prog-avatar { width: 30px; height: 30px; border-radius: 50%; object-fit: cover; flex: 0 0 auto; }

.prog-main { min-width: 0; }

.prog-head { display: flex; align-items: center; gap: 5px; flex-wrap: wrap; }
.prog-name { font-size: 12.5px; font-weight: 800; letter-spacing: -0.2px; }

.prog-mine {
  font-size: 9.5px;
  font-weight: 800;
  color: var(--green);
  background: var(--green-soft);
  border: 1px solid var(--green-line);
  border-radius: 999px;
  padding: 1px 6px;
}

.prog-summary {
  margin: 3px 0 0;
  font-size: 11.5px;
  line-height: 1.45;
  color: var(--ink-2);
  overflow-wrap: anywhere;
}

.prog-summary.is-empty { color: var(--muted); }

.prog-meta {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
  margin-top: 5px;
  font-size: 10px;
  color: var(--muted);
}

.prog-pill { font-size: 9.5px; font-weight: 800; padding: 2px 7px; border-radius: 999px; white-space: nowrap; }
.prog-pill.st-running { background: var(--green-soft); color: var(--green); }
.prog-pill.st-wait { background: #f2eee6; color: #8b8578; }
.prog-pill.st-done { background: var(--violet-soft); color: #5558a8; }

.prog-src {
  font-size: 9.5px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 999px;
  background: var(--beige-soft);
  color: #8a6420;
  white-space: nowrap;
}

.prog-src.src-app { background: #eef2f6; color: #4f6675; }

.prog-side { display: flex; flex-direction: column; align-items: flex-end; gap: 5px; }
.prog-ago { font-size: 9.5px; color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }

/* --- ③ 공유 기억 --- */
.mem-chips { padding: 0 0 6px; }

.mem-list { list-style: none; margin: 6px 0 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }

.mem-item {
  padding: 10px 11px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}

.mem-item-head { display: flex; align-items: flex-start; gap: 6px; }

.mem-kind { font-size: 9.5px; font-weight: 800; padding: 2px 7px; border-radius: 999px; white-space: nowrap; flex: 0 0 auto; margin-top: 1px; }
.mem-kind.k-rule { background: var(--pink-soft); color: #b05572; }
.mem-kind.k-decision { background: var(--green-soft); color: var(--green); }
.mem-kind.k-note { background: #f2eee6; color: #8b8578; }

.mem-title-text {
  flex: 1 1 auto;
  min-width: 0;
  font-size: 12.5px;
  font-weight: 800;
  letter-spacing: -0.2px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.mem-actions { display: flex; gap: 4px; flex: 0 0 auto; }

.mem-body {
  margin: 6px 0 0;
  font-size: 11.5px;
  line-height: 1.6;
  color: var(--ink-2);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.mem-foot {
  margin-top: 6px;
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
  align-items: center;
  font-size: 10px;
  color: var(--muted);
}

.mem-foot b { color: var(--ink-2); font-weight: 700; }
.mem-foot .dot-sep { color: #cfc7b8; }

/* --- 입력 폼 (역할·진행·기억 공통) --- */
.mem-form {
  margin-top: 8px;
  padding: 11px;
  background: var(--card);
  border: 1px solid var(--green-line);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}

.mem-form-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.mem-form-head strong { font-size: 12.5px; font-weight: 800; letter-spacing: -0.2px; }

.mem-x {
  width: 24px;
  height: 24px;
  border-radius: 8px;
  background: #f4efe6;
  color: var(--ink-2);
  font-size: 11px;
  line-height: 1;
}

.mem-field { display: block; margin-bottom: 7px; }
.mem-field > span { display: block; font-size: 10.5px; font-weight: 800; color: var(--ink-2); margin-bottom: 3px; }

.mem-field input,
.mem-field select,
.mem-field textarea {
  width: 100%;
  padding: 7px 9px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--card-soft);
  font-size: 12.5px;
  color: var(--ink);
}

.mem-field textarea { resize: vertical; line-height: 1.5; min-height: 52px; }

.mem-field input:focus,
.mem-field select:focus,
.mem-field textarea:focus {
  outline: none;
  background: #fff;
  border-color: var(--green-line);
  box-shadow: 0 0 0 3px rgba(31, 77, 58, 0.07);
}

.mem-field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }

.mem-form-actions { display: flex; gap: 6px; justify-content: flex-end; margin-top: 4px; }

.mem-btn { padding: 7px 14px; border-radius: 9px; background: #f2ede4; color: var(--ink-2); font-size: 12px; font-weight: 800; }
.mem-btn.is-primary { background: var(--green); color: #fdf8ec; }
.mem-btn:disabled { opacity: 0.6; cursor: not-allowed; }

/* --- 좁은 화면: 역할표를 카드처럼 세로로 쌓는다 (가로스크롤 없음) --- */
@media (max-width: 620px) {
  .mem-table-card { background: transparent; border: 0; box-shadow: none; overflow: visible; }
  .mem-table, .mem-table tbody, .mem-table tr, .mem-table td { display: block; width: 100%; }
  .mem-table thead { display: none; }

  .mem-table tr {
    margin-bottom: 7px;
    padding: 8px 10px;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
  }

  .mem-table td { display: flex; gap: 7px; padding: 2px 0; border: 0; }

  .mem-table td::before {
    content: attr(data-label);
    flex: 0 0 46px;
    padding-top: 1px;
    font-size: 10px;
    font-weight: 800;
    color: var(--muted);
  }

  .mem-table td.mem-td-name::before { content: none; }
  .mem-table td.mem-td-name { padding-bottom: 4px; }
  .mem-table td.mem-td-act { justify-content: flex-end; padding-top: 6px; }
  .mem-table td.mem-td-act::before { content: none; }
  .mem-td-role { min-width: 0; }
}

/* 5탭이 좁은 폭에서도 한 줄에 눌리게 (가로스크롤 없음) */
@media (max-width: 430px) {
  .tab-btn { font-size: 9.5px; letter-spacing: -0.4px; padding: 3px 1px 2px; }
  .tab-btn svg { width: 18px; height: 18px; }
  .mem-field-row { grid-template-columns: 1fr; }
  .prog-side { align-items: center; }
  .prog-card { padding: 8px 9px; }
  .prog-avatar { width: 27px; height: 27px; }
}

/* =========================================================
   두 빌딩 (비서실 + 경영지원팀) — 2026-12-03
   - 위쪽 빌딩 전환 · 방 칩 · 의장/부의장 · 승인함 · 멤버/토큰
   - 기존 6인 오피스 스타일은 그대로 두고 이 블록만 덧붙인다.
   ========================================================= */

:root {
  --navy: #2f4a72;
  --navy-600: #24395a;
  --navy-soft: #e9eef7;
  --navy-line: #c7d3e6;
}

/* ---- 빌딩 전환 ---- */
.building-bar {
  flex: 0 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  padding: 2px 14px 6px;
}

.building-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  padding: 6px 10px;
  border-radius: 12px;
  background: var(--card);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
  text-align: left;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.building-ico {
  flex: 0 0 auto;
  width: 27px;
  height: 27px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  background: var(--green-soft);
  font-size: 14px;
}

.building-txt { display: flex; flex-direction: column; min-width: 0; line-height: 1.15; }
.building-name { font-size: 12.5px; font-weight: 800; letter-spacing: -0.3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.building-sub { margin-top: 1px; font-size: 9.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.building-btn[data-building="secretariat"].is-active { background: var(--green); border-color: var(--green); color: #fdf8ec; }
.building-btn[data-building="management"].is-active { background: var(--navy); border-color: var(--navy); color: #f7f9fd; }
.building-btn[data-building="management"] .building-ico { background: var(--navy-soft); }
.building-btn.is-active .building-ico { background: rgba(255, 255, 255, 0.18); }
.building-btn.is-active .building-sub { color: rgba(255, 255, 255, 0.74); }

/* ---- 방 칩 ---- */
.room-bar {
  flex: 0 0 auto;
  display: flex;
  gap: 6px;
  padding: 6px 14px 3px;
  overflow-x: auto;
  scrollbar-width: none;
}
.room-bar::-webkit-scrollbar { display: none; }

.room-chip {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 10px;
  border-radius: 999px;
  background: var(--card);
  border: 1px solid var(--line);
  color: var(--ink-2);
  font-size: 11.5px;
  font-weight: 700;
  white-space: nowrap;
}

.room-chip.is-active { background: var(--green); border-color: var(--green); color: #fdf8ec; }
.room-chip[data-building="management"].is-active { background: var(--navy); border-color: var(--navy); }
.room-ico { font-size: 12px; }
.room-lock { font-size: 9px; opacity: 0.85; }

.room-desc {
  flex: 0 0 auto;
  margin: 0;
  padding: 0 16px 3px;
  font-size: 10px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ---- 의장·부의장 바 ---- */
.mgmt-bar {
  flex: 0 0 auto;
  display: flex;
  align-items: stretch;
  gap: 6px;
  padding: 0 14px 6px;
}

.presi-card {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
  padding: 5px 9px;
  border-radius: 11px;
  background: var(--card);
  border: 1px solid var(--line);
  border-left: 3px solid var(--amber);
  box-shadow: var(--shadow-sm);
}
.presi-card.vice { border-left-color: var(--navy); }
.presi-label { font-size: 9px; font-weight: 800; color: var(--muted); letter-spacing: 0.2px; }
.presi-card strong { font-size: 12.5px; letter-spacing: -0.3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.presi-meta { font-size: 9px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.presi-btn {
  flex: 0 0 auto;
  align-self: center;
  padding: 7px 9px;
  border-radius: 9px;
  background: var(--card);
  border: 1px solid var(--line);
  color: var(--ink-2);
  font-size: 10px;
  font-weight: 800;
  box-shadow: var(--shadow-sm);
}

/* ---- 경영지원팀 탭바 ---- */
.tabbar-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.tab-badge {
  min-width: 15px;
  margin-top: 1px;
  padding: 0 4px;
  border-radius: 999px;
  background: var(--danger);
  color: #fff;
  font-size: 8.5px;
  line-height: 15px;
  text-align: center;
}

/* ---- 공통 안내 ---- */
.mgmt-hint {
  margin: 0 2px 10px;
  padding: 8px 10px;
  border-radius: 10px;
  background: var(--card-soft);
  border: 1px solid var(--line-soft);
  color: var(--ink-2);
  font-size: 11px;
  line-height: 1.5;
}

.mgmt-empty {
  padding: 20px 12px;
  border: 1px dashed var(--line);
  border-radius: 12px;
  background: var(--card-soft);
  color: var(--muted);
  font-size: 11.5px;
  text-align: center;
}
.mgmt-empty strong { display: block; margin-bottom: 3px; color: var(--ink-2); font-size: 12.5px; }

/* ---- 승인함 ---- */
.appr-list { display: flex; flex-direction: column; gap: 8px; }

.appr-card {
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--amber);
  border-radius: 12px;
  background: var(--card);
  box-shadow: var(--shadow-sm);
}
.appr-card.kind-settled { border-left-color: var(--navy); }

.appr-head { display: flex; align-items: center; gap: 6px; font-size: 10px; color: var(--muted); }
.appr-kind { padding: 1px 6px; border-radius: 999px; font-weight: 800; }
.appr-kind.ask { background: var(--amber-soft); color: var(--amber); }
.appr-kind.settled { background: var(--navy-soft); color: var(--navy); }
.appr-room { font-weight: 700; color: var(--ink-2); }
.appr-time { margin-left: auto; }

.appr-title { margin: 6px 0 3px; font-size: 13px; letter-spacing: -0.2px; }
.appr-body {
  margin: 0 0 8px;
  max-height: 8.5em;
  overflow: auto;
  color: var(--ink-2);
  font-size: 11.5px;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
}

.appr-note {
  width: 100%;
  margin-bottom: 6px;
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--card-soft);
  font-size: 11.5px;
}

.appr-actions { display: flex; gap: 6px; }
.appr-btn { flex: 1; padding: 8px; border-radius: 9px; font-size: 12px; font-weight: 800; }
.appr-btn.approve { background: var(--green); color: #fdf8ec; }
.appr-btn.reject { background: #f7ece9; color: var(--danger); }

.appr-history { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.appr-hist {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 9px;
  border: 1px solid var(--line-soft);
  border-radius: 9px;
  background: var(--card);
  font-size: 11px;
}
.appr-status { flex: 0 0 auto; padding: 1px 6px; border-radius: 999px; font-size: 9.5px; font-weight: 800; }
.appr-status.approved { background: var(--green-soft); color: var(--green-600); }
.appr-status.rejected { background: #f7ece9; color: var(--danger); }
.appr-hist-title { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 700; }
.appr-hist-meta { flex: 0 0 auto; color: var(--muted); font-size: 9.5px; white-space: nowrap; }

/* ---- 멤버 · 토큰 ---- */
.mgmt-members { display: flex; flex-direction: column; gap: 12px; }

.mm-group { background: var(--card); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.mm-group-head { padding: 9px 12px; background: var(--card-soft); border-bottom: 1px solid var(--line-soft); }
.mm-group-title { margin: 0; font-size: 12.5px; }
.mm-group-note { display: block; margin-top: 1px; color: var(--muted); font-size: 9.5px; }

.mm-row { display: flex; align-items: flex-start; gap: 8px; padding: 9px 12px; border-bottom: 1px solid var(--line-soft); }
.mm-row:last-child { border-bottom: 0; }
.mm-row.is-off { opacity: 0.55; }

.mm-avatar { flex: 0 0 auto; width: 36px; height: 36px; border-radius: 50%; object-fit: cover; background: var(--card-soft); }
.mm-initial { display: grid; place-items: center; background: var(--green-soft); color: var(--green); font-size: 13px; font-weight: 800; }

.mm-main { flex: 1 1 auto; min-width: 0; }
.mm-top { display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; }
.mm-name { font-size: 12.5px; }
.mm-role { color: var(--muted); font-size: 9.5px; }
.mm-rooms { display: flex; flex-wrap: wrap; gap: 3px; margin-top: 3px; }
.mm-room { padding: 1px 4px; border: 1px solid var(--line-soft); border-radius: 5px; background: var(--bg); color: var(--ink-2); font-size: 9px; }
.mm-room.muted { color: var(--muted); }

.mm-side { flex: 0 0 auto; display: flex; flex-direction: column; align-items: flex-end; gap: 5px; }
.mm-usage { color: var(--muted); font-size: 9px; }
.mm-token { display: flex; align-items: center; justify-content: flex-end; gap: 4px; flex-wrap: wrap; }
.mm-token-state { color: var(--muted); font-size: 8.5px; }
.mm-token-state.on { color: var(--green-600); font-weight: 700; }
.mm-mini { padding: 4px 6px; border: 1px solid var(--line); border-radius: 6px; background: var(--card-soft); font-size: 9px; font-weight: 800; }
.mm-mini.primary { background: var(--green); border-color: var(--green); color: #fdf8ec; }
.mm-mini.danger { color: var(--danger); }

.switch { position: relative; display: inline-block; flex: 0 0 auto; width: 34px; height: 20px; }
.switch input { position: absolute; width: 0; height: 0; opacity: 0; }
.slider { position: absolute; inset: 0; border-radius: 999px; background: #d9d2c6; transition: background 0.15s ease; }
.slider::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 2px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
  transition: transform 0.15s ease;
}
.switch input:checked + .slider { background: var(--green); }
.switch input:checked + .slider::before { transform: translateX(14px); }
.switch input:focus-visible + .slider { outline: 2px solid var(--green-600); outline-offset: 2px; }

/* ---- 토큰 공개 상자 ---- */
.token-reveal { margin-bottom: 12px; padding: 10px 12px; border-radius: 12px; background: #1f2e26; color: #f4f1e8; }
.token-reveal-head { display: flex; align-items: baseline; gap: 6px; font-size: 10.5px; }
.token-reveal-head strong { color: #fff; font-size: 12.5px; }
.token-reveal-head span { color: #b9c4bc; font-size: 9.5px; }
.token-reveal-head .mem-x { margin-left: auto; color: #cfd8d1; }
.token-value {
  display: block;
  margin: 8px 0;
  padding: 8px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11.5px;
  line-height: 1.4;
  word-break: break-all;
}
.token-reveal-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.token-warn { color: #b9c4bc; font-size: 9.5px; }
.mgmt-btn { padding: 7px 10px; border-radius: 8px; background: #fff; color: #1f2e26; font-size: 11px; font-weight: 800; }
.mgmt-btn.is-primary { background: var(--green); color: #fff; }

/* ---- 메시지 보조 ---- */
.msg-row.is-system { justify-content: center; }
.sys-note {
  max-width: 88%;
  margin: 2px auto;
  padding: 7px 12px;
  border: 1px solid var(--green-line);
  border-radius: 999px;
  background: var(--green-soft);
  color: var(--green-600);
  font-size: 11px;
  line-height: 1.45;
  text-align: center;
}
.msg-row.is-reply { padding-left: 22px; }
.ai-chip { margin-left: 2px; padding: 0 4px; border-radius: 4px; background: var(--navy-soft); color: var(--navy); font-size: 8.5px; font-weight: 800; }

.composer-sender-static { color: var(--ink); font-size: 11.5px; font-weight: 800; }
.composer-sub { color: var(--muted); font-weight: 600; }

/* ---- 로그인 설정 안내 ---- */
.login-setup {
  margin-top: 10px;
  padding: 9px 10px;
  border: 1px solid #ecd9b6;
  border-radius: 10px;
  background: #fdf3e3;
  color: #7a5a22;
  font-size: 11px;
  line-height: 1.5;
  text-align: left;
}
.login-setup strong { display: block; margin-bottom: 2px; }
.login-setup p { margin: 0; }
.login-setup code { padding: 0 3px; border-radius: 3px; background: #fff; font-size: 10px; }

@media (min-width: 760px) {
  .building-bar { max-width: 900px; margin: 0 auto; padding: 2px 16px 6px; }
  .mgmt-bar { max-width: 900px; margin: 0 auto; padding: 0 16px 6px; }
  .tabbar.tabbar-3 { grid-template-columns: repeat(3, minmax(0, 210px)); justify-content: center; }
  .room-bar { padding-left: max(16px, calc((100% - 900px) / 2)); padding-right: max(16px, calc((100% - 900px) / 2)); }
  .room-desc { padding-left: max(18px, calc((100% - 900px) / 2)); padding-right: max(18px, calc((100% - 900px) / 2)); }
  .appr-body { font-size: 12px; }
}

@media (max-width: 359px) {
  .building-sub { display: none; }
  .presi-meta { display: none; }
}

/* =========================================================
   두 빌딩 통합본 — 2026-12-03 추가 블록
   · 빌딩 전환 · 6탭 · 대기함 · 승인함 · 조직도 · AI 스위치 · 토큰
   · 카톡형 말풍선 보조(답글·더보기) · 방 칩 · 의장 카드
   기존 6인 오피스/공유기억 스타일은 그대로 두고 이 블록만 덧붙인다.
   ========================================================= */

:root {
  --navy: #2f4a72;
  --navy-soft: #e9eef7;
  --navy-line: #c7d3e6;
}

/* ---- 6탭 ---- */
.tabbar { grid-template-columns: repeat(6, minmax(0, 1fr)); }

@media (max-width: 430px) {
  .tab-btn { font-size: 9px; letter-spacing: -0.5px; padding: 3px 0 2px; }
  .tab-btn svg { width: 18px; height: 18px; }
}

/* ---- 빌딩 전환 ---- */
.building-bar {
  flex: 0 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  padding: 2px 14px 6px;
}

.building-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  padding: 6px 10px;
  border-radius: 12px;
  background: var(--card);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
  text-align: left;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.bb-icon {
  flex: 0 0 auto;
  width: 27px;
  height: 27px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  background: var(--green-soft);
  font-size: 14px;
}

.bb-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.15; }
.bb-text strong { font-size: 12.5px; font-weight: 800; letter-spacing: -0.3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bb-text small { margin-top: 1px; color: var(--muted); font-size: 9.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.building-btn[data-building="secretariat"].is-active { background: var(--green); border-color: var(--green); color: #fdf8ec; }
.building-btn[data-building="management"].is-active { background: var(--navy); border-color: var(--navy); color: #f7f9fd; }
.building-btn[data-building="management"] .bb-icon { background: var(--navy-soft); }
.building-btn.is-active .bb-icon { background: rgba(255, 255, 255, 0.2); }
.building-btn.is-active .bb-text small { color: rgba(255, 255, 255, 0.76); }

/* ---- 방 칩 · 설명 ---- */
.room-bar {
  flex: 0 0 auto;
  display: flex;
  gap: 6px;
  padding: 6px 14px 3px;
  overflow-x: auto;
  scrollbar-width: none;
}
.room-bar::-webkit-scrollbar { display: none; }

.room-chip {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 10px;
  border-radius: 999px;
  background: var(--card);
  border: 1px solid var(--line);
  color: var(--ink-2);
  font-size: 11.5px;
  font-weight: 700;
  white-space: nowrap;
}
.room-chip.is-active { background: var(--green); border-color: var(--green); color: #fdf8ec; }
body[data-building="management"] .room-chip.is-active { background: var(--navy); border-color: var(--navy); }
.room-ico { font-size: 12px; }
.room-lock { font-size: 9px; opacity: 0.85; }

.room-desc {
  flex: 0 0 auto;
  margin: 0;
  padding: 0 16px 3px;
  color: var(--muted);
  font-size: 10px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ---- 의장·부의장 카드 ---- */
.presidium-card {
  display: flex;
  align-items: stretch;
  gap: 8px;
  margin: 2px 0 14px;
  padding: 10px 12px;
  border-radius: 14px;
  background: var(--card);
  border: 1px solid var(--line);
  border-left: 4px solid var(--amber);
  box-shadow: var(--shadow-sm);
}
.presi-col { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.presi-label { font-size: 9px; font-weight: 800; color: var(--muted); letter-spacing: 0.2px; }
.presi-col strong { font-size: 14px; letter-spacing: -0.3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.presi-meta { font-size: 9.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.presi-divider { width: 1px; background: var(--line); }
.presi-btn {
  flex: 0 0 auto;
  align-self: center;
  padding: 7px 9px;
  border-radius: 9px;
  background: var(--card-soft);
  border: 1px solid var(--line);
  color: var(--ink-2);
  font-size: 10px;
  font-weight: 800;
}

/* ---- 부서 격자 (오피스 · 조직도) ---- */
.dept-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }

.dept-card {
  min-width: 0;
  padding: 9px 10px;
  border-radius: 13px;
  background: var(--card);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
}
.dept-head { display: flex; align-items: baseline; justify-content: space-between; gap: 6px; margin-bottom: 5px; }
.dept-head h3 { margin: 0; font-size: 12px; letter-spacing: -0.3px; }
.dept-count { color: var(--muted); font-size: 9.5px; font-weight: 700; }
.dept-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 3px; }
.dept-member { display: flex; align-items: center; gap: 5px; min-width: 0; font-size: 11px; color: var(--muted); }
.dept-dot { flex: 0 0 auto; width: 6px; height: 6px; border-radius: 50%; background: #cfc7b9; }
.dept-member.is-on { color: var(--ink); }
.dept-member.is-on .dept-dot { background: #2e9e6b; box-shadow: 0 0 0 2px rgba(46, 158, 107, 0.16); }
.dept-member.is-owner { color: var(--green); font-weight: 800; }
.dept-member.is-owner .dept-dot { background: var(--green); }
.dept-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dept-tag { flex: 0 0 auto; padding: 0 4px; border-radius: 999px; background: var(--amber-soft); color: var(--amber); font-size: 8px; font-weight: 800; }

/* ---- 안내문·빈 상태 ---- */
.list-hint {
  margin: 0 0 10px;
  padding: 8px 10px;
  border-radius: 10px;
  background: var(--card-soft);
  border: 1px solid var(--line-soft);
  color: var(--ink-2);
  font-size: 11px;
  line-height: 1.5;
}
.mgmt-empty {
  padding: 20px 12px;
  border: 1px dashed var(--line);
  border-radius: 12px;
  background: var(--card-soft);
  color: var(--muted);
  font-size: 11.5px;
  text-align: center;
  line-height: 1.5;
}
.mgmt-empty strong { display: block; margin-bottom: 3px; color: var(--ink-2); font-size: 12.5px; }

/* ---- 대기함 ---- */
.inbox-list { display: flex; flex-direction: column; gap: 8px; }
.inbox-card {
  padding: 10px 12px;
  border-radius: 13px;
  background: var(--card);
  border: 1px solid var(--line);
  border-left: 4px solid var(--green);
  box-shadow: var(--shadow-sm);
}
.inbox-head { display: flex; align-items: center; gap: 6px; font-size: 10px; color: var(--muted); }
.inbox-building { font-weight: 800; color: var(--ink-2); }
.inbox-room { padding: 1px 6px; border-radius: 999px; background: var(--green-soft); color: var(--green-600); font-weight: 800; }
.inbox-flag { padding: 1px 6px; border-radius: 999px; background: var(--amber-soft); color: var(--amber); font-weight: 800; }
.inbox-time { margin-left: auto; }
.inbox-body { margin: 6px 0 8px; color: var(--ink-2); font-size: 12px; line-height: 1.5; word-break: break-word; }
.inbox-foot { display: flex; align-items: center; gap: 8px; }
.inbox-count { color: var(--muted); font-size: 10px; }
.inbox-go {
  margin-left: auto;
  padding: 6px 12px;
  border-radius: 9px;
  background: var(--green);
  color: #fdf8ec;
  font-size: 11.5px;
  font-weight: 800;
}

/* ---- 승인함 ---- */
.approval-list { display: flex; flex-direction: column; gap: 8px; }
.appr-card {
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--amber);
  border-radius: 13px;
  background: var(--card);
  box-shadow: var(--shadow-sm);
}
.appr-card.kind-settled { border-left-color: var(--navy); }
.appr-head { display: flex; align-items: center; gap: 6px; font-size: 10px; color: var(--muted); }
.appr-kind { padding: 1px 6px; border-radius: 999px; font-weight: 800; }
.appr-kind.ask { background: var(--amber-soft); color: var(--amber); }
.appr-kind.settled { background: var(--navy-soft); color: var(--navy); }
.appr-room { font-weight: 700; color: var(--ink-2); }
.appr-time { margin-left: auto; }
.appr-title { margin: 6px 0 3px; font-size: 13px; letter-spacing: -0.2px; }
.appr-body {
  margin: 0 0 8px;
  max-height: 8.5em;
  overflow: auto;
  color: var(--ink-2);
  font-size: 11.5px;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
}
.appr-note { width: 100%; margin-bottom: 6px; padding: 6px 8px; border: 1px solid var(--line); border-radius: 8px; background: var(--card-soft); font-size: 11.5px; }
.appr-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.appr-btn { flex: 1 1 0; min-width: 54px; padding: 8px 6px; border-radius: 9px; font-size: 12px; font-weight: 800; background: var(--card-soft); border: 1px solid var(--line); }
.appr-btn.approve { background: var(--green); border-color: var(--green); color: #fdf8ec; }
.appr-btn.reject { background: #f7ece9; border-color: #f0d8d2; color: var(--danger); }
.appr-btn.choice { background: var(--navy-soft); border-color: var(--navy-line); color: var(--navy); }

.history-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.appr-hist {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 9px;
  border: 1px solid var(--line-soft);
  border-radius: 9px;
  background: var(--card);
  font-size: 11px;
}
.appr-status { flex: 0 0 auto; padding: 1px 6px; border-radius: 999px; font-size: 9.5px; font-weight: 800; }
.appr-status.approved { background: var(--green-soft); color: var(--green-600); }
.appr-status.rejected { background: #f7ece9; color: var(--danger); }
.appr-hist-title { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 700; }
.appr-choice { flex: 0 0 auto; padding: 1px 5px; border-radius: 5px; background: var(--navy-soft); color: var(--navy); font-size: 9px; font-weight: 800; }
.appr-hist-meta { flex: 0 0 auto; color: var(--muted); font-size: 9.5px; white-space: nowrap; }

/* ---- 조직도 ---- */
.org-owner {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px;
  margin-bottom: 12px;
  border-radius: 14px;
  background: linear-gradient(180deg, #fdfaf3, #fff);
  border: 1px solid var(--green-line);
  box-shadow: var(--shadow-sm);
}
.org-owner-avatar {
  flex: 0 0 auto;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--green);
  color: #fdf8ec;
  font-size: 15px;
  font-weight: 800;
}
.org-owner-title { font-size: 13.5px; font-weight: 800; letter-spacing: -0.3px; }
.org-owner-sub { margin: 3px 0 0; color: var(--ink-2); font-size: 11px; line-height: 1.5; }
.org-chip { display: inline-block; margin-left: 3px; padding: 1px 6px; border-radius: 999px; background: var(--green-soft); color: var(--green-600); font-size: 9px; font-weight: 800; vertical-align: 1px; }
.org-chip.beige { background: var(--beige); color: var(--amber); }
.org-chip.amber { background: var(--amber-soft); color: var(--amber); }

.org-depts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.org-dept { padding: 9px 10px; border-radius: 13px; background: var(--card); border: 1px solid var(--line); }
.org-dept-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 5px; }
.org-dept-head strong { font-size: 12px; }
.org-dept-head span { color: var(--muted); font-size: 9.5px; }
.org-person { display: flex; align-items: center; gap: 5px; padding: 2px 0; font-size: 11px; }
.org-person-dot { flex: 0 0 auto; width: 6px; height: 6px; border-radius: 50%; background: #2e9e6b; }
.org-person.is-off { color: var(--muted); }
.org-person.is-off .org-person-dot { background: #cfc7b9; }
.org-person.is-owner { font-weight: 800; color: var(--green); }
.org-person-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---- AI 스위치 목록 ---- */
.agent-list { display: flex; flex-direction: column; gap: 6px; }
.agent-row {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 10px;
  border-radius: 12px;
  background: var(--card);
  border: 1px solid var(--line);
}
.agent-row.is-off { opacity: 0.6; }
.agent-avatar { flex: 0 0 auto; width: 34px; height: 34px; border-radius: 50%; object-fit: cover; background: var(--card-soft); }
.agent-initial { display: grid; place-items: center; background: var(--green-soft); color: var(--green); font-size: 13px; font-weight: 800; }
.agent-main { flex: 1 1 auto; min-width: 0; }
.agent-top { display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; }
.agent-top strong { font-size: 12.5px; }
.agent-dept { color: var(--muted); font-size: 9px; padding: 0 5px; border: 1px solid var(--line-soft); border-radius: 999px; }
.agent-role { margin: 1px 0 2px; color: var(--ink-2); font-size: 10.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.agent-meta { display: flex; gap: 8px; flex-wrap: wrap; color: var(--muted); font-size: 9px; }

/* ---- 스위치 ---- */
.switch { position: relative; display: inline-block; flex: 0 0 auto; width: 40px; height: 23px; }
.switch input { position: absolute; width: 0; height: 0; opacity: 0; }
.slider { position: absolute; inset: 0; border-radius: 999px; background: #d9d2c6; transition: background 0.15s ease; }
.slider::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 2px;
  width: 19px;
  height: 19px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
  transition: transform 0.15s ease;
}
.switch input:checked + .slider { background: #2e9e6b; }
.switch input:checked + .slider::before { transform: translateX(17px); }
.switch input:focus-visible + .slider { outline: 2px solid var(--green-600); outline-offset: 2px; }

/* ---- 토큰 ---- */
.token-panel { padding: 12px; border-radius: 14px; background: var(--card); border: 1px solid var(--line); }
.token-row { display: flex; gap: 6px; margin-bottom: 10px; }
.token-row select { flex: 1 1 auto; min-width: 0; padding: 8px; border: 1px solid var(--line); border-radius: 9px; background: var(--card-soft); font-size: 12px; }
.token-btn { flex: 0 0 auto; padding: 8px 11px; border-radius: 9px; background: var(--green); color: #fdf8ec; font-size: 11.5px; font-weight: 800; }
.token-btn.is-danger { background: #f7ece9; color: var(--danger); border: 1px solid #f0d8d2; }
.token-reveal { margin-bottom: 12px; padding: 10px 12px; border-radius: 12px; background: #1f2e26; color: #f4f1e8; }
.token-reveal-head { display: flex; align-items: baseline; gap: 6px; font-size: 10px; }
.token-reveal-head strong { color: #fff; font-size: 12.5px; }
.token-reveal-head span { color: #b9c4bc; font-size: 9.5px; }
.token-value {
  display: block;
  margin: 8px 0;
  padding: 8px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11.5px;
  line-height: 1.4;
  word-break: break-all;
}
.token-actions { display: flex; gap: 6px; }
.token-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.token-item { display: flex; align-items: center; gap: 6px; font-size: 10.5px; color: var(--ink-2); }
.token-item-name { font-weight: 800; }
.token-item-code { padding: 0 4px; border-radius: 4px; background: var(--bg); font-size: 9.5px; }
.token-item-date { margin-left: auto; color: var(--muted); font-size: 9px; }
.token-item-rev {
  flex: 0 0 auto;
  border: 1px solid #ead2d2;
  background: #fff7f7;
  color: #a34747;
  font-size: 9.5px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 6px;
  cursor: pointer;
}
.token-item-rev:hover { background: #fdecec; }
.token-empty { color: var(--muted); }

/* ---- 카톡형 말풍선 보조 ---- */
.msg-acts { display: flex; gap: 6px; margin-top: 3px; }
.msg-act { color: var(--muted); font-size: 9px; padding: 1px 3px; border-radius: 5px; }
.msg-act:hover { background: var(--line-soft); color: var(--ink-2); }
.msg-ago { margin-top: 2px; color: #b1b8b1; font-size: 8.5px; }
.msg-row.from-user .msg-block { align-items: flex-end; }

.quote {
  margin: 1px 0 4px;
  padding: 4px 7px;
  border-left: 3px solid var(--green-line);
  border-radius: 4px;
  background: rgba(31, 77, 58, 0.05);
  font-size: 10px;
  line-height: 1.35;
  max-width: 100%;
}
.quote-who { display: block; font-weight: 800; color: var(--green-600); font-size: 9px; }
.quote-text { display: block; color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.msg-row.is-system { justify-content: center; }
.sys-note {
  max-width: 88%;
  margin: 2px auto;
  padding: 7px 12px;
  border: 1px solid var(--green-line);
  border-radius: 999px;
  background: var(--green-soft);
  color: var(--green-600);
  font-size: 11px;
  line-height: 1.45;
  text-align: center;
}
.msg-row.is-reply { padding-left: 18px; }
.ai-chip { padding: 0 4px; border-radius: 4px; background: var(--navy-soft); color: var(--navy); font-size: 8.5px; font-weight: 800; }

.reply-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0 0 5px;
  padding: 5px 8px;
  border-radius: 9px;
  background: var(--green-soft);
  border: 1px solid var(--green-line);
  font-size: 10.5px;
}
.reply-who { flex: 0 0 auto; color: var(--green-600); font-weight: 800; }
.reply-text { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink-2); }
.reply-x { flex: 0 0 auto; color: var(--muted); font-size: 11px; }

/* ---- 공개 범위 배지 ---- */
.todo-vis, .mem-vis { padding: 0 5px; border-radius: 999px; font-size: 8.5px; font-weight: 800; }
.todo-vis.is-all, .mem-vis.is-all { background: var(--green-soft); color: var(--green-600); }
.todo-vis.is-secret, .mem-vis.is-secret { background: var(--beige); color: var(--amber); }

/* ---- 탭 배지 ---- */
.tab-badge {
  min-width: 15px;
  margin-top: 1px;
  padding: 0 4px;
  border-radius: 999px;
  background: var(--danger);
  color: #fff;
  font-size: 8.5px;
  line-height: 15px;
  text-align: center;
}

.tab-btn { position: relative; }
.tab-btn .tab-badge { position: absolute; top: 1px; right: 12%; }

/* ---- 큰 화면 ---- */
@media (min-width: 760px) {
  .building-bar { max-width: 900px; margin: 0 auto; padding: 2px 16px 6px; }
  .room-bar { padding-left: max(16px, calc((100% - 900px) / 2)); padding-right: max(16px, calc((100% - 900px) / 2)); }
  .room-desc { padding-left: max(18px, calc((100% - 900px) / 2)); padding-right: max(18px, calc((100% - 900px) / 2)); }
  .dept-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .org-depts { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .appr-body { font-size: 12px; }
}

@media (max-width: 359px) {
  .bb-text small { display: none; }
  .presi-meta { display: none; }
  .dept-grid, .org-depts { grid-template-columns: 1fr; }
}

/* ---- 데스크톱: 읽기 좋은 한 단(980px)으로 모으기 ---- */
@media (min-width: 760px) {
  .app-header { padding-left: max(16px, calc((100% - 980px) / 2)); padding-right: max(16px, calc((100% - 980px) / 2)); }
  .chat-toolbar { max-width: 980px; margin: 0 auto; width: 100%; }
  .chat-toolbar .chip-row { padding-left: 0; }
  .chat-toolbar .search-wrap { margin-right: 0; }
  .chat-list { padding-left: max(16px, calc((100% - 980px) / 2)); padding-right: max(16px, calc((100% - 980px) / 2)); }
  .msg-block { max-width: min(86%, 680px); }
  .composer { max-width: 980px; margin: 0 auto; width: 100%; }
  .room-bar, .room-desc { padding-left: max(16px, calc((100% - 980px) / 2)); padding-right: max(16px, calc((100% - 980px) / 2)); }
  .tabbar { grid-template-columns: repeat(6, minmax(0, 150px)); justify-content: center; }
}

/* ---- 방 바로가기 (경영지원팀 오피스) ---- */
.room-quick { display: grid; grid-template-columns: 1fr; gap: 8px; }
@media (min-width: 560px) { .room-quick { grid-template-columns: 1fr 1fr; } }
.room-card {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 11px 12px;
  border-radius: 13px;
  background: var(--card);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
  text-align: left;
}
.room-card-ico { flex: 0 0 auto; width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--navy-soft); font-size: 16px; }
.room-card-main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
.room-card-name { display: block; font-size: 12.5px; font-weight: 800; letter-spacing: -0.3px; }
.room-card-sub { display: block; margin-top: 1px; color: var(--muted); font-size: 9.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.room-card-go { flex: 0 0 auto; color: var(--navy); font-size: 10.5px; font-weight: 800; }

/* ---- DB 준비 안내 배너 ---- */
.setup-banner {
  flex: 0 0 auto;
  margin: 0 14px 6px;
  padding: 9px 11px;
  border-radius: 11px;
  background: #fdf3e3;
  border: 1px solid #ecd9b6;
  color: #7a5a22;
  font-size: 11px;
  line-height: 1.5;
}
.setup-banner strong { display: block; margin-bottom: 2px; font-size: 11.5px; }
.setup-banner code { padding: 0 3px; border-radius: 3px; background: #fff; font-size: 10px; }

/* ---- 작은 수정/삭제 버튼 (역할표·진행 업무·공유 기억) ---- */
.mem-mini {
  padding: 5px 10px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--card-soft);
  color: var(--ink-2);
  font-size: 10.5px;
  font-weight: 800;
  white-space: nowrap;
}
.mem-mini:hover { background: var(--green-soft); border-color: var(--green-line); }
.mem-mini.danger { color: var(--danger); border-color: #f0d8d2; background: #fdf6f4; }

@media (max-width: 620px) {
  .mem-table td.mem-td-act { justify-content: flex-end; }
  .mem-table td.mem-td-role { display: block; }
  .mem-table td.mem-td-role::before { content: none; }
}
