:root {
  --primary: #4f46e5;
  --primary-dark: #4338ca;
  --bg: #f5f6fa;
  --panel: #ffffff;
  --border: #e4e6ef;
  --text: #1f2430;
  --muted: #8a90a3;
  --danger: #e5484d;
  --green: #2f9e63;
  --amber: #d97706;
  --sidebar-w: 230px;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; height: 100%; }
body {
  font-family: 'Pretendard', 'Apple SD Gothic Neo', 'Malgun Gothic', sans-serif;
  background: var(--bg); color: var(--text); font-size: 14px;
}
a { color: var(--primary); text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; font-size: 14px; }

/* ---------- 공통 컴포넌트 ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 14px; border-radius: 8px; border: 1px solid var(--border);
  background: #fff; color: var(--text); font-size: 13px;
}
.btn:hover { background: #f3f4f8; }
.btn.primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn.primary:hover { background: var(--primary-dark); }
.btn.ok { color: var(--green); border-color: #bfe3cf; }
.btn.ok:hover { background: #effaf3; }

/* 태그 칩 */
.tag-chip {
  display: inline-block; padding: 4px 10px; margin: 3px 4px 3px 0;
  border: 1px solid var(--border); border-radius: 999px;
  background: #fff; color: var(--text); font-size: 12px; cursor: pointer;
}
.tag-chip:hover { border-color: var(--primary); color: var(--primary); }
.tag-chip.on { background: var(--primary); border-color: var(--primary); color: #fff; }
.tag-mini {
  display: inline-block; padding: 1px 7px; border-radius: 999px;
  background: #eef0fb; color: var(--primary-dark); font-size: 11px;
}
.btn.danger { color: var(--danger); border-color: #f3c6c7; }
.btn.danger:hover { background: #fdf0f0; }
.btn.sm { padding: 4px 10px; font-size: 12px; }
.input {
  width: 100%; padding: 9px 12px; border: 1px solid var(--border);
  border-radius: 8px; background: #fff; outline: none;
}
.input:focus { border-color: var(--primary); }
.card {
  background: var(--panel); border: 1px solid var(--border);
  border-radius: 12px; padding: 18px;
}
/* 시간기록 — 소요시간 칩 */
.dur-chip {
  display: inline-block; flex-shrink: 0;
  padding: 1px 8px; border-radius: 999px;
  background: #eef2ff; color: var(--primary-dark);
  font-size: 11px; font-weight: 700; white-space: nowrap;
}

/* 자동완성 드롭다운 */
.ac-wrap { position: relative; }
.ac-list {
  display: none; position: absolute; top: calc(100% + 4px); left: 0; right: 0; z-index: 50;
  background: var(--panel); border: 1px solid var(--border); border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0,0,0,.12); overflow: hidden; max-height: 240px; overflow-y: auto;
}
.ac-list.on { display: block; }
.ac-item { padding: 8px 12px; font-size: 13px; cursor: pointer; }
.ac-item:hover, .ac-item.sel { background: #eef2ff; color: var(--primary-dark); }

/* 근태 위젯 */
.att-row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.att-row label { font-size: 13px; color: var(--text); display: inline-flex; align-items: center; gap: 6px; }
.att-time { width: 120px; }
.att-num { width: 70px; text-align: right; }
.att-prog { margin-top: 12px; }
.att-bar { height: 9px; border-radius: 999px; background: #eef0f6; overflow: hidden; }
.att-fill { height: 100%; border-radius: 999px; background: var(--primary); transition: width .3s ease; }
.att-fill.full { background: var(--green); }

/* 자동 경고 */
.warn-chip {
  display: inline-block; flex-shrink: 0;
  padding: 1px 8px; border-radius: 999px;
  background: #fef3c7; color: #92400e;
  font-size: 11px; font-weight: 700; white-space: nowrap;
}
.att-warn { margin-top: 10px; display: flex; flex-direction: column; gap: 6px; }
.warn-line {
  font-size: 12px; padding: 8px 10px; border-radius: 8px;
  background: #fff7ed; border: 1px solid #fde2b8; color: #92580a;
}
.mng-sess.overlap { background: #fff7ed; border-radius: 7px; padding: 2px 6px; }
.edit-chip {
  display: inline-block; flex-shrink: 0; padding: 1px 8px; border-radius: 999px;
  background: #e0e7ff; color: #3730a3; font-size: 11px; font-weight: 700; white-space: nowrap;
}
.att-hist { margin: 8px 0; max-height: 160px; overflow-y: auto; }
.att-hist-row { font-size: 12px; padding: 6px 0; border-top: 1px solid var(--border); }
.att-hist-reason { color: var(--muted); font-size: 12px; margin-top: 2px; }
body.dark .edit-chip { background: #2b3350; color: #c3ccff; }
body.dark .warn-chip { background: #4a3a12; color: #fcd980; }
body.dark .warn-line { background: #2a2113; border-color: #4a3a12; color: #fcd980; }
body.dark .mng-sess.overlap { background: #2a2113; }

/* 러닝 타이머 칩 (사이드바 상단) */
.work-timer {
  display: flex; align-items: center; gap: 8px; width: calc(100% - 24px);
  margin: 2px 12px 10px; padding: 8px 12px; border-radius: 10px;
  border: 1px solid var(--border); background: var(--panel); color: var(--text);
  font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums;
  cursor: pointer; transition: background .15s, border-color .15s;
}
.work-timer:hover { border-color: var(--primary); }
.work-timer .wt-dot { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; background: var(--muted); }
.work-timer.working { border-color: #bfe3cf; background: #effaf3; color: #1d6b41; }
.work-timer.working .wt-dot { background: var(--green); animation: pulse 1.4s ease-in-out infinite; }
.work-timer.meal { border-color: #f5d8a8; background: #fff7ec; color: #92580a; }
.work-timer.meal .wt-dot { background: var(--amber); }
.work-timer.off .wt-dot { background: var(--muted); }
body.dark .work-timer.working { background: #16271d; }
body.dark .work-timer.meal { background: #2a2113; }

/* 사이드바 D-day 칩 (근무시간 아래) */
.side-dday {
  display: flex; align-items: center; gap: 8px; width: calc(100% - 24px);
  margin: 0 12px 10px; padding: 8px 12px; border-radius: 10px;
  border: 1px solid var(--border); background: var(--panel); color: var(--text);
  font-size: 13px; cursor: pointer; text-align: left;
  transition: border-color .15s;
}
.side-dday:hover { border-color: var(--primary); }
.side-dday .sd-badge {
  flex-shrink: 0; font-weight: 700; font-size: 11px; padding: 2px 7px;
  border-radius: 10px; background: #eef0ff; color: var(--primary);
}
.side-dday .sd-titles { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.side-dday .sd-title { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-dday.soon { border-color: #f5d8a8; }
.side-dday.soon .sd-badge { background: #fff3e0; color: #e65100; }
.ai-review-body { font-size: 13px; line-height: 1.7; }
.ai-review-body .ai-li { padding-left: 10px; }
.side-dday.today { border-color: #f0b9b3; }
.side-dday.today .sd-badge { background: #fdecea; color: #c62828; }
body.dark .side-dday .sd-badge { background: #232a4a; }
body.dark .side-dday.soon .sd-badge { background: #2a2113; }
body.dark .side-dday.today .sd-badge { background: #2e1a18; }

/* 서랍 근태 펀치 버튼 */
.punch-btns { display: flex; gap: 8px; }
.punch-btns .btn { flex: 1; justify-content: center; padding: 9px 10px; font-size: 13px; }

/* 근태 세션 목록 */
.att-sess { margin-top: 10px; display: flex; flex-direction: column; gap: 4px; }
.att-sess-row {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  font-size: 12px; padding: 5px 8px; border-radius: 7px; background: #f8f9fc;
}
.att-sess-t { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.att-now { color: var(--green); font-weight: 700; }
.att-manual { margin-top: 10px; }
.att-manual summary { list-style: revert; }
body.dark .att-sess-row { background: #262b3d; }

/* 근퇴관리 세션 펼침 */
.mng-sess-wrap { display: flex; flex-direction: column; gap: 4px; }
.mng-sess { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.mng-cell {
  font-size: 12px; padding: 2px 8px; border-radius: 6px;
  background: #f1f3f9; white-space: nowrap; min-width: 64px;
}
.mng-cell.dur { background: #eef2ff; color: var(--primary-dark); font-weight: 700; }
body.dark .mng-cell { background: #262b3d; }
body.dark .mng-cell.dur { background: #2b3350; color: #c3ccff; }

/* 개발자 행사 카드 (Brave People Dev-Event) */
.devevent-month {
  font-weight: 700; font-size: 15px; margin: 18px 0 10px;
  color: var(--text);
}
.devevent-grid {
  display: grid; gap: 12px;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
}
.devevent-card {
  display: flex; flex-direction: column; gap: 8px;
  background: var(--panel); border: 1px solid var(--border);
  border-radius: 12px; padding: 14px 16px;
  text-decoration: none; color: var(--text);
  transition: transform .12s ease, box-shadow .12s ease, border-color .12s ease;
}
.devevent-card:hover {
  transform: translateY(-2px); border-color: var(--primary);
  box-shadow: 0 6px 18px rgba(79,70,229,.15);
}
.devevent-title { font-weight: 600; font-size: 14px; line-height: 1.4; }
.devevent-tags { display: flex; flex-wrap: wrap; gap: 5px; }
.devevent-tag {
  font-size: 11px; padding: 2px 8px; border-radius: 999px;
  background: rgba(79,70,229,.1); color: var(--primary); font-weight: 600;
}
.devevent-meta { font-size: 12px; color: var(--muted); line-height: 1.6; margin-top: 2px; }

.badge {
  display: inline-block; padding: 2px 8px; border-radius: 999px;
  font-size: 11px; font-weight: 600;
}
.badge.admin { background: #fee2e2; color: #b91c1c; }
.badge.leader { background: #fef3c7; color: #92400e; }
.badge.member { background: #e0e7ff; color: #3730a3; }
.badge.private { background: #1f2430; color: #fff; }
.badge.cat-progress { background: #dbeafe; color: #1d4ed8; }
.badge.cat-work { background: #e0e7ff; color: #4338ca; }
.badge.cat-feedback { background: #dcfce7; color: #15803d; }
.badge.cat-issue { background: #fee2e2; color: #b91c1c; }

/* 현황 보드 */
.st-member { margin-bottom: 12px; }
.st-line {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 10px; border-radius: 8px; margin-bottom: 4px; font-size: 13px;
  background: #f8f9fc;
}
.st-line .st-text { flex: 1; word-break: break-word; }
.st-line.now { background: #eef2ff; border: 1px solid #c7d2fe; }
.st-line.fin .st-text b { color: var(--text); }
.st-chip {
  flex-shrink: 0; padding: 2px 8px; border-radius: 999px; font-size: 11px; font-weight: 700;
}
.st-chip.todo { background: #f1f5f9; color: #475569; }
.st-chip.doing { background: #4f46e5; color: #fff; animation: pulse 1.6s ease-in-out infinite; }
.st-chip.done { background: #dcfce7; color: #15803d; }
@keyframes pulse { 50% { opacity: .65; } }
.st-timeline {
  flex-shrink: 0; font-size: 11px; color: var(--muted);
  background: #fff; border: 1px solid var(--border); border-radius: 6px; padding: 2px 8px;
}

/* 팀 타임라인 (대시보드) */
.tl-head, .tl-row { display: flex; align-items: stretch; }
.tl-row { border-top: 1px solid #f0f1f6; padding: 6px 0; }
.tl-row:hover { background: #fafbfe; }
.tl-name { width: 110px; flex-shrink: 0; font-size: 12px; padding: 4px 8px; line-height: 1.7; }
.tl-lane {
  flex: 1; display: grid;
  grid-template-columns: repeat(var(--tl-days, 14), 1fr);
  grid-auto-rows: minmax(24px, auto); gap: 3px 0; align-content: start;
  background: linear-gradient(90deg,
    transparent calc(100% - 100% / var(--tl-days, 14)),
    rgba(79, 70, 229, .07) calc(100% - 100% / var(--tl-days, 14)));
}
.tl-head .tl-lane { background: none; }
.tl-day {
  text-align: center; font-size: 11px; color: var(--muted);
  padding: 5px 0; border-bottom: 2px solid var(--border);
}
.tl-day.sat { color: #2563eb; }
.tl-day.sun { color: #dc2626; }
.tl-day.today { color: var(--primary); font-weight: 800; border-bottom-color: var(--primary); }
.tl-bar {
  font-size: 11px; padding: 4px 8px; border-radius: 6px; cursor: pointer;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin: 0 2px;
}
.tl-bar:hover { filter: brightness(.95); }
.tl-bar.todo { background: #f1f5f9; color: #475569; border: 1px dashed #94a3b8; }
.tl-bar.doing { background: var(--primary); color: #fff; animation: pulse 1.6s ease-in-out infinite; }
.tl-bar.done { background: #dcfce7; color: #15803d; border: 1px solid #86efac; }
.muted { color: var(--muted); }
.row { display: flex; align-items: center; gap: 8px; }
.spread { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
h1, h2, h3 { margin: 0 0 12px; }
.page-title { font-size: 20px; margin-bottom: 16px; }

#toast-area { position: fixed; top: 16px; right: 16px; z-index: 9999; display: flex; flex-direction: column; gap: 8px; }
.toast {
  background: #1f2430; color: #fff; padding: 10px 16px; border-radius: 8px;
  font-size: 13px; box-shadow: 0 4px 16px rgba(0,0,0,.2); animation: fadein .2s;
}
.toast.error { background: var(--danger); }
@keyframes fadein { from { opacity: 0; transform: translateY(-6px); } }

.modal-back {
  position: fixed; inset: 0; background: rgba(15,18,30,.45); z-index: 1000;
  display: flex; align-items: center; justify-content: center;
}
.modal {
  background: #fff; border-radius: 14px; padding: 22px; width: 420px; max-width: 92vw;
  max-height: 88vh; overflow: auto; box-shadow: 0 12px 40px rgba(0,0,0,.25);
}
.modal h3 { margin-bottom: 14px; }
.modal .field { margin-bottom: 12px; }
.modal label { display: block; font-size: 12px; color: var(--muted); margin-bottom: 4px; }

/* ---------- 로그인 ---------- */
.auth-wrap {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
}
.auth-card {
  background: #fff; border-radius: 16px; padding: 36px; width: 380px; max-width: 92vw;
  box-shadow: 0 20px 60px rgba(0,0,0,.3);
}
.auth-card .logo { font-size: 26px; font-weight: 800; margin-bottom: 4px; }
.auth-card .logo span { color: var(--primary); }
.auth-card .field { margin-bottom: 12px; }
.auth-tabs { display: flex; gap: 4px; margin: 18px 0; background: #f3f4f8; padding: 4px; border-radius: 10px; }
.auth-tabs button {
  flex: 1; padding: 8px; border: 0; border-radius: 8px; background: transparent; font-weight: 600; color: var(--muted);
}
.auth-tabs button.on { background: #fff; color: var(--text); box-shadow: 0 1px 4px rgba(0,0,0,.08); }

/* ---------- 레이아웃 ---------- */
.layout { display: flex; min-height: 100vh; padding-left: var(--sidebar-w); }
.sidebar {
  width: var(--sidebar-w); background: #181c2a; color: #c6cbe0;
  display: flex; flex-direction: column; position: fixed; top: 0; bottom: 0; left: 0; z-index: 10;
}
.sidebar .brand {
  padding: 14px 14px 12px; font-size: 19px; font-weight: 800; color: #fff;
  border-bottom: 1px solid #262b3d;
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
}
.sidebar .brand-name span { color: #8b93ff; }
.brand-tools { display: flex; gap: 4px; }
.brand-btn { position: relative; background: transparent; border: none; color: #c6cbe0;
  font-size: 16px; width: 30px; height: 30px; border-radius: 8px; cursor: pointer;
  display: flex; align-items: center; justify-content: center; }
.brand-btn:hover { background: rgba(255,255,255,.12); }
.sidebar nav { flex: 1; overflow-y: auto; padding: 10px 0; }
.snav {
  display: flex; align-items: center; gap: 10px; padding: 10px 18px; color: #c6cbe0;
  font-size: 14px; border-left: 3px solid transparent;
}
.snav:hover { background: #20253a; color: #fff; }
.snav.on { background: #232946; color: #fff; border-left-color: #8b93ff; }
.snav .ico { width: 18px; text-align: center; }
.snav-section {
  padding: 14px 18px 5px; color: #6b7290;
  font-size: 11px; font-weight: 700; letter-spacing: .03em;
}
.snav.grp { padding-left: 30px; }
.snav.grp .ico { width: 16px; }
.proj-toggle {
  margin-left: auto; background: none; border: 0; color: #8b93ff;
  font-size: 13px; cursor: pointer; padding: 2px 6px; border-radius: 6px;
}
.proj-toggle:hover { background: #2c3252; color: #fff; }
.snav-sub {
  display: block; padding: 7px 18px 7px 46px; color: #9aa1bd; font-size: 13px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.snav-sub:hover, .snav-sub.on { color: #fff; background: #20253a; }
.sidebar .user-box {
  padding: 14px 18px; border-top: 1px solid #262b3d; font-size: 13px;
}
.sidebar .user-box .name { color: #fff; font-weight: 600; }

.main {
  flex: 1; width: 100%; margin: 0 auto; padding: 26px 32px 80px;
  max-width: 1600px;   /* 전체폭 페이지: 창이 넓으면 1600px에서 멈추고 가운데로 모음 */
}
/* 폭이 제한된 페이지(글 보기/작성 등): 남은 창 공간 안에서 가운데 정렬 */
.main.narrow { max-width: 1100px; }

/* 사이드바 슬라이드 토글 (모바일) */
.sidebar { transition: transform .28s ease; }
#side-toggle {
  display: none; position: fixed; top: 12px; left: 12px; z-index: 30;
  width: 42px; height: 42px; border: 0; border-radius: 10px;
  background: #181c2a; color: #fff; font-size: 20px; cursor: pointer;
  box-shadow: 0 2px 8px rgba(0,0,0,.25);
}
#side-overlay {
  display: none; position: fixed; inset: 0; z-index: 9; background: rgba(0,0,0,.45);
}
@media (max-width: 768px) {
  #side-toggle { display: block; }
  .sidebar { transform: translateX(-100%); z-index: 20; box-shadow: 2px 0 16px rgba(0,0,0,.3); }
  .sidebar.open { transform: translateX(0); }
  #side-overlay.show { display: block; }
  .layout { padding-left: 0; }
  .main { max-width: 100%; padding: 64px 16px 80px; }
  .main.narrow { max-width: 100%; }
  /* 피드백 보드: 모바일에선 칸반 세로 스택 */
  .fb-board { flex-direction: column; overflow-x: visible; }
  .fb-col { width: 100%; min-width: 0; }
  #top-tools { top: 10px; right: 12px; gap: 6px; }
  .top-btn { width: 34px; height: 34px; font-size: 15px; }
  .modal { width: 94vw; padding: 18px; }
  .cmd-box { width: 94vw; }
  .fb-pop { max-width: 90vw; }
  .fb-fab { right: 16px; bottom: 76px; }
}

/* ---------- 목록 ---------- */
.list-item {
  display: block; background: #fff; border: 1px solid var(--border); border-radius: 10px;
  padding: 14px 16px; margin-bottom: 10px; color: var(--text);
}
.list-item:hover { border-color: var(--primary); box-shadow: 0 2px 10px rgba(79,70,229,.08); }
.list-item .title { font-weight: 600; font-size: 15px; }
.list-item .meta { color: var(--muted); font-size: 12px; margin-top: 4px; }

table.tbl { width: 100%; border-collapse: collapse; background: #fff; border-radius: 10px; overflow: hidden; }
table.tbl th, table.tbl td { padding: 10px 12px; border-bottom: 1px solid var(--border); text-align: left; font-size: 13px; }
table.tbl th { background: #f8f9fc; color: var(--muted); font-weight: 600; }

/* ---------- To-Do ---------- */
.todo-line { display: flex; align-items: center; gap: 10px; padding: 8px 4px; border-bottom: 1px solid #f0f1f6; }
.todo-line input[type=checkbox] { width: 16px; height: 16px; accent-color: var(--primary); }
.todo-line .txt { flex: 1; }
.todo-line .txt.done { text-decoration: line-through; color: var(--muted); }
.todo-date-group { margin-bottom: 20px; }
.todo-date-group h4 { margin: 0 0 6px; color: var(--primary-dark); }

/* ---------- D-day ---------- */
.dday-line { display: flex; align-items: center; gap: 10px; padding: 8px 4px; border-bottom: 1px solid #f0f1f6; }
.dday-line .txt { flex: 1; }
.dday-line.past { opacity: .55; }
.dday-badge { font-weight: 700; font-size: 12px; padding: 2px 8px; border-radius: 10px; background: #eef0ff; color: var(--primary); min-width: 46px; text-align: center; }
.dday-line.soon .dday-badge { background: #fff3e0; color: #e65100; }
.dday-line.today .dday-badge { background: #fdecea; color: #c62828; }

/* ---------- 캘린더 ---------- */
.cal-wrap { display: flex; gap: 20px; align-items: flex-start; }
.cal-main { flex: 1; background: #fff; border: 1px solid var(--border); border-radius: 12px; padding: 16px; }
.cal-side { width: 230px; flex-shrink: 0; }
.cal-side .card { margin-bottom: 14px; }
.cal-filter { display: flex; align-items: center; gap: 8px; padding: 6px 2px; font-size: 13px; }
.cal-filter input { accent-color: var(--primary); }
.cal-dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.fc { font-size: 13px; }
.fc .fc-toolbar-title { font-size: 18px; }

/* ---------- 게시물 보기 ---------- */
.post-head { margin-bottom: 18px; }
.post-head h1 { font-size: 24px; margin-bottom: 8px; }
.post-body { background: #fff; border: 1px solid var(--border); border-radius: 12px; padding: 28px 32px; }
.toastui-editor-contents { font-size: 15px; }
.toastui-editor-contents img { max-width: 100%; border-radius: 8px; }

/* PDF 인라인 뷰어 */
.pdf-embed {
  border: 1px solid var(--border); border-radius: 10px; margin: 14px 0; overflow: hidden; background: #fafbfe;
}
.pdf-embed .pdf-bar {
  display: flex; align-items: center; gap: 10px; padding: 8px 12px;
  background: #1f2430; color: #fff; font-size: 12px;
}
.pdf-embed .pdf-bar .name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pdf-embed .pdf-bar button {
  background: #3a4060; color: #fff; border: 0; border-radius: 6px; padding: 3px 10px; font-size: 12px;
}
.pdf-embed .pdf-bar button:hover { background: #4d548033; background: #4d5480; }
.pdf-embed canvas { display: block; margin: 0 auto; max-width: 100%; }

/* ---------- 에디터 페이지 ---------- */
.edit-top { display: flex; gap: 10px; margin-bottom: 12px; align-items: center; }
.edit-top .input { font-size: 16px; font-weight: 600; }
.priv-toggle { display: flex; align-items: center; gap: 6px; white-space: nowrap; font-size: 13px; }

/* ---------- 오른쪽 가장자리 슬라이드 서랍 (위: 할 일·부서작업 / 아래: 근태) ---------- */
.side-drawer {
  position: fixed; right: 0; z-index: 460; width: 340px; max-width: calc(100vw - 50px);
  transform: translateX(100%); transition: transform .25s ease;
}
.side-drawer.open { transform: translateX(0); }
#todo-drawer { top: 48px; }
#punch-drawer { top: 120px; }            /* 손잡이가 위 서랍 손잡이 아래로 오도록 */
/* 위 할 일 서랍이 열리면 아래 근태 손잡이를 패널 뒤로 숨겨 방해되지 않게 */
#todo-drawer.open ~ #punch-drawer { z-index: 455; }
.drawer-handle {
  position: absolute; left: -34px; top: 8px; width: 34px; height: 56px;
  border: 1px solid var(--border); border-right: 0; border-radius: 10px 0 0 10px;
  background: #fff; color: var(--primary); font-size: 18px; font-weight: 700;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  box-shadow: -4px 2px 12px rgba(0,0,0,.1); cursor: pointer;
}
.drawer-handle:hover { background: #f3f4f8; }
.drawer-handle .dh-ico { font-size: 13px; line-height: 1; }
.drawer-pop {
  background: #fff; border: 1px solid var(--border); border-right: 0;
  border-radius: 12px 0 0 12px; padding: 14px;
  box-shadow: -8px 4px 30px rgba(0,0,0,.15);
}
#todo-pop #todo-pop-list { max-height: 55vh; overflow-y: auto; }

/* 회사 → 집 러닝 (09~18시, 근무 중에만) */
.work-run {
  margin: -2px 0 12px; padding: 10px 12px 8px;
  background: linear-gradient(180deg, #eef6ff, #f6fbff);
  border: 1px solid #d8e8fb; border-radius: 10px;
}
body.dark .work-run { background: #16202e; border-color: #25405c; }
.work-run .wr-track {
  position: relative; height: 26px;
  border-bottom: 2px dashed #b9cbe0;
}
.work-run .wr-home, .work-run .wr-goal {
  position: absolute; bottom: 0; font-size: 18px; line-height: 1;
}
.work-run .wr-home { left: 0; }
.work-run .wr-goal { right: 0; }
.work-run .wr-runner {
  position: absolute; bottom: 0; left: 0; font-size: 18px; line-height: 1;
  transform: translateX(-50%); transition: left 1s linear;
}
.work-run .wr-cap {
  margin-top: 5px; font-size: 11px; color: var(--muted); text-align: center;
}
/* 왼쪽 사이드바: 근무시간 타이머 바로 위. 타이머 버튼과 좌우 여백 맞춤 */
.sidebar .work-run { margin: 4px 12px 8px; }

/* ---------- 사내 메신저 ---------- */
#msgr-fab {
  position: fixed; right: 24px; bottom: 24px; z-index: 500;
  background: var(--primary); color: #fff; border: 0; border-radius: 12px;
  padding: 12px 18px; font-weight: 700; font-size: 14px;
  box-shadow: 0 8px 24px rgba(79,70,229,.4);
}
#msgr-fab:hover { background: var(--primary-dark); }
#msgr-badge {
  background: #e5484d; color: #fff; border-radius: 999px;
  font-size: 11px; padding: 1px 7px; margin-left: 6px;
}
#msgr-panel {
  position: fixed; right: 24px; bottom: 24px; z-index: 550;
  width: 380px; max-width: calc(100vw - 48px); height: 580px; max-height: calc(100vh - 48px);
  background: #fff; border: 1px solid var(--border); border-radius: 14px;
  display: flex; flex-direction: column; overflow: hidden;
  box-shadow: 0 16px 60px rgba(0,0,0,.25);
}
.msgr-head {
  display: flex; align-items: center; gap: 8px; padding: 12px 14px;
  background: var(--primary); color: #fff; font-size: 14px;
}
.msgr-head button { background: none; border: 0; color: #fff; font-size: 16px; cursor: pointer; }
.msgr-tabs { display: flex; border-bottom: 1px solid var(--border); }
.msgr-tabs button {
  flex: 1; padding: 10px; border: 0; background: #fff; font-weight: 600;
  color: var(--muted); border-bottom: 2px solid transparent; font-size: 13px;
}
.msgr-tabs button.on { color: var(--primary); border-bottom-color: var(--primary); }
#msgr-body { flex: 1; overflow-y: auto; display: flex; flex-direction: column; }
.org-dept {
  padding: 12px 14px 4px; font-size: 12px; color: var(--muted); font-weight: 700;
}
.org-member { display: flex; align-items: center; gap: 10px; padding: 8px 14px; cursor: pointer; font-size: 14px; }
.org-member:hover { background: #f5f6fa; }
.avatar {
  width: 34px; height: 34px; border-radius: 50%; background: var(--primary); color: #fff;
  display: inline-flex; align-items: center; justify-content: center; font-weight: 700; flex-shrink: 0; font-size: 14px;
}
.room-row { display: flex; align-items: center; gap: 10px; padding: 10px 14px; cursor: pointer; border-bottom: 1px solid #f5f6fa; }
.room-row:hover { background: #f5f6fa; }
.room-row .rmain { flex: 1; min-width: 0; }
.room-row .rname { font-weight: 600; font-size: 14px; }
.room-row .rlast { font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 210px; }
.room-row .rmeta { font-size: 10px; color: var(--muted); }
.unread { background: #e5484d; color: #fff; border-radius: 999px; font-size: 10px; padding: 1px 6px; }
.chat-head {
  display: flex; align-items: center; gap: 8px; padding: 10px 12px;
  border-bottom: 1px solid var(--border); background: #fafbfe; font-size: 14px;
}
.chat-head button { border: 0; background: none; font-size: 16px; cursor: pointer; color: var(--muted); }
.chat-head button:hover { color: var(--text); }
.msgr-msgs {
  flex: 1; overflow-y: auto; padding: 12px; background: #eef0f7;
  display: flex; flex-direction: column;
}
.bubble-row { display: flex; flex-direction: column; align-items: flex-start; margin-bottom: 8px; }
.bubble-row.mine { align-items: flex-end; }
.bubble-name { font-size: 11px; color: var(--muted); margin: 0 4px 2px; }
.slack-tag {
  font-size: 9px; font-weight: 700; vertical-align: middle;
  padding: 0 5px; border-radius: 999px; margin-left: 2px;
  background: #611f69; color: #fff;
}
.bubble {
  max-width: 78%; padding: 8px 12px; border-radius: 14px; background: #fff;
  font-size: 13px; white-space: pre-wrap; word-break: break-word;
  box-shadow: 0 1px 2px rgba(0,0,0,.06);
}
.bubble-row.mine .bubble { background: var(--primary); color: #fff; border-bottom-right-radius: 4px; }
.bubble-row:not(.mine) .bubble { border-bottom-left-radius: 4px; }
.bubble-time { font-size: 10px; color: var(--muted); margin: 2px 4px 0; }
.msgr-input-row { display: flex; align-items: flex-end; gap: 8px; padding: 10px; border-top: 1px solid var(--border); background: #fff; }
.msgr-input-row input {
  flex: 1; border: 1px solid var(--border); border-radius: 8px; padding: 8px 10px; outline: none; font-size: 13px;
}
.msgr-input-row input:focus { border-color: var(--primary); }
/* 이모지가 그림으로 들어가는 입력창 (contenteditable) */
.msgr-ce {
  flex: 1; border: 1px solid var(--border); border-radius: 8px;
  padding: 8px 10px; outline: none; font-size: 13px;
  min-height: 19px; max-height: 110px; overflow-y: auto;
  line-height: 1.5; text-align: left; white-space: pre-wrap; word-break: break-word;
  background: #fff; color: var(--text); cursor: text;
}
.msgr-ce:focus { border-color: var(--primary); }
.msgr-ce:empty:before { content: attr(data-ph); color: var(--muted); pointer-events: none; }
.msgr-ce .emo { width: 1.5em; height: 1.5em; vertical-align: -0.35em; }
.msgr-msgs.drop { outline: 3px dashed var(--primary); outline-offset: -8px; background: #eef2ff; }
.bubble-img {
  max-width: 220px; max-height: 280px; border-radius: 10px;
  display: block; cursor: zoom-in; margin: 2px 0;
}
.bubble-file {
  display: inline-block; background: #f3f4f8; color: var(--text) !important;
  padding: 6px 10px; border-radius: 8px; font-size: 12px; margin: 2px 0;
}
.bubble-pdf {
  width: 240px; max-width: 100%; background: #fff; color: var(--text);
  border: 1px solid var(--border); border-radius: 8px; overflow: hidden; margin: 2px 0;
}
.bubble-pdf canvas { display: block; margin: 0 auto; max-width: 100%; }
.pdfmini-bar {
  display: flex; align-items: center; gap: 6px; padding: 5px 8px;
  background: #f3f4f8; font-size: 11px; color: var(--text);
}
.pdfmini-bar .nm { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pdfmini-bar a { font-size: 11px; }
.pdfmini-nav {
  display: flex; justify-content: center; align-items: center; gap: 10px;
  padding: 4px; font-size: 11px; color: var(--muted); background: #f8f9fc;
}
.pdfmini-nav button { border: 0; background: none; cursor: pointer; font-size: 12px; color: var(--primary); }
/* 챗봇 탭 (채팅과 동일한 말풍선 UI) */
.bot-sys {
  text-align: center; font-size: 11px; color: var(--muted);
  margin: 10px 12px; white-space: pre-wrap; line-height: 1.5;
}
.cursor-blink { display: inline-block; width: 8px; height: 12px; background: var(--primary); animation: blink 1s steps(1) infinite; margin: 2px 4px; }
@keyframes blink { 50% { opacity: 0; } }

/* ---------- API 문서 ---------- */
pre.codeblock {
  background: #0c0f17; color: #c9d1d9; padding: 14px 16px; border-radius: 10px;
  overflow-x: auto; font-size: 12.5px; line-height: 1.5;
}
.token-line { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid #f0f1f6; }
.token-line code {
  background: #f3f4f8; padding: 3px 8px; border-radius: 6px; font-size: 12px; word-break: break-all;
}

/* ---------- 대시보드 ---------- */
.dash-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 18px; }
@media (max-width: 1000px) { .dash-grid { grid-template-columns: 1fr; } .cal-wrap { flex-direction: column; } .cal-side { width: 100%; } }
.add-line { display: flex; gap: 8px; margin-top: 10px; }

/* 댓글 */
.cmt-line {
  display: flex; gap: 10px; align-items: flex-start;
  padding: 9px 0; border-bottom: 1px solid #f0f1f6;
}
.cmt-line:last-of-type { border-bottom: 0; }
.cmt-reply { margin-left: 26px; background: #fafbfe; border-radius: 8px; padding: 8px 10px !important; border-bottom: 0 !important; margin-bottom: 4px; }
.cmt-reply-box { display: flex; gap: 8px; align-items: center; margin: 6px 0 10px 26px; }
.cmt-thread { border-bottom: 1px solid #f0f1f6; padding-bottom: 4px; margin-bottom: 4px; }
.cmt-thread .cmt-line { border-bottom: 0; }

/* Stock 챗봇 */
.stk-body {
  min-height: 50vh; max-height: 64vh; overflow-y: auto;
  background: #fff; border: 1px solid var(--border); border-radius: 12px;
  padding: 16px; margin-bottom: 12px;
}
.stk-empty { text-align: center; color: var(--muted); padding: 50px 10px; font-size: 15px; }
.stk-msg { display: flex; margin: 10px 0; }
.stk-msg.user { justify-content: flex-end; }
.stk-bubble {
  max-width: 86%; padding: 11px 15px; border-radius: 14px; font-size: 14px; line-height: 1.6;
  word-break: break-word;
}
.stk-msg.user .stk-bubble { background: var(--primary); color: #fff; border-bottom-right-radius: 4px; white-space: pre-wrap; }
.stk-msg.assistant .stk-bubble { background: #f5f6fa; color: var(--text); border-bottom-left-radius: 4px; }
.stk-bubble table { border-collapse: collapse; margin: 8px 0; font-size: 13px; width: 100%; }
.stk-bubble th, .stk-bubble td { border: 1px solid var(--border); padding: 6px 9px; text-align: left; }
.stk-bubble th { background: #eef0f7; }
.stk-bubble img { max-width: 100%; border: 1px solid var(--border); border-radius: 8px; margin: 8px 0; background: #fff; }
.stk-bubble pre { background: #0c0f17; color: #c9d1d9; padding: 10px 12px; border-radius: 8px; overflow-x: auto; font-size: 12px; }
.stk-bubble code { background: #eef0f7; padding: 1px 5px; border-radius: 4px; font-size: 12px; }
.stk-bubble pre code { background: none; padding: 0; color: inherit; }
.stk-bubble h3, .stk-bubble h4, .stk-bubble h5 { margin: 8px 0 4px; }
.stk-bubble a { color: var(--primary); }
.stk-tool { font-size: 12px; color: var(--amber); margin-top: 6px; }
.stk-err { color: var(--danger); font-size: 13px; margin-top: 8px; }
.stk-input-row { display: flex; gap: 8px; }
.stk-input-row .input { flex: 1; }

/* ===== 클라우드 (개인 파일 저장소) ===== */
.cloud-quota { margin: 10px 0 4px; }
.cloud-quota-bar { height: 8px; background: #eceef5; border-radius: 6px; overflow: hidden; }
.cloud-quota-fill { height: 100%; background: var(--primary); border-radius: 6px; transition: width .3s; }
.cloud-quota-fill.warn { background: var(--amber); }
.cloud-quota-fill.over { background: var(--danger); }
.cloud-quota-txt { font-size: 12px; color: var(--muted); margin-top: 5px; }
.cloud-quota-txt a { color: var(--primary); text-decoration: none; }
.cloud-quota-txt a:hover { text-decoration: underline; }
.cloud-toolbar { margin: 12px 0 8px; }
.cloud-actions { display: flex; gap: 8px; }
.cloud-crumb { font-size: 14px; }
.cloud-crumb a { color: var(--text); text-decoration: none; padding: 2px 4px; border-radius: 5px; }
.cloud-crumb a:hover { background: #eef0f7; color: var(--primary); }
.cloud-drop { position: relative; border: 2px dashed var(--border); border-radius: 12px; background: var(--panel); min-height: 240px; padding: 6px; }
.cloud-drop.drag { border-color: var(--primary); background: #f0f1fe; }
.cloud-drop-hint { display: none; }
.cloud-drop.drag .cloud-drop-hint {
  display: flex; align-items: center; justify-content: center;
  position: absolute; inset: 0; z-index: 2; pointer-events: none;
  font-size: 16px; font-weight: 600; color: var(--primary);
  background: rgba(240, 241, 254, .85); border-radius: 10px;
}
.cloud-list { display: flex; flex-direction: column; }
.cloud-item { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 8px; }
.cloud-item:hover { background: #f5f6fa; }
.cloud-ico { font-size: 20px; cursor: pointer; width: 24px; text-align: center; }
.cloud-name { flex: 1; cursor: pointer; font-size: 14px; word-break: break-all; }
.cloud-name:hover { color: var(--primary); text-decoration: underline; }
.cloud-meta { font-size: 12px; white-space: nowrap; }
.cloud-row-actions { display: flex; gap: 4px; opacity: 0; transition: opacity .15s; }
.cloud-item:hover .cloud-row-actions { opacity: 1; }
.cloud-act { cursor: pointer; padding: 3px 6px; border-radius: 6px; font-size: 14px; text-decoration: none; }
.cloud-act:hover { background: #e4e6ef; }
.cloud-progress { padding: 12px 10px; }
.cloud-pbar { height: 8px; background: #eceef5; border-radius: 6px; overflow: hidden; }
.cloud-pfill { height: 100%; background: var(--primary); border-radius: 6px; transition: width .2s; }
.cloud-ptxt { font-size: 12px; color: var(--muted); margin-top: 5px; display: inline-block; }
/* 미리보기 모달 */
.modal.cloud-modal { width: 880px; }
.cloud-pv-body { display: flex; justify-content: center; }
.cloud-pv-img { max-width: 100%; max-height: 72vh; border-radius: 8px; }
.cloud-pv-media { max-width: 100%; max-height: 72vh; background: #000; border-radius: 8px; }
.cloud-pv-frame { width: 100%; height: 72vh; border: 0; border-radius: 8px; }
.cloud-pre {
  width: 100%; max-height: 72vh; overflow: auto; margin: 0;
  background: #f7f8fb; border: 1px solid var(--border); border-radius: 8px; padding: 14px;
  font-size: 13px; line-height: 1.5; white-space: pre-wrap; word-break: break-word;
}

/* ================= 다크모드 ================= */
body.dark {
  --bg: #15171f;
  --panel: #1e2230;
  --border: #2c3142;
  --text: #e6e8ef;
  --muted: #9aa0b3;
}
/* 흰색/밝은 표면 → 다크 패널 */
body.dark .card, body.dark .modal, body.dark .auth-card, body.dark table.tbl,
body.dark .cal-main, body.dark .post-body, body.dark #msgr-panel, body.dark .msgr-msg,
body.dark .msgr-input-row, body.dark .fb-pop, body.dark .msgr-head,
body.dark .drawer-handle, body.dark #msgr-search-panel { background: var(--panel); color: var(--text); }
/* 버튼·입력 */
body.dark .btn { background: #262b3d; color: var(--text); border-color: var(--border); }
body.dark .btn:hover { background: #2f3548; }
body.dark .input, body.dark input, body.dark select, body.dark textarea, body.dark .msgr-ce {
  background: #262b3d; color: var(--text); border-color: var(--border); }
body.dark .btn.primary { background: var(--primary); border-color: var(--primary); color: #fff; }
/* 옅은 회색 배경들 */
body.dark .auth-tabs, body.dark table.tbl th, body.dark .st-chip.todo, body.dark .tl-bar.todo,
body.dark .codeblock, body.dark .cloud-pre, body.dark pre { background: #262b3d !important; color: var(--text); }
body.dark .auth-tabs button.on, body.dark .tl-row:hover, body.dark .org-member:hover,
body.dark .room-row:hover, body.dark .btn:hover { background: #2f3548; }
body.dark .cmt-reply, body.dark .post-toc { background: #20242f; }
body.dark a { color: #93a4ff; }
body.dark .food-tag { background: #2f3548; color: #cfd3e0; }
body.dark .dur-chip { background: #2b3350; color: #c3ccff; }
body.dark .ac-item:hover, body.dark .ac-item.sel { background: #2b3350; color: #c3ccff; }
body.dark .att-bar { background: #262b3d; }

/* ToastUI 본문 — 라이브러리가 강제한 검은 글씨(#222)/밝은 배경을 다크로 보정 */
body.dark .toastui-editor-contents,
body.dark .toastui-editor-contents p,
body.dark .toastui-editor-contents h1, body.dark .toastui-editor-contents h2,
body.dark .toastui-editor-contents h3, body.dark .toastui-editor-contents h4,
body.dark .toastui-editor-contents h5, body.dark .toastui-editor-contents h6,
body.dark .toastui-editor-contents ul, body.dark .toastui-editor-contents ol,
body.dark .toastui-editor-contents li, body.dark .toastui-editor-contents table,
body.dark .toastui-editor-contents td, body.dark .toastui-editor-contents strong,
body.dark .toastui-editor-contents em, body.dark .toastui-editor-contents span { color: var(--text); }
body.dark .toastui-editor-contents blockquote,
body.dark .toastui-editor-contents blockquote p { color: var(--muted); border-left-color: var(--border); }
body.dark .toastui-editor-contents h1, body.dark .toastui-editor-contents h2 { border-bottom-color: var(--border); }
body.dark .toastui-editor-contents hr { border-top-color: var(--border); }
body.dark .toastui-editor-contents code { color: #f0a3b6; background: #2c3142; }
body.dark .toastui-editor-contents pre { background: #262b3d; }
body.dark .toastui-editor-contents th, body.dark .toastui-editor-contents td { border-color: var(--border); }
body.dark .toastui-editor-contents table th { background: #2f3548; color: var(--text); }
body.dark .toastui-editor-contents table th p { color: var(--text); }
body.dark .toastui-editor-contents a { color: #93a4ff; }

/* FullCalendar — 밝은 테마 변수를 다크로 */
body.dark .fc {
  --fc-border-color: var(--border);
  --fc-page-bg-color: var(--panel);
  --fc-neutral-bg-color: #262b3d;
  --fc-today-bg-color: rgba(79,70,229,.18);
  --fc-list-event-hover-bg-color: #2f3548;
  --fc-more-link-bg-color: #2f3548;
  --fc-more-link-text-color: var(--text);
}
body.dark .fc, body.dark .fc a, body.dark .fc .fc-col-header-cell-cushion,
body.dark .fc .fc-daygrid-day-number, body.dark .fc .fc-toolbar-title { color: var(--text); }

/* ToastUI 작성 에디터(글쓰기) 크롬·입력부 다크화 */
body.dark .toastui-editor-defaultUI { border-color: var(--border); }
body.dark .toastui-editor-defaultUI-toolbar,
body.dark .toastui-editor-md-tab-container,
body.dark .toastui-editor-mode-switch,
body.dark .toastui-editor-dropdown-toolbar { background-color: #20242f; border-color: var(--border); }
body.dark .toastui-editor-defaultUI button { color: var(--text); }
body.dark .toastui-editor-toolbar-divider { background-color: var(--border); }
body.dark .toastui-editor-defaultUI-toolbar button:not(:disabled):hover { background-color: #2f3548; border-color: var(--border); }
body.dark .toastui-editor-toolbar-icons { filter: invert(1) brightness(1.7) hue-rotate(180deg); }
body.dark .toastui-editor-ww-container,
body.dark .toastui-editor-md-container,
body.dark .toastui-editor-md-container .toastui-editor,
body.dark .toastui-editor-md-preview { background-color: var(--panel); color: var(--text); }
body.dark .toastui-editor-md-preview { border-left: 1px solid var(--border); }
body.dark .toastui-editor-mode-switch .tab-item,
body.dark .toastui-editor-md-tab-container .tab-item { background: #20242f; color: var(--muted); border-color: var(--border); }
body.dark .toastui-editor-mode-switch .tab-item.active,
body.dark .toastui-editor-md-tab-container .tab-item.active {
  background-color: var(--panel); color: var(--text); border-top-color: var(--panel); border-bottom-color: var(--panel); }
body.dark .toastui-editor-md-block-quote .toastui-editor-md-marked-text { color: var(--muted); }

/* 우측 상단 툴바 (알림·다크모드) */
#top-tools { position: fixed; top: 14px; right: 18px; z-index: 600; display: flex; gap: 8px; }
.top-btn { position: relative; width: 38px; height: 38px; border-radius: 50%;
  border: 1px solid var(--border); background: var(--panel); color: var(--text); font-size: 17px;
  display: flex; align-items: center; justify-content: center; box-shadow: 0 2px 8px rgba(0,0,0,.10); cursor: pointer; }
.top-btn:hover { background: rgba(127,127,127,.12); }

/* 메시지 편집/삭제 */
.bubble-deleted { opacity: .55; font-style: italic; }
.bubble-act { font-size: 11px; margin-right: 6px; color: var(--muted); cursor: pointer; }
.bubble-act:hover { color: var(--primary); text-decoration: underline; }
.bubble-edited { font-size: 10px; opacity: .6; margin-left: 4px; }

/* 투표 */
.poll-opt { position: relative; overflow: hidden; border: 1px solid var(--border); border-radius: 8px;
  padding: 8px 10px; margin-bottom: 6px; cursor: pointer; display: flex; justify-content: space-between; gap: 8px; }
.poll-opt:hover { border-color: var(--primary); }
.poll-opt.sel { border-color: var(--primary); background: rgba(79,70,229,.06); }
.poll-opt.closed { cursor: default; }
.poll-opt.closed:hover { border-color: var(--border); }
.poll-bar { position: absolute; left: 0; top: 0; bottom: 0; background: rgba(79,70,229,.14); z-index: 0; transition: width .3s; }
.poll-opt-t, .poll-opt-n { position: relative; z-index: 1; font-size: 13px; }
.poll-opt-n { color: var(--muted); white-space: nowrap; }
#wheel { border-radius: 50%; box-shadow: 0 2px 10px rgba(0,0,0,.18); }

/* 알림 + @멘션 */
.notif-badge { position: absolute; top: -3px; right: -3px;
  background: #e5484d; color: #fff; border-radius: 999px; font-size: 10px; font-weight: 700;
  min-width: 16px; height: 16px; padding: 0 4px; display: inline-flex; align-items: center; justify-content: center; }
.notif-item { padding: 10px 12px; border-radius: 8px; cursor: pointer; border-bottom: 1px solid var(--border); }
.notif-item:hover { background: rgba(127,127,127,.08); }
.notif-item.unread { background: rgba(79,70,229,.08); }
.notif-item.unread::before { content: '●'; color: var(--primary); font-size: 9px; margin-right: 6px; }
.mention-dd { position: fixed; z-index: 9500; background: #fff; border: 1px solid var(--border);
  border-radius: 8px; box-shadow: 0 8px 24px rgba(0,0,0,.18); overflow: hidden; max-height: 220px; overflow-y: auto; }
body.dark .mention-dd { background: var(--panel); }
.mention-opt { padding: 8px 12px; font-size: 13px; cursor: pointer; }
.mention-opt:hover { background: rgba(79,70,229,.12); }

/* 피드백 핀 주석 */
.fb-fab { position: fixed; right: 24px; bottom: 88px; z-index: 540; width: 52px; height: 52px;
  border-radius: 50%; border: none; background: #3b5bdb; color: #fff; font-size: 22px; cursor: pointer;
  box-shadow: 0 4px 14px rgba(0,0,0,.25); transition: transform .12s, background .12s; }
.fb-fab:hover { transform: scale(1.08); }
.fb-fab.on { background: #e8590c; }
body.fb-mode, body.fb-mode * { cursor: crosshair !important; }
body.fb-textmode, body.fb-textmode * { cursor: text !important; }
.fb-pri { font-size: 11px; padding: 1px 6px; border-radius: 6px; background: rgba(127,127,127,.14); }
.fb-tag { display: inline-block; font-size: 11px; padding: 1px 7px; margin-left: 3px; border-radius: 999px;
  background: rgba(79,70,229,.14); color: var(--primary); }
.fb-shot { display: block; margin-top: 7px; max-width: 100%; border: 1px solid var(--border); border-radius: 6px; cursor: zoom-in; }
.fb-due { font-size: 11px; padding: 1px 6px; border-radius: 6px; background: rgba(127,127,127,.14); }
.fb-due.over { background: #fde8e8; color: #b91c1c; font-weight: 700; }
.fb-stats { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; font-size: 13px; margin-bottom: 14px; }
.fb-stats b { font-size: 15px; }
.fd-cmt { padding: 7px 2px; border-bottom: 1px solid var(--border); }
/* 커맨드 팔레트 */
.cmd-back { position: fixed; inset: 0; z-index: 9600; background: rgba(15,18,30,.45); display: flex; justify-content: center; align-items: flex-start; padding-top: 12vh; }
.cmd-box { width: 540px; max-width: 92vw; background: var(--panel); border: 1px solid var(--border); border-radius: 12px; box-shadow: 0 16px 48px rgba(0,0,0,.3); overflow: hidden; }
.cmd-input { width: 100%; border: 0; border-bottom: 1px solid var(--border); padding: 14px 16px; font-size: 15px; outline: none; background: var(--panel); color: var(--text); }
.cmd-list { max-height: 340px; overflow-y: auto; }
.cmd-item { padding: 10px 16px; font-size: 14px; cursor: pointer; }
.cmd-item.on { background: rgba(79,70,229,.14); }
.cmd-item:hover { background: rgba(127,127,127,.1); }
.fb-banner { position: fixed; top: 14px; left: 50%; transform: translateX(-50%); z-index: 9100;
  background: #1f2937; color: #fff; padding: 8px 16px; border-radius: 24px; font-size: 13px;
  display: flex; align-items: center; gap: 10px; box-shadow: 0 4px 14px rgba(0,0,0,.25); }
.fb-layer { position: fixed; inset: 0; z-index: 8800; pointer-events: none; }
.fb-pin { position: fixed; z-index: 8900; transform: translate(-50%, -50%); width: 26px; height: 26px;
  border-radius: 50%; background: #3b5bdb; color: #fff; font-size: 12px; font-weight: 700; line-height: 1;
  display: flex; align-items: center; justify-content: center; cursor: pointer; pointer-events: auto;
  box-shadow: 0 2px 6px rgba(0,0,0,.35); border: 2px solid #fff; }
.fb-temp-pin { background: #e8590c; z-index: 9300; }
.fb-pop { position: fixed; z-index: 9200; width: 260px; background: #fff; border: 1px solid var(--border);
  border-radius: 10px; padding: 12px; box-shadow: 0 8px 28px rgba(0,0,0,.22); }
.fb-board { display: flex; gap: 14px; align-items: flex-start; overflow-x: auto; }
.fb-col { flex: 1; min-width: 240px; }
.fb-col-h { padding: 6px 4px; border-bottom: 2px solid; margin-bottom: 10px; font-size: 14px; }
.fb-card { margin-bottom: 10px; cursor: grab; }
.fb-card.dragging { opacity: .45; }
.fb-col.drop-hover { background: rgba(79,70,229,.1); border-radius: 8px; outline: 2px dashed var(--primary); }
.fd-file { display: inline-block; margin-right: 8px; }

/* 이모티콘 */
.emo {
  display: inline-block;
  width: 1.4em; height: 1.4em;
  vertical-align: -0.3em;
  margin: 0 1px;
  object-fit: contain;
  image-rendering: auto; /* 일반 이미지(PNG 등)는 부드럽게 — 계단현상 방지 */
}
/* 메시지/댓글 본문 안에선 살짝 크게 */
.bubble .emo, .fd-cmt .emo, .cmt-line .emo, .post-body .emo { width: 1.6em; height: 1.6em; }
/* 글자 없이 이모티콘만 보낸 메시지 = 스티커처럼 크게, 말풍선 배경 제거 */
.bubble-sticker { background: transparent !important; box-shadow: none !important; padding: 0 !important; }
.bubble-row.mine .bubble-sticker { background: transparent !important; }
.bubble-sticker .emo { display: block; width: min(200px, 60vw); height: auto; margin: 2px; }

.emo-btn {
  flex: 0 0 auto;
  background: none; border: 1px solid var(--border); border-radius: 8px;
  cursor: pointer; font-size: 17px; line-height: 1;
  padding: 5px 8px;
}
.emo-btn:hover { background: var(--bg); }

.emo-pop {
  position: fixed; z-index: 99999;
  background: var(--panel); border: 1px solid var(--border); border-radius: 12px;
  box-shadow: 0 8px 28px rgba(0, 0, 0, .16);
  padding: 8px;
  display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px;
  width: 232px; max-height: 260px; overflow: auto;
}
.emo-cell {
  background: none; border: 0; border-radius: 8px; cursor: pointer;
  padding: 5px; display: flex; align-items: center; justify-content: center;
}
.emo-cell:hover { background: var(--bg); }
.emo-cell img { width: 32px; height: 32px; object-fit: contain; }

/* 맛집 */
.food-tier { padding: 2px 7px; border-radius: 6px; font-size: 12px; font-weight: 600; margin-right: 4px; }
.food-tag { padding: 2px 7px; border-radius: 6px; font-size: 12px; background: #eef1f5; color: #444; margin-right: 4px; }
.food-rank { display: inline-block; min-width: 18px; text-align: center; background: #1f8b4c; color: #fff;
  border-radius: 6px; font-size: 12px; padding: 1px 6px; margin-right: 6px; vertical-align: middle; }
