/* RE;fy 직원용 모바일 전용 UI */
:root {
  --m-primary: #6F9A86;
  --m-primary-hover: #5E8875;
  --m-accent: #D7AD86;
  --m-bg: #F7F6F1;
  --m-surface: #FFFFFF;
  --m-text: #2C3330;
  --m-muted: #69726D;
  --m-border: #E1E5E3;
  --m-danger: #c62828;
  --m-radius: 16px;
  --m-safe-b: env(safe-area-inset-bottom, 0px);
  --m-safe-t: env(safe-area-inset-top, 0px);
  /* UI 통일: 나눔스퀘어네오 (context/UI_FONT.md) */
  --font-ui: 'NanumSquareNeo', 'Malgun Gothic', '맑은 고딕', -apple-system, BlinkMacSystemFont, sans-serif;
}

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

html, body {
  margin: 0;
  padding: 0;
  font-family: var(--font-ui);
  background: var(--m-bg);
  color: var(--m-text);
  min-height: 100%;
}

button,
input,
select,
textarea {
  font-family: inherit;
}

body { padding-bottom: calc(16px + var(--m-safe-b)); }

/* 직원 톡대화 플로팅 버튼 → PC 전체 화면 채팅(openChat=1) */
.m-chat-fab {
  position: fixed;
  right: 16px;
  bottom: calc(18px + var(--m-safe-b));
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: none;
  background: var(--m-primary);
  color: #fff;
  font-size: 1.45rem;
  box-shadow: 0 6px 18px rgba(111, 154, 134, 0.32);
  z-index: 80;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  -webkit-tap-highlight-color: transparent;
}
.m-chat-fab:active { transform: scale(0.96); }
.m-chat-fab.m-hidden { display: none !important; }

/* 모바일 관리자 (m-admin.html) */
.ma-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.ma-tab {
  min-height: 44px;
  border-radius: 12px;
  border: 1px solid var(--m-border);
  background: #fff;
  font-weight: 800;
  font-size: 0.88rem;
  font-family: inherit;
  color: var(--m-text);
  cursor: pointer;
}
.ma-tab.active {
  background: var(--m-primary);
  color: #fff;
  border-color: var(--m-primary);
}
.ma-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 8px;
}
.ma-list-item {
  text-align: left;
  width: 100%;
  border: 1px solid var(--m-border);
  border-radius: 12px;
  background: #fff;
  padding: 12px 14px;
  font-family: inherit;
  cursor: pointer;
}
.ma-list-item.static { cursor: default; }
.ma-list-item:not(.static):active { background: #f3f4f6; }
.ma-li-title { font-weight: 800; font-size: 0.95rem; color: var(--m-text); }
.ma-li-sub { font-size: 0.8rem; color: var(--m-muted); margin-top: 4px; line-height: 1.35; }
.ma-mono { font-family: ui-monospace, monospace; }
.ma-pay-sum {
  background: #e8f5ef;
  border-radius: 12px;
  padding: 12px 14px;
  font-size: 0.95rem;
  color: var(--m-primary);
}
.m-select {
  width: 100%;
  min-height: 52px;
  font-size: 16px;
  padding: 12px 14px;
  border: 1px solid var(--m-border);
  border-radius: 12px;
  background: #fff;
  font-family: inherit;
}

.m-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--m-primary);
  color: #fff;
  padding: calc(12px + var(--m-safe-t)) 16px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.m-header .brand {
  font-weight: 800;
  font-size: 1.05rem;
  letter-spacing: -0.3px;
}

.m-header .meta {
  font-size: 0.72rem;
  opacity: 0.9;
  text-align: right;
}

.m-header button {
  background: rgba(255,255,255,0.18);
  border: 1px solid rgba(255,255,255,0.3);
  color: #fff;
  border-radius: 20px;
  padding: 6px 12px;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
}

.m-main {
  max-width: 480px;
  margin: 0 auto;
  padding: 16px;
}

.m-card {
  background: var(--m-surface);
  border: 1px solid var(--m-border);
  border-radius: var(--m-radius);
  padding: 18px;
  margin-bottom: 14px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.04);
}

.m-title {
  margin: 0 0 8px;
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--m-primary);
}

.m-sub {
  margin: 0 0 16px;
  color: var(--m-muted);
  font-size: 0.9rem;
  line-height: 1.45;
}

