:root {
  --sa-blue: #1a5fb4;
  --sa-bg: #f4f6f9;
  --sa-card: #fff;
  --sa-line: #e2e8f0;
  --sa-text: #1e293b;
  --sa-muted: #64748b;
}
* { box-sizing: border-box; }
body.sa-admin, body.sa-chat-page {
  margin: 0;
  font-family: "Pretendard", "Noto Sans KR", "Apple SD Gothic Neo", sans-serif;
  background: var(--sa-bg);
  color: var(--sa-text);
}
.sa-admin-head { padding: 20px 16px 8px; max-width: 960px; margin: 0 auto; }
.sa-admin-head h1 { margin: 0 0 6px; font-size: 1.4rem; }
.sa-meta, .sa-hint { color: var(--sa-muted); font-size: .85rem; line-height: 1.5; }
.sa-card {
  background: var(--sa-card);
  border: 1px solid var(--sa-line);
  border-radius: 12px;
  padding: 16px;
  margin: 12px auto;
  max-width: 960px;
}
.sa-card h2 { margin: 0 0 12px; font-size: 1.05rem; }
.sa-btn {
  appearance: none; border: 0; background: var(--sa-blue); color: #fff;
  padding: 8px 14px; border-radius: 8px; cursor: pointer; font-weight: 600; margin: 4px 4px 4px 0;
}
.sa-btn-muted { background: #64748b; }
.sa-form label { display: block; margin: 8px 0; font-size: .9rem; }
.sa-form input[type=text], .sa-form input[type=search], .sa-form input:not([type]) {
  display: block; width: 100%; max-width: 420px; margin-top: 4px; padding: 8px 10px;
  border: 1px solid var(--sa-line); border-radius: 8px;
}
.sa-table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.sa-table th, .sa-table td { border-bottom: 1px solid var(--sa-line); padding: 8px 6px; text-align: left; }
.sa-icon-preview { width: 48px; height: 48px; object-fit: cover; border-radius: 10px; vertical-align: middle; }

/* floating dock on main site */
.sa-dock {
  position: fixed; right: 14px; bottom: 70px; z-index: 99990;
  display: flex; flex-direction: column; gap: 8px; align-items: flex-end;
}
.sa-dock a, .sa-dock button {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--sa-blue); color: #fff; border: 0; border-radius: 999px;
  padding: 10px 14px; font-size: .85rem; font-weight: 600; text-decoration: none; cursor: pointer;
  box-shadow: 0 4px 16px rgba(26,95,180,.35);
}
.sa-dock .sa-install { background: #0f766e; display: none; }
.sa-dock .sa-install.show { display: inline-flex; }

/* beforeinstallprompt ?? ?? ?? (workhub ???) */
.sa-install-banner {
  position: fixed;
  left: 12px;
  right: 12px;
  bottom: 18px;
  z-index: 99995;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: #0f172a;
  color: #f8fafc;
  border-radius: 14px;
  box-shadow: 0 10px 30px rgba(15, 23, 42, .35);
  max-width: 420px;
  margin: 0 auto;
  animation: sa-install-in .28s ease-out;
}
.sa-install-banner__body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.sa-install-banner__body strong {
  font-size: .92rem;
}
.sa-install-banner__body span {
  font-size: .78rem;
  color: #94a3b8;
  line-height: 1.35;
}
.sa-install-banner__actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}
.sa-install-banner__yes {
  appearance: none;
  border: 0;
  background: #0f766e;
  color: #fff;
  font-weight: 700;
  font-size: .85rem;
  padding: 8px 14px;
  border-radius: 999px;
  cursor: pointer;
}
.sa-install-banner__no {
  appearance: none;
  border: 0;
  background: transparent;
  color: #94a3b8;
  font-size: 1rem;
  width: 32px;
  height: 32px;
  border-radius: 999px;
  cursor: pointer;
}
@keyframes sa-install-in {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}
@media (max-width: 480px) {
  .sa-install-banner { bottom: 78px; }
}

/* ?? ??(??) ?? ? ??? ? ?? */
.sa-push-banner {
  border-color: #93c5fd;
  background: #eff6ff;
}
.sa-push-banner .sa-install-banner__yes {
  background: #1a5fb4;
}

