* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Pretendard", "Malgun Gothic", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: transparent;
  display: block; /* Removes flex to allow proper sizing */
  width: 1230px; /* 명시적 너비 설정으로 모바일 환경에서 잘림 방지 */
  min-height: 100vh;
  padding: 0 0 0 55px; /* left padding to prevent character clipping */
}

/* mobile portrait export frame (1080x1920) */
body.export {
  width: 1080px;
  height: 1920px;
  min-height: 1920px;
  padding: 0;
  overflow: hidden;
  background: linear-gradient(180deg, #eef2f8 0%, #e3e9f5 100%);
}
body.export .stage-outer {
  transform: scale(.9);
}

.stage-outer {
  position: relative;
  width: 1155px;
}

.dashboard {
  width: 1155px;
  background: #ffffff;
  border-radius: 12px;
  box-shadow: 0 20px 60px rgba(20, 30, 60, 0.12);
  padding: 18px 20px 28px;
  position: relative;
  overflow: visible;
}

/* ---------- Top bar ---------- */
.topbar {
  display: flex;
  align-items: center;
  gap: 28px;
  padding-bottom: 14px;
  border-bottom: 1px solid #eef0f3;
}

.logo {
  display: flex;
  align-items: center;
  font-weight: 800;
  font-size: 18px;
  color: #1b1f27;
  white-space: nowrap;
}
.logo-dot {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #ff9a4d, #fc6817 60%, #ea5406);
  margin-right: 6px;
  display: inline-block;
}

.topnav {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: 1;
  font-size: 14px;
  color: #4a5565;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 8px 12px;
  border-radius: 8px;
  white-space: nowrap;
  position: relative;
}
.nav-item .ic { font-size: 13px; opacity: .8; }
.nav-item.active {
  background: #ecfdf5;
  color: #009966;
  font-weight: 700;
}
.badge-onboarding {
  position: absolute;
  top: -9px;
  right: -6px;
  background: #ffc233;
  color: #6b4400;
  font-size: 9px;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 8px;
  white-space: nowrap;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 14px;
}
.btn-green {
  background: #009966;
  color: #fff;
  border: none;
  font-size: 13px;
  font-weight: 700;
  padding: 9px 14px;
  border-radius: 8px;
  cursor: default;
}
.bell-icon {
  position: relative;
  background: none;
  border: none;
  font-size: 16px;
  cursor: default;
}
.badge-red {
  position: absolute;
  top: -6px;
  right: -8px;
  background: #fb2c36;
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  border-radius: 8px;
  padding: 1px 4px;
  min-width: 14px;
  text-align: center;
}
.user {
  font-size: 13px;
  color: #364153;
  font-weight: 600;
  white-space: nowrap;
}
.chev { font-size: 11px; opacity: .6; }

/* ---------- Action bar ---------- */
.actionbar {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 16px 0 18px;
}
.btn-outline {
  background: #fff;
  border: 1px solid #e5e7eb;
  color: #364153;
  font-size: 12.5px;
  font-weight: 600;
  padding: 7px 13px;
  border-radius: 8px;
  cursor: default;
}
#toggleAllBtn { transition: background .2s; }
#toggleAllBtn.pressed { background: #f3f4f6; }

/* ---------- Funnel ---------- */
.funnel {
  position: relative;
  display: flex;
  flex-direction: column;
}

.stage-row {
  position: relative;
  padding-top: 48px;
}
.stage-row:first-child { padding-top: 0; }

.connector {
  position: absolute;
  left: 16px;
  top: -48px;
  height: 48px;
  width: 1px;
  border-left: 1px dashed #d1d5dc;
}
.connector::after {
  content: "▾";
  position: absolute;
  left: -6px;
  top: 16px;
  font-size: 10px;
  color: #b0b5bf;
}

.card {
  border: 1.5px solid var(--accent);
  border-radius: 10px;
  background: #fff;
  transition: box-shadow .35s ease;
}
.stage-row.dashed .card { border-style: dashed; }

.card-header {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 8px 16px;
  cursor: default;
}
.chevron {
  color: #9aa1ac;
  font-size: 15px;
  width: 10px;
  transition: transform .3s ease;
}
.stage-row.open .chevron { transform: rotate(90deg); }

.stage-title {
  font-weight: 800;
  font-size: 15px;
  color: var(--title-color);
  white-space: nowrap;
}
.stage-desc {
  font-size: 13px;
  color: #6a7282;
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card-right {
  display: flex;
  align-items: center;
  gap: 10px;
  white-space: nowrap;
}
.member-count {
  font-size: 13px;
  color: #6a7282;
}
.member-count b {
  color: #1b1f27;
  font-weight: 800;
  display: inline-block;
  transition: transform .25s ease;
}
.member-count b.bump { transform: scale(1.35); }

.pill-btn {
  background: #fff;
  border: 1px solid #e5e7eb;
  color: #4a5565;
  font-size: 11.5px;
  font-weight: 600;
  padding: 4.5px 10px;
  border-radius: 7px;
  cursor: default;
  white-space: nowrap;
}

.card-body {
  max-height: 0;
  overflow: hidden;
  transition: max-height .85s cubic-bezier(.22,1,.36,1);
  padding: 0 16px;
}
.stage-row.open .card-body {
  padding: 2px 16px 16px;
}

.empty-state {
  font-size: 13px;
  color: #9aa1ac;
  text-align: center;
  padding: 22px 0 10px;
}

/* ---------- Member row (real markup, not a screenshot — always crisp) ---------- */
.member-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  border-top: 1px solid #f0f1f3;
  padding-top: 10px;
  margin-top: 2px;
}
.member-left { min-width: 0; }
.member-top {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.member-name { font-size: 14.5px; font-weight: 800; color: #101828; }
.member-phone { font-size: 12px; color: #6a7282; }
.member-count-badge {
  background: #f3f4f6;
  color: #99a1af;
  font-size: 10.5px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 999px;
}
.member-icon-phone { color: #009966; font-size: 11px; }
.member-miss-badge {
  background: #fffbeb;
  color: #c2410c;
  font-size: 10.5px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  white-space: nowrap;
}
.member-tags {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  color: #6a7282;
  margin-top: 5px;
}
.member-tags .sep { color: #d1d5dc; }
.member-memo {
  font-size: 12px;
  color: #6a7282;
  margin-top: 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.member-addmemo {
  font-size: 11.5px;
  color: #9aa1ac;
  margin-top: 5px;
}
.member-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  padding-top: 1px;
  white-space: nowrap;
}
.member-status { font-size: 12.5px; color: #6a7282; }
.member-status b { font-size: 15px; font-weight: 800; margin-right: 2px; }
.member-status.green b { color: #007a55; }
.member-status.red b { color: #f54a00; }
.member-icon-btn {
  width: 27px;
  height: 27px;
  border-radius: 50%;
  border: 1.3px solid #5ee9b5;
  color: #059669;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  background: #fff;
  cursor: default;
}
.member-btn {
  border: 1px solid #e5e7eb;
  color: #4a5565;
  font-size: 11px;
  font-weight: 600;
  padding: 5px 10px;
  border-radius: 7px;
  background: #fff;
  white-space: nowrap;
  cursor: default;
}
.member-btn.accent {
  border-color: #5ee9b5;
  color: #059669;
}

/* stage flash highlight */
.stage-row.flash .card {
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 55%, transparent);
}

/* ---------- Guide speech bubble: rides beside the character, explains the current stage ---------- */
.guide-bubble {
  position: absolute;
  left: 36px;
  top: 0;
  max-width: 78%;
  width: max-content;
  background: #1b1f27;
  color: #fff;
  border-radius: 14px;
  padding: 10px 14px;
  box-shadow: 0 8px 20px rgba(20,30,60,.25);
  opacity: 0;
  transform: translateY(6px) scale(.95);
  pointer-events: none;
  transition: opacity .5s ease, transform .5s ease, top .95s cubic-bezier(.45,0,.2,1);
  z-index: 7;
}
.guide-bubble::after {
  content: "";
  position: absolute;
  left: -7px;
  top: 16px;
  width: 0;
  height: 0;
  border-top: 7px solid transparent;
  border-bottom: 7px solid transparent;
  border-right: 8px solid #1b1f27;
}
.guide-bubble.visible { opacity: 1; transform: translateY(0) scale(1); }
.guide-text {
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1.45;
}

/* ---------- Walking character (guide) ---------- */
.char-marker {
  position: absolute;
  left: -34px;
  top: 0;
  width: 86px;
  height: 104px;
  transition: top .95s cubic-bezier(.45,0,.2,1);
  z-index: 6;
  filter: drop-shadow(0 3px 5px rgba(20,30,60,.35));
}
.char-emoji {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: bottom center;
  display: block;
  transform-origin: center bottom;
}
.char-marker.walking .char-emoji {
  animation: charBounce .46s ease-in-out infinite;
}
@keyframes charBounce {
  0%, 100% { transform: translateY(0) rotate(-1.5deg); }
  50% { transform: translateY(-4px) rotate(1.5deg); }
}