.m-field {
  margin-bottom: 12px;
}

.m-field label {
  display: block;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--m-muted);
  margin-bottom: 6px;
}

.m-field input {
  width: 100%;
  min-height: 52px;
  font-size: 16px;
  padding: 12px 14px;
  border: 1px solid var(--m-border);
  border-radius: 12px;
  outline: none;
}

.m-field input:focus {
  border-color: var(--m-primary);
  box-shadow: 0 0 0 3px rgba(111, 154, 134, 0.16);
}

.m-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-height: 54px;
  border: none;
  border-radius: 14px;
  font-size: 1.05rem;
  font-weight: 800;
  cursor: pointer;
  font-family: inherit;
}

.m-btn-primary {
  background: var(--m-primary);
  color: #fff;
  box-shadow: 0 6px 16px rgba(111, 154, 134, 0.24);
}

.m-btn-primary:active { background: var(--m-primary-hover); }

.m-btn-accent {
  background: var(--m-accent);
  color: #fff;
}

.m-btn-ghost {
  background: #f0f0ec;
  color: var(--m-text);
  border: 1px solid var(--m-border);
}

.m-btn-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 10px;
}

.m-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.m-product-name {
  font-size: 1.15rem;
  font-weight: 800;
  line-height: 1.35;
  margin: 0 0 8px;
}

.m-barcode {
  font-size: 0.85rem;
  color: var(--m-muted);
  font-family: ui-monospace, monospace;
  margin-bottom: 12px;
}

.m-price-online {
  font-size: 0.95rem;
  color: var(--m-muted);
  margin: 0 0 4px;
}

.m-price-final {
  font-size: 2rem;
  font-weight: 900;
  color: var(--m-danger);
  letter-spacing: -0.5px;
  margin: 0;
}

.m-hint {
  font-size: 0.78rem;
  color: var(--m-muted);
  background: #f8f8f5;
  border-radius: 10px;
  padding: 10px 12px;
  line-height: 1.45;
  margin-top: 12px;
}

.m-hidden { display: none !important; }

.m-status {
  font-size: 0.8rem;
  padding: 8px 12px;
  border-radius: 10px;
  margin-bottom: 12px;
}

.m-status.ok { background: #eef7f2; color: var(--m-primary); }
.m-status.err { background: #fdecea; color: var(--m-danger); }
.m-status.info { background: #f5f0ea; color: #8b5e3c; }

/* Scanner overlay — full screen dark for better contrast */
.m-scanner {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: #0a0a0a;
  display: flex;
  flex-direction: column;
  padding: var(--m-safe-t) 0 var(--m-safe-b);
}

.m-scanner.m-hidden { display: none !important; }

.m-scanner-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 14px;
  color: #fff;
}

.m-scanner-top h2 {
  margin: 0;
  font-size: 1rem;
  font-weight: 800;
}

.m-scanner-top button {
  background: rgba(255,255,255,0.15);
  border: none;
  color: #fff;
  border-radius: 20px;
  padding: 8px 14px;
  font-weight: 700;
  font-size: 0.85rem;
}

#mScannerReader {
  flex: 1;
  min-height: 0;
  width: 100%;
  background: #000;
  position: relative;
}

#mScannerReader video {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
}

.m-scan-guide {
  position: absolute;
  left: 3%;
  right: 3%;
  top: 30%;
  height: 22%;
  border: 2px solid rgba(110, 255, 196, 0.9);
  border-radius: 10px;
  pointer-events: none;
  box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.28);
}

.m-scanner-tip {
  color: rgba(255,255,255,0.85);
  font-size: 0.8rem;
  text-align: center;
  padding: 8px 16px;
  line-height: 1.4;
}

.m-scanner-controls {
  padding: 12px 14px calc(12px + var(--m-safe-b));
  background: #111;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.m-scanner-controls .m-btn {
  min-height: 48px;
  font-size: 0.95rem;
}

.m-torch-on {
  background: #e6a23c !important;
  color: #1a1a1a !important;
}

.m-zoom-row {
  display: flex;
  gap: 8px;
}

.m-zoom-row button {
  flex: 1;
  min-height: 40px;
  border-radius: 10px;
  border: 1px solid #333;
  background: #222;
  color: #fff;
  font-weight: 700;
  font-size: 0.8rem;
}