/* chat */
.sa-chat-top {
  display: flex; align-items: center; gap: 8px; padding: 10px 12px;
  background: var(--sa-blue); color: #fff; position: sticky; top: 0; z-index: 5;
}
.sa-chat-top h1 { flex: 1; margin: 0; font-size: 1.05rem; }
.sa-back { color: #fff; text-decoration: none; font-size: 1.2rem; padding: 4px 8px; }
.sa-icon-btn { background: transparent; border: 0; color: #fff; font-size: 1.4rem; cursor: pointer; }
.sa-chat-layout { display: grid; grid-template-columns: 280px 1fr; min-height: calc(100vh - 48px); }
@media (max-width: 720px) {
  .sa-chat-layout { grid-template-columns: 1fr; }
  .sa-chat-rooms.hidden-mobile { display: none; }
  .sa-chat-main:not([hidden]) ~ .sa-chat-rooms { display: none; }
}
.sa-chat-rooms { border-right: 1px solid var(--sa-line); background: #fff; overflow: auto; max-height: calc(100vh - 48px); }
.sa-room {
  display: block; width: 100%; text-align: left; border: 0; border-bottom: 1px solid var(--sa-line);
  background: #fff; padding: 12px; cursor: pointer;
}
.sa-room.active { background: #eff6ff; }
.sa-room .name { font-weight: 600; }
.sa-room .prev { color: var(--sa-muted); font-size: .8rem; margin-top: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sa-chat-main { display: flex; flex-direction: column; min-height: calc(100vh - 48px); background: #eef2f7; }
.sa-chat-main[hidden] { display: none !important; }
.sa-chat-msgs { flex: 1; overflow: auto; padding: 12px; display: flex; flex-direction: column; gap: 8px; }
.sa-bubble { max-width: 78%; padding: 8px 12px; border-radius: 14px; background: #fff; align-self: flex-start; box-shadow: 0 1px 2px rgba(0,0,0,.06); }
.sa-bubble.me { align-self: flex-end; background: #dbeafe; }
.sa-bubble .who { font-size: .7rem; color: var(--sa-muted); margin-bottom: 2px; }
.sa-chat-compose { display: flex; gap: 8px; padding: 10px; background: #fff; border-top: 1px solid var(--sa-line); }
.sa-chat-compose input { flex: 1; border: 1px solid var(--sa-line); border-radius: 20px; padding: 10px 14px; }
.sa-chat-compose button { background: var(--sa-blue); color: #fff; border: 0; border-radius: 20px; padding: 0 16px; font-weight: 600; }
.sa-chat-empty { padding: 40px; text-align: center; color: var(--sa-muted); }
.sa-hits button { display: block; width: 100%; text-align: left; padding: 8px; border: 0; border-bottom: 1px solid var(--sa-line); background: #fff; cursor: pointer; }
dialog { border: 1px solid var(--sa-line); border-radius: 12px; padding: 16px; max-width: 420px; width: calc(100% - 24px); }

/* ????? ???? ? ????? ??? ???? */
.sa-ib-board-toolbar {
  display: flex; flex-wrap: wrap; gap: 8px; align-items: center;
  margin: 10px 0; padding: 10px; background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 8px;
}
.sa-ib-board-toolbar .form-control { display: inline-block; width: auto; min-width: 140px; }
.sa-ib-board-toolbar #saBoardFilter { min-width: 180px; max-width: 260px; }
.sa-ib-inline { display: inline-flex; align-items: center; gap: 4px; margin: 0; font-weight: normal; font-size: 12px; white-space: nowrap; }
.sa-ib-inline select.form-control { min-width: 72px; }
.sa-ib-sep { width: 1px; height: 20px; background: #cbd5e1; margin: 0 2px; }
.sa-ib-count { margin-left: auto; font-size: 12px; color: #64748b; }
.sa-ib-board-wrap { max-height: 480px; overflow: auto; border: 1px solid #e2e8f0; border-radius: 8px; }
.sa-ib-table { margin: 0; }
.sa-ib-table th { position: sticky; top: 0; background: #fff; z-index: 1; white-space: nowrap; }
.sa-ib-th-check label { font-weight: 600; margin: 0; cursor: pointer; }
.sa-ib-lvhint { display: inline-block; margin-left: 4px; font-size: 11px; color: #94a3b8; }
.sa-ib-minlevel { min-width: 88px; max-width: 110px; padding: 2px 4px; height: auto; }
.sa-ib-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.sa-ib-tab.is-active { font-weight: 700; }
.sa-ib-tab-panel[hidden] { display: none !important; }
.sa-ib-tab-panel { margin-top: 4px; }


/* 휴대폰 알림 창 — 테마 제목/버튼 스타일에 덮이지 않게 고정 */
#saPushPanel.sa-push-panel[hidden] { display: none !important; }
#saPushPanel.sa-push-panel {
  position: fixed !important;
  left: 0; right: 0; top: 0; bottom: 0;
  z-index: 200000 !important;
  display: flex !important;
  align-items: center;
  justify-content: center;
  padding: 16px;
  box-sizing: border-box;
  font-family: "Malgun Gothic", "Apple SD Gothic Neo", sans-serif;
}
#saPushPanel .sa-push-panel__backdrop {
  position: absolute; left: 0; right: 0; top: 0; bottom: 0;
  background: rgba(15, 23, 42, .45);
}
#saPushPanel .sa-push-panel__card {
  position: relative;
  width: 100%;
  max-width: 360px;
  background: #fff;
  color: #1e293b;
  border-radius: 16px;
  padding: 18px 18px 14px;
  box-shadow: 0 18px 50px rgba(15, 23, 42, .28);
  box-sizing: border-box;
}
#saPushPanel .sa-push-panel__title {
  margin: 0 0 10px !important;
  padding: 0 !important;
  font-size: 18px !important;
  line-height: 1.3 !important;
  font-weight: 700 !important;
  letter-spacing: 0 !important;
  color: #0f172a !important;
  font-family: inherit !important;
}
#saPushPanel .sa-push-panel__status {
  margin: 0 0 14px !important;
  padding: 10px 12px !important;
  font-size: 14px !important;
  line-height: 1.5 !important;
  color: #334155 !important;
  background: #f8fafc;
  border-radius: 10px;
}
#saPushPanel .sa-push-panel__actions {
  display: flex;
  gap: 8px;
}
#saPushPanel button.sa-push-panel__on,
#saPushPanel button.sa-push-panel__off,
#saPushPanel button.sa-push-panel__close {
  appearance: none;
  -webkit-appearance: none;
  border: 0 !important;
  border-radius: 10px !important;
  cursor: pointer;
  font-weight: 700 !important;
  font-size: 15px !important;
  line-height: 1.2 !important;
  font-family: inherit !important;
  box-shadow: none !important;
  float: none !important;
}
#saPushPanel button.sa-push-panel__on,
#saPushPanel button.sa-push-panel__off {
  flex: 1;
  margin: 0 !important;
  padding: 12px 10px !important;
  color: #fff !important;
}
#saPushPanel button.sa-push-panel__on { background: #0f766e !important; }
#saPushPanel button.sa-push-panel__off { background: #64748b !important; }
#saPushPanel .sa-push-panel__hint {
  margin: 12px 0 0 !important;
  font-size: 12px !important;
  line-height: 1.45 !important;
  color: #64748b !important;
}
#saPushPanel .sa-push-panel__more {
  display: inline-block;
  margin-top: 8px;
  font-size: 13px !important;
  color: #1a5fb4 !important;
}
#saPushPanel button.sa-push-panel__close {
  display: block;
  width: 100%;
  margin: 12px 0 0 !important;
  padding: 8px 0 !important;
  background: transparent !important;
  color: #475569 !important;
}

#saPushPanel .sa-push-switch {
  display: flex !important;
  align-items: center;
  gap: 12px;
  margin: 0 0 12px !important;
  cursor: pointer;
  font-weight: 700 !important;
  font-size: 15px !important;
  line-height: 1.2 !important;
}
#saPushPanel .sa-push-switch input {
  position: absolute !important;
  opacity: 0 !important;
  width: 1px !important;
  height: 1px !important;
  margin: 0 !important;
}
#saPushPanel .sa-push-switch__track {
  width: 52px;
  height: 30px;
  border-radius: 999px;
  background: #cbd5e1;
  position: relative;
  flex: 0 0 auto;
  transition: background .15s ease;
}
#saPushPanel .sa-push-switch__track:after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #fff;
  transition: transform .15s ease;
  box-shadow: 0 1px 3px rgba(15, 23, 42, .25);
}
#saPushPanel .sa-push-switch input:checked + .sa-push-switch__track { background: #0f766e; }
#saPushPanel .sa-push-switch input:checked + .sa-push-switch__track:after { transform: translateX(22px); }
#saPushPanel .sa-push-switch input:disabled + .sa-push-switch__track { opacity: .55; }
#saPushPanel .sa-push-switch__text { color: #334155; }
#saPushPanel[data-state="on"] .sa-push-switch__text { color: #0f766e; }
#saPushPanel[data-state="blocked"] .sa-push-switch__text { color: #c2410c; }
#saPushPanel .sa-push-panel__block {
  margin: 0 0 12px !important;
  padding: 10px 12px !important;
  background: #fff7ed;
  border: 1px solid #fdba74;
  border-radius: 10px;
  font-size: 13px !important;
  line-height: 1.55 !important;
  color: #7c2d12;
}
#saPushPanel .sa-push-panel__block[hidden] { display: none !important; }
#saPushPanel .sa-push-panel__block b { display: block; margin-bottom: 4px; }
#saPushPanel .sa-push-panel__block p { margin: 0 0 6px !important; }
#saPushPanel .sa-push-panel__block ol { margin: 0 0 0 18px !important; padding: 0 !important; }

.sa-icon-frame {
  width: 72px;
  height: 72px;
  border-radius: 16px;
  overflow: hidden;
  background: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: inset 0 0 0 1px rgba(15, 23, 42, .08);
}
.sa-icon-frame .sa-icon-live {
  width: 100%;
  height: 100%;
  object-fit: contain;
  transform: scale(var(--sa-icon-scale, 1));
  transform-origin: center center;
}
