:root {
  --hr-navy: #1b2a4e;
  --hr-gold: #90703c;
  --hr-bg: #ffffff;
  --hr-soft: #f3f1ec;
  --hr-text: #222222;
}

.hr-launcher {
  position: fixed;
  right: 20px;
  bottom: 20px;
  width: 60px;
  height: 60px;
  border: 0;
  border-radius: 50%;
  background: var(--hr-navy);
  color: #fff;
  font-size: 26px;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.3);
  z-index: 9998;
}

.hr-panel {
  position: fixed;
  right: 20px;
  bottom: 92px;
  width: 370px;
  max-width: calc(100vw - 32px);
  height: 560px;
  max-height: calc(100vh - 120px);
  display: flex;
  flex-direction: column;
  background: var(--hr-bg);
  color: var(--hr-text);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 10px 32px rgba(0, 0, 0, 0.3);
  font-family: "Noto Sans KR", "Malgun Gothic", sans-serif;
  font-size: 14px;
  z-index: 9999;
}

.hr-panel[hidden] {
  display: none;
}

.hr-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 16px;
  background: var(--hr-navy);
  color: #fff;
  border-bottom: 3px solid var(--hr-gold);
}

.hr-close {
  border: 0;
  background: none;
  color: #fff;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}

.hr-log {
  flex: 1;
  overflow-y: auto;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: var(--hr-soft);
}

.hr-msg {
  max-width: 86%;
  padding: 10px 12px;
  border-radius: 12px;
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-word;
}

.hr-bot {
  align-self: flex-start;
  background: #fff;
  border: 1px solid #e3ded3;
}

.hr-user {
  align-self: flex-end;
  background: var(--hr-navy);
  color: #fff;
}

.hr-msg a {
  color: var(--hr-gold);
}

.hr-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.hr-chip {
  padding: 6px 12px;
  border: 1px solid var(--hr-gold);
  border-radius: 999px;
  background: #fff;
  color: var(--hr-gold);
  font-size: 13px;
  cursor: pointer;
}

.hr-chip:hover {
  background: var(--hr-gold);
  color: #fff;
}

.hr-nav {
  display: flex;
  gap: 8px;
  padding: 8px 10px 0;
  background: #fff;
  border-top: 1px solid #e3ded3;
}

.hr-nav-button {
  flex: 1;
  padding: 7px 0;
  border: 1px solid #cfc9bb;
  border-radius: 8px;
  background: var(--hr-soft);
  color: var(--hr-navy);
  font-size: 13px;
  cursor: pointer;
}

.hr-nav-button:hover:not(:disabled) {
  border-color: var(--hr-navy);
}

.hr-nav-button:disabled {
  opacity: 0.45;
  cursor: default;
}

.hr-nav + .hr-form {
  border-top: 0;
}

.hr-form {
  display: flex;
  gap: 8px;
  padding: 10px;
  border-top: 1px solid #e3ded3;
  background: #fff;
}

.hr-input {
  flex: 1;
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid #cfc9bb;
  border-radius: 8px;
  font-size: 14px;
}

.hr-send {
  padding: 0 16px;
  border: 0;
  border-radius: 8px;
  background: var(--hr-gold);
  color: #fff;
  cursor: pointer;
}

.hr-send:disabled {
  opacity: 0.5;
  cursor: default;
}

/* ── 모바일(폭 600px 이하): 전체 화면 채팅 + 손가락으로 누르기 쉬운 크기 ── */
@media (max-width: 600px) {
  .hr-launcher {
    right: calc(16px + env(safe-area-inset-right));
    bottom: calc(16px + env(safe-area-inset-bottom));
  }

  .hr-launcher.hr-open {
    display: none;
  }

  .hr-panel {
    top: 0;
    right: 0;
    bottom: auto;
    left: 0;
    width: 100%;
    max-width: none;
    height: 100vh;
    height: 100dvh;
    max-height: none;
    border-radius: 0;
    font-size: 15px;
  }

  .hr-header {
    padding: calc(12px + env(safe-area-inset-top)) 12px 12px 16px;
  }

  .hr-close {
    width: 44px;
    height: 44px;
    font-size: 28px;
  }

  .hr-msg {
    max-width: 90%;
  }

  .hr-chip {
    padding: 10px 14px;
    font-size: 14px;
  }

  .hr-nav-button {
    padding: 11px 0;
    font-size: 14px;
  }

  .hr-form {
    padding-bottom: calc(10px + env(safe-area-inset-bottom));
  }

  /* 16px 미만이면 아이폰에서 입력 시 화면이 자동 확대됩니다. */
  .hr-input {
    padding: 12px;
    font-size: 16px;
  }

  .hr-send {
    padding: 0 18px;
    font-size: 15px;
  }

  /* 채팅이 열려 있는 동안 뒤 페이지가 같이 스크롤되지 않게 합니다. */
  html.hr-lock,
  html.hr-lock body {
    overflow: hidden;
  }
}