.m-zoom-row button.active {
  background: var(--m-primary);
  border-color: var(--m-primary);
}

.m-suggest {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% - 2px);
  z-index: 30;
  background: #fff;
  border: 1px solid var(--m-border);
  border-radius: 10px;
  max-height: 240px;
  overflow-y: auto;
  box-shadow: 0 8px 20px rgba(18, 53, 47, 0.12);
}
.m-suggest.m-hidden { display: none !important; }
.m-suggest-item {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  border-bottom: 1px solid #f0f2f1;
  cursor: pointer;
  text-align: left;
  width: 100%;
  background: #fff;
  border-left: none;
  border-right: none;
  border-top: none;
  font-family: inherit;
}
.m-suggest-item:last-child { border-bottom: none; }
.m-suggest-item:active { background: #eef7f2; }
.m-suggest-name {
  font-weight: 800;
  font-size: 0.9rem;
  color: #12352F;
}
.m-suggest-barcode {
  font-size: 0.75rem;
  color: #2A554C;
  margin-top: 2px;
  font-variant-numeric: tabular-nums;
}
.m-suggest-price {
  font-weight: 800;
  font-size: 0.82rem;
  color: #12352F;
  white-space: nowrap;
}

.m-test-log {
  list-style: none;
  padding: 0;
  margin: 10px 0 0;
  max-height: 200px;
  overflow-y: auto;
  font-size: 0.78rem;
  line-height: 1.45;
  background: #f4f6f5;
  border-radius: 10px;
  color: #12352F;
}
.m-test-log:empty { display: none; }
.m-test-log li {
  padding: 8px 10px;
  border-bottom: 1px solid #e5e8e6;
}
.m-test-log li:last-child { border-bottom: none; }
.m-test-log li.ok { color: #1b5e4a; }
.m-test-log li.err { color: #8b1e1e; }
.m-test-log li.info { color: #2A554C; }

.m-footer-link {
  text-align: center;
  margin-top: 20px;
  font-size: 0.85rem;
}

.m-footer-link a {
  color: var(--m-primary);
  font-weight: 700;
}

#mLabelCanvas { display: none; }

.m-print-preview-wrap {
  background: #F8FAFC;
  border: 1.5px dashed #CBD5E1;
  border-radius: 12px;
  padding: 12px;
  text-align: center;
}

.m-print-preview-wrap img {
  max-width: 100%;
  height: auto;
  background: #fff;
  border-radius: 4px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

/* 하단 수정 시트 */
.m-sheet {
  position: fixed;
  inset: 0;
  z-index: 900;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}

.m-sheet.m-hidden {
  display: none !important;
}

.m-sheet-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
}

.m-sheet-panel {
  position: relative;
  background: var(--m-surface);
  border-radius: 18px 18px 0 0;
  padding: 20px 16px calc(20px + var(--m-safe-b));
  max-height: 88vh;
  overflow-y: auto;
  box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.12);
  animation: mSheetUp 0.22s ease-out;
}

@keyframes mSheetUp {
  from { transform: translateY(24px); opacity: 0.6; }
  to { transform: translateY(0); opacity: 1; }
}

/* Mobile chat sticker — PC와 동일: 배경/테두리/그림자 없음 */
.chat-sticker,
.m-chat-bubble .chat-sticker,
.m-chat-sticker-grid img {
  display: inline-block;
  width: 72px;
  height: 72px;
  vertical-align: middle;
  margin: 0 1px;
  background: transparent !important;
  background-color: transparent !important;
  border: none !important;
  box-shadow: none !important;
  border-radius: 0 !important;
  padding: 0 !important;
  object-fit: contain;
}
.m-chat-sticker-grid img {
  width: 48px;
  height: 48px;
}
.m-chat-msg.mine .m-chat-bubble.m-chat-bubble-sticker-only,
.m-chat-msg.other .m-chat-bubble.m-chat-bubble-sticker-only,
.m-chat-msg.mine .m-chat-bubble.m-chat-bubble-sticker-status,
.m-chat-msg.other .m-chat-bubble.m-chat-bubble-sticker-status {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  padding: 2px 0 !important;
  color: #0f172a !important;
}

/* P1 모바일 업무카드 / 상품카드 / 모달 연동 스타일 */
.chat-rich-attach {
  margin-top: 4px;
  max-width: 100%;
}
.chat-task-card, .chat-product-card {
  background: #ffffff !important;
  color: #0f172a !important;
  -webkit-text-fill-color: #0f172a !important;
  border: 1px solid #e2e8f0 !important;
  border-radius: 12px;
  padding: 10px 12px;
  min-width: 180px;
  max-width: 280px;
  box-shadow: 0 2px 8px rgba(15,23,42,0.06);
  font-family: var(--font-ui), 'NanumSquareNeo', sans-serif;
  margin-top: 4px;
  box-sizing: border-box;
}
.chat-task-card.is-done { opacity: 0.92; background: #f8fafc !important; }
.chat-task-card-top, .chat-product-card-top {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 4px;
}
.chat-task-icon { font-size: 1.15rem; color: #0f172a; -webkit-text-fill-color: #0f172a; }
.chat-task-badge {
  font-size: 0.68rem; font-weight: 800; padding: 2px 7px;
  border-radius: 999px; background: #fef3c7; color: #92400e;
  -webkit-text-fill-color: #92400e;
}
.chat-task-card.is-done .chat-task-badge {
  background: #dcfce7 !important; color: #166534 !important; -webkit-text-fill-color: #166534 !important;
}
.chat-task-title {
  font-weight: 800; font-size: 0.95rem; margin-bottom: 4px;
  color: #0f172a; -webkit-text-fill-color: #0f172a;
}
.chat-task-hint {
  font-size: 0.8rem; color: #475569; -webkit-text-fill-color: #475569; line-height: 1.4;
}
.chat-task-note {
  margin-top: 6px; font-size: 0.8rem; color: #334155; -webkit-text-fill-color: #334155;
  background: #f1f5f9; border-radius: 8px; padding: 6px 8px; white-space: pre-wrap;
}
.chat-task-done-by {
  margin-top: 6px; font-size: 0.75rem; color: #166534; -webkit-text-fill-color: #166534; font-weight: 700;
}
.chat-task-done-btn, .chat-product-open-btn, .chat-product-label-btn, .chat-task-find-btn, .chat-task-label-btn, .chat-task-nav-btn {
  margin-top: 6px; width: 100%; border: none; border-radius: 8px;
  padding: 8px 10px; font-size: 0.82rem; font-weight: 700; cursor: pointer;
  background: var(--m-primary, #6F9A86); color: #fff; -webkit-text-fill-color: #fff;
  font-family: inherit;
}
.chat-product-open-btn, .chat-task-find-btn { background: #0f766e !important; }
.chat-product-label-btn, .chat-task-label-btn { background: #166534 !important; }
.chat-task-nav-btn { background: #475569 !important; }
.chat-product-card-label {
  font-size: 0.72rem; font-weight: 800; color: #0f766e; -webkit-text-fill-color: #0f766e;
}
.chat-product-grade {
  font-size: 0.7rem; font-weight: 800; background: #e0e7ff; color: #3730a3;
  -webkit-text-fill-color: #3730a3; border-radius: 6px; padding: 1px 6px;
}
.chat-product-card-name {
  font-weight: 800; font-size: 0.9rem; margin: 2px 0; line-height: 1.3;
  color: #0f172a; -webkit-text-fill-color: #0f172a;
}
.chat-product-card-bc {
  font-family: ui-monospace, monospace; font-size: 0.78rem;
  color: #475569; -webkit-text-fill-color: #475569;
}
.chat-product-card-prices {
  display: flex; flex-direction: column; gap: 2px;
  margin-top: 6px; font-size: 0.78rem;
  color: #334155; -webkit-text-fill-color: #334155;
}
.chat-product-card-prices span { color: #334155; -webkit-text-fill-color: #334155; }
.chat-product-card-prices .sale { color: #b45309; -webkit-text-fill-color: #b45309; font-weight: 700; }

.chat-feature-modal {
  position: fixed; inset: 0; z-index: 100150;
  background: rgba(15, 23, 42, 0.5);
  display: flex; align-items: center; justify-content: center;
  padding: 16px;
}
.chat-feature-modal.hidden { display: none !important; }
.chat-feature-card {
  width: min(440px, 100%); max-height: min(88vh, 640px);
  overflow-y: auto; background: #fff; border-radius: 16px;
  box-shadow: 0 20px 50px rgba(0,0,0,0.25);
  padding: 18px 16px;
  font-family: var(--font-ui), 'NanumSquareNeo', sans-serif;
  box-sizing: border-box;
}
.chat-feature-head {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 6px;
}
.chat-feature-head strong { font-size: 1rem; color: #0f172a; }
.chat-feature-close {
  border: none; background: #f1f5f9; color: #64748b;
  width: 30px; height: 30px; border-radius: 999px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.chat-feature-hint { margin: 0 0 10px; font-size: 0.8rem; color: #64748b; line-height: 1.4; }
.chat-feature-label { display: block; font-size: 0.78rem; font-weight: 700; color: #475569; margin: 8px 0 4px; }
.chat-feature-card textarea,
.chat-product-lookup-row input {
  width: 100%; box-sizing: border-box; border: 1px solid #e2e8f0;
  border-radius: 10px; padding: 8px 10px; font-size: 0.88rem;
  font-family: inherit; resize: vertical;
}
.chat-feature-actions {
  display: flex; justify-content: flex-end; gap: 8px; margin-top: 12px;
}
.chat-feature-actions button {
  border: none; border-radius: 10px; padding: 8px 14px;
  font-size: 0.86rem; font-weight: 700; cursor: pointer; font-family: inherit;
}
.chat-feature-actions .cancel { background: #f1f5f9; color: #475569; }
.chat-feature-actions .ok { background: var(--m-primary, #6F9A86); color: #fff; }
.chat-feature-actions .ok:disabled { opacity: 0.5; cursor: not-allowed; }
.chat-task-template-list {
  display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 4px;
}
@media (max-width: 380px) {
  .chat-task-template-list { grid-template-columns: 1fr; }
}
.chat-task-template-btn {
  display: flex; flex-direction: column; align-items: flex-start; gap: 2px;
  text-align: left; border: 1px solid #e2e8f0; background: #f8fafc;
  border-radius: 10px; padding: 10px; cursor: pointer; font-family: inherit;
}
.chat-task-template-btn.active {
  border-color: var(--m-primary, #6F9A86);
  background: #eef7f2; box-shadow: 0 0 0 1px var(--m-primary, #6F9A86);
}
.chat-task-template-btn .ico { font-size: 1.1rem; }
.chat-task-template-btn .tit { font-size: 0.82rem; font-weight: 800; color: #0f172a; }
.chat-task-template-btn .hint { font-size: 0.7rem; color: #64748b; line-height: 1.3; }
.chat-product-lookup-row {
  display: flex; gap: 8px; margin-bottom: 10px;
}
.chat-product-lookup-row input { flex: 1; }
.chat-product-lookup-row .ok {
  border: none; border-radius: 10px; padding: 0 14px;
  background: #0f766e; color: #fff; font-weight: 700; cursor: pointer;
  font-family: inherit; white-space: nowrap;
}
.chat-product-preview-box {
  min-height: 80px; border: 1px dashed #cbd5e1; border-radius: 12px;
  padding: 10px; background: #f8fafc;
}
.chat-product-preview-box.empty {
  display: flex; align-items: center; justify-content: center;
  color: #94a3b8; font-size: 0.84rem;
}

/* P2: 모바일 게시판 공지 카드 & 검색 필터 */
.chat-board-card {
  background: #ffffff !important;
  color: #0f172a !important;
  -webkit-text-fill-color: #0f172a !important;
  border: 1px solid #e2e8f0 !important;
  border-radius: 12px;
  padding: 10px 12px;
  min-width: 200px;
  max-width: 280px;
  box-shadow: 0 2px 8px rgba(15,23,42,0.06);
  font-family: var(--font-ui), 'NanumSquareNeo', sans-serif;
  margin-top: 4px;
  box-sizing: border-box;
}
.chat-board-card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
}
.chat-board-badge {
  font-size: 0.68rem;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 6px;
}
.chat-board-badge.is-notice {
  background: #fee2e2 !important;
  color: #b91c1c !important;
  -webkit-text-fill-color: #b91c1c !important;
}
.chat-board-badge.is-handover {
  background: #e0f2fe !important;
  color: #0369a1 !important;
  -webkit-text-fill-color: #0369a1 !important;
}
.chat-board-author {
  font-size: 0.72rem;
  color: #64748b !important;
  -webkit-text-fill-color: #64748b !important;
  font-weight: 700;
}
.chat-board-title {
  font-weight: 800;
  font-size: 0.92rem;
  line-height: 1.3;
  color: #0f172a !important;
  -webkit-text-fill-color: #0f172a !important;
  margin-bottom: 4px;
}
.chat-board-summary {
  font-size: 0.78rem;
  line-height: 1.4;
  color: #334155 !important;
  -webkit-text-fill-color: #334155 !important;
  background: #f8fafc;
  padding: 5px 8px;
  border-radius: 6px;
  margin-bottom: 6px;
  white-space: pre-wrap;
}
.chat-board-card-thumb {
  margin-bottom: 6px;
  border-radius: 6px;
  overflow: hidden;
  max-height: 120px;
}
.chat-board-card-thumb img {
  width: 100%;
  max-height: 120px;
  object-fit: cover;
  display: block;
}
.chat-board-view-btn {
  width: 100%;
  border: none;
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 0.82rem;
  font-weight: 800;
  cursor: pointer;
  background: var(--m-primary, #6F9A86) !important;
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
  font-family: inherit;
}

.m-chat-search-wrap {
  border-bottom: 1px solid #e2e8f0;
  background: #f8fafc;
  padding: 6px 10px;
}
.m-chat-search-bar {
  display: flex;
  gap: 6px;
  align-items: center;
}
.m-chat-search-input {
  flex: 1;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  padding: 6px 10px;
  font-size: 0.82rem;
  background: #ffffff;
  color: #0f172a;
  font-family: inherit;
}
.m-chat-search-filter-btn {
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  padding: 6px 10px;
  background: #ffffff;
  color: #475569;
  font-size: 0.78rem;
  font-weight: 800;
  cursor: pointer;
  white-space: nowrap;
}
.m-chat-search-filter-btn.active {
  background: var(--m-primary, #006241) !important;
  color: #ffffff !important;
  border-color: var(--m-primary, #006241) !important;
}
.m-chat-search-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
  align-items: center;
}
.m-chat-filter-select {
  flex: 1;
  min-width: 90px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  padding: 4px 6px;
  font-size: 0.74rem;
  background: #ffffff;
  color: #1e293b;
  font-family: inherit;
}
.m-chat-filter-reset {
  border: 1px solid #cbd5e1;
  background: #ffffff;
  color: #64748b;
  font-size: 0.74rem;
  font-weight: 700;
  border-radius: 6px;
  padding: 4px 8px;
  cursor: pointer;
}

/* 톡 사진 확대 — m.html은 styles.css를 안 쓰므로 여기서 숨김·전체화면 처리 */
.refy-lightbox-modal[hidden],
.refy-lightbox-modal.hidden {
  display: none !important;
}
.refy-lightbox-modal {
  position: fixed;
  inset: 0;
  z-index: 200000;
  display: flex;
  flex-direction: column;
  font-family: var(--font-ui), 'NanumSquareNeo', sans-serif;
  user-select: none;
}
.refy-lightbox-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.92);
}
.refy-lightbox-wrap {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  z-index: 1;
}
.refy-lightbox-header {
  min-height: 52px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  padding: 8px 12px;
  background: rgba(15, 23, 42, 0.85);
  color: #ffffff;
}
.refy-lightbox-info {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.88rem;
}
.refy-lightbox-index {
  font-weight: 800;
  background: rgba(255, 255, 255, 0.15);
  padding: 3px 8px;
  border-radius: 6px;
}
.refy-lightbox-title {
  color: #e2e8f0;
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.refy-lightbox-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.refy-lightbox-btn {
  border: none;
  border-radius: 8px;
  padding: 6px 10px;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  background: rgba(255, 255, 255, 0.15);
  color: #ffffff;
}
.refy-lightbox-btn.label { background: #0f766e; }
.refy-lightbox-btn.close { background: rgba(239, 68, 68, 0.8); }
.refy-lightbox-viewport {
  flex: 1;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.refy-lightbox-stage img {
  max-width: 90vw;
  max-height: 70vh;
  object-fit: contain;
}
.refy-lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.2);
  color: #ffffff;
  font-size: 1.6rem;
  z-index: 5;
}
.refy-lightbox-nav.prev { left: 10px; }
.refy-lightbox-nav.next { right: 10px; }
.refy-lightbox-footer {
  min-height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(15, 23, 42, 0.85);
  color: #cbd5e1;
  font-size: 0.78rem;
  padding: 6px 10px;
}

