@font-face {
  font-family: "Noto Sans KR";
  src: url("../fonts/NotoSansKR-Variable.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}

.counselor-body {
  --counselor-ink: #242027;
  --counselor-sub: #5d555c;
  --counselor-line: #e6dfda;
  --counselor-thread: #fbfaf8;
  box-sizing: border-box;
  display: grid;
  min-height: 100dvh;
  margin: 0;
  padding: 24px 16px;
  place-items: center;
  background: #f9f6f4;
  color: var(--counselor-ink);
  font: 14px/1.5 "Noto Sans KR", "Malgun Gothic", sans-serif;
}

.counselor-body *, .counselor-body *::before, .counselor-body *::after { box-sizing: inherit; }

.counselor-page {
  display: flex;
  flex-direction: column;
  width: min(100%, 520px);
  height: min(660px, calc(100dvh - 48px));
  min-height: 350px;
  overflow: hidden;
  border: 1px solid var(--counselor-line);
  border-radius: 16px;
  background: var(--counselor-thread);
}

.counselor-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 100px;
  padding: 12px 22px;
  border-bottom: 1px solid var(--counselor-line);
  background: white;
}

.counselor-header h1 { margin: 4px 0 0; font-size: 27px; line-height: 1.35; }
.counselor-brand { font-family: Lato, Arial, sans-serif; font-size: 16px; font-weight: 900; letter-spacing: -.7px; }

.counselor-header a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 6px 8px;
  color: var(--counselor-sub);
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
}

.counselor-history { flex: 1; min-height: 0; padding: 16px 18px 20px; overflow: auto; }
.counselor-welcome { padding: 13px 2px; }
.counselor-welcome h2 { margin: 0 0 12px; font-size: 25px; line-height: 1.45; }
.counselor-welcome p, .counselor-wait-hint { color: var(--counselor-sub); }

.counselor-status {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 61px;
  padding: 6px 12px;
  border-radius: 12px;
  background: #f6eee2;
  color: #694a29;
}

.counselor-page[data-state="answered"] .counselor-status { background: #e8f0e9; color: #31553d; }
.counselor-page[data-state="closed"] .counselor-status { background: #f1eeeb; color: var(--counselor-ink); }
.counselor-status strong { font-size: 13px; }
.counselor-status p { margin: 2px 0 0; color: var(--counselor-sub); font-size: 11px; }

.counselor-refresh, .counselor-primary {
  min-height: 48px;
  padding: 0 14px;
  border: 1px solid var(--counselor-line);
  border-radius: 12px;
  background: white;
  color: var(--counselor-ink);
  font: inherit;
  font-weight: 500;
  cursor: pointer;
}

.counselor-refresh { flex: 0 0 auto; min-width: 128px; font-size: 13px; }
.counselor-refresh:disabled { opacity: .6; cursor: wait; }

.counselor-primary {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  border-color: var(--counselor-ink);
  background: var(--counselor-ink);
  color: white;
  font-weight: 700;
  text-align: center;
  text-decoration: none;
}

.counselor-primary:hover { filter: brightness(1.12); }
.counselor-page :focus-visible { outline: 2px solid #493747; outline-offset: 2px; }

.counselor-refresh-feedback { margin: 7px 0 0; color: var(--counselor-sub); font-size: 12px; }
.counselor-refresh-feedback:empty { display: none; }
.counselor-date { margin: 18px 0 11px; color: #6c6369; font-size: 12px; text-align: center; }
.counselor-messages { display: grid; gap: 14px; }

.counselor-message {
  width: min(100%, 285px);
  padding: 12px 16px;
  border-radius: 12px;
  background: white;
  overflow-wrap: anywhere;
}

.counselor-message.is-customer { justify-self: end; width: min(100%, 249px); background: #f1e7ea; }
.counselor-message strong { color: var(--counselor-sub); font-size: 12px; }
.counselor-message p { margin: 4px 0; white-space: pre-wrap; }
.counselor-message small { color: #6c6369; font-size: 11px; }
.counselor-message img { display: block; max-width: 100%; height: auto; margin-top: 8px; }
.counselor-wait-hint { margin: 22px 4px 0; font-size: 13px; }

.counselor-compose {
  display: grid;
  gap: 8px;
  padding: 6px 18px max(16px, env(safe-area-inset-bottom));
  border-top: 1px solid var(--counselor-line);
  background: white;
}

.counselor-compose label { font-size: 12px; font-weight: 700; }

.counselor-compose textarea, .counselor-login input {
  width: 100%;
  padding: 10px 13px;
  border: 1px solid var(--counselor-line);
  border-radius: 12px;
  background: var(--counselor-thread);
  color: var(--counselor-ink);
  font: inherit;
}

.counselor-compose textarea { min-height: 64px; max-height: 24vh; resize: vertical; }
.counselor-error { margin: 0; color: #941830; }
.counselor-test-label { margin-left: 4px; color: #694a29; font-size: 12px; vertical-align: middle; }

.counselor-login {
  width: min(100%, 440px);
  height: auto;
  max-height: calc(100dvh - 48px);
  overflow: auto;
  background: white;
}

.counselor-login .counselor-header { min-height: 82px; }
.counselor-login .counselor-brand { font-size: 25px; }
.counselor-login-content { padding: 25px 22px 40px; }
.counselor-login-content h1 { margin: 0 0 14px; font-size: 27px; line-height: 1.48; }
.counselor-login-content > p { margin: 0 0 23px; color: var(--counselor-sub); font-size: 13px; }
.counselor-login-content hr { margin: 31px 0 27px; border: 0; border-top: 1px solid var(--counselor-line); }
.counselor-login-content form { display: grid; gap: 13px; }
.counselor-login-content input { min-height: 54px; background: white; }
.counselor-login-content .counselor-login-hint { margin-top: 23px; margin-bottom: 0; }
.counselor-kakao { border-color: #fee500; background: #fee500; color: var(--counselor-ink); }

.counselor-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

@media (max-width: 600px) {
  .counselor-body { padding: 0; }
  .counselor-page { width: 100%; height: 100dvh; max-height: none; border: 0; border-radius: 0; }
  .counselor-login { min-height: 100dvh; height: auto; }
}

@media (max-width: 360px) {
  .counselor-refresh { min-width: 0; padding-inline: 9px; }
  .counselor-welcome h2 { font-size: 22px; }
}
