/**
 * 유저 페이지 스타일 - 감각적 어두운 테마
 */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-size: 14px;
    line-height: 1.6;
    color: #1e293b;
    background: #f7fafc;
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
    overflow-x: hidden;
    overscroll-behavior: none;
}

/* ===== 로그인/회원가입 페이지 ===== */
.login-container,
.register-container {
    min-height: 100vh;
    min-height: 100svh;
    min-height: 100dvh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: calc(20px + env(safe-area-inset-top)) 20px calc(20px + env(safe-area-inset-bottom));
    background: linear-gradient(135deg, #f7fafc 0%, #ffffff 100%);}

.login-box,
.register-box {
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.1);
    padding: 40px;
    width: 100%;
    max-width: 420px;
    border: 1px solid #cbd5e0;
    position: relative;
}

.login-box::before,
.register-box::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    border-radius: 12px 12px 0 0;
}

.login-box h1,
.register-box h1 {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 8px;
    text-align: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ===== 폼 스타일 ===== */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #94a3b8;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.form-group input {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid #cbd5e0;
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.3s ease;
    background-color: #f8fafc;
    color: #1e293b;
}

.form-group input::placeholder {
    color: #64748b;
}

.form-group input:focus {
    outline: none;
    border-color: #667eea;
    background-color: #f1f5f9;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.2);
}

.input-with-button {
    display: flex;
    gap: 8px;
}

.input-with-button input {
    flex: 1;
}

.form-hint {
    display: block;
    margin-top: 6px;
    font-size: 12px;
    color: #475569;
}

.form-message {
    display: block;
    margin-top: 6px;
    font-size: 12px;
    font-weight: 500;
}

.form-message.success {
    color: #68d391;
}

.form-message.error {
    color: #fc8181;
}

/* ===== 버튼 ===== */
.btn-primary {
    width: 100%;
    padding: 12px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #ffffff;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(102, 126, 234, 0.4);
}

.btn-primary:active:not(:disabled) {
    transform: translateY(0);
}

.btn-primary:disabled {
    background: #94a3b8;
    cursor: not-allowed;
    box-shadow: none;
}

.btn-secondary {
    padding: 10px 16px;
    background-color: #f8fafc;
    color: #94a3b8;
    border: 1px solid #94a3b8;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-secondary:hover {
    background-color: #f1f5f9;
    border-color: #667eea;
    transform: translateY(-1px);
}

.btn-link {
    background: none;
    border: none;
    color: #667eea;
    text-decoration: none;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.btn-link:hover {
    color: #764ba2;
    text-decoration: underline;
}

.login-footer,
.register-footer {
    margin-top: 24px;
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* ===== 채팅 페이지 ===== */
html, body { height: 100%; }

.chat-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    height: 100dvh;
    min-height: 100svh;
    overflow: hidden;
    overscroll-behavior: none;
    background: #f7fafc;
}

.chat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #ffffff;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    position: sticky;
    top: 0;
    z-index: 20;
}
.header-left h2 {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 4px;
}

.user-name {
    font-size: 13px;
    opacity: 0.9;
    font-weight: 500;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.status-badge {
    padding: 6px 12px;
    border-radius: 16px;
    font-size: 12px;
    font-weight: 600;
    background-color: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.status-badge.status-active {
    background-color: #48bb78;
    border-color: #48bb78;
}

.status-badge.status-ended {
    background-color: #f56565;
    border-color: #f56565;
}

.btn-icon {
    background: rgba(255, 255, 255, 0.15);
    border: none;
    color: #ffffff;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    font-size: 18px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-icon:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: translateY(-1px);
}

/* ===============================
   공지(Notice) - 유저 채팅방 (상단 공지바)
   요구사항:
   - 공지 영역은 상단 공지칸으로 사용 (구조 변경 없음)
   - 배경 #ffffff
   - 하단 1px 기준선 #d8d8d8 (채팅 시작선과 맞닿게)
   - 공지 1줄 기본 높이는 message input(textarea) 1줄 높이와 동일하게
     (내용이 길어지면 줄바꿈되며 높이만 자연 증가)
   - 글씨는 채팅 기본 글씨(검은색), bold 없음
   - 쉐도우/박스 외곽 테두리 없음
=============================== */

.noticearea.notice-area,
.notice-area {
    box-sizing: border-box;

    /* 채팅 영역과 동일한 좌우 그리드(= chat-messages, chat-input-area의 20px) */
    width: 100%;
    margin: 0;
    /*
      공지칸 높이를 "직접 입력하는 작은 textarea" 1줄(34px)과 동일하게 맞춤
      textarea: line-height(20) + padding(6+6) + border(1+1) = 34
      공지칸은 하단 보더 1px만 있으므로: line-height(20) + padding(6+7) + border-bottom(1) = 34
    */
    padding: 0 20px;
    background: #ffffff;

    /* 채팅 시작선(공지 바깥 하단 보더) */
    border: 0;
    border-bottom: 1px solid #d8d8d8;

    /* 높이: message input(textarea) 기본 1줄 높이(34px)와 맞춤 */
    min-height: 0;
    height: auto;
    flex-shrink: 0;

    /* 텍스트 */
    color: #000000;
    font-family: inherit;
    font-size: 13px;
    font-weight: 400;
    line-height: 18px;

    /* 1줄일 때는 34px 기본 높이, 여러 줄이면 자연 증가 */
    display: block;

    text-align: left;

    /* 줄바꿈(긴 글/URL) */
    white-space: pre-wrap;
    word-break: break-word;
    overflow-wrap: anywhere;

    /* 박스 효과 제거 */
    border-radius: 0;
    box-shadow: none;
}

/* noticeText(span)에는 패딩/높이를 주지 않고, 부모(.notice-area)의 높이/패딩을 그대로 사용 */
#noticeText{
    display: block;
    width: 100%;
    padding: 3px 0;
    margin: 0;
    min-height: 0;
    border: 0;
    background: transparent;
    box-sizing: border-box;

    white-space: inherit;
    word-break: inherit;
    overflow-wrap: inherit;
}

/* 공지 내부 요소(아이콘/링크/strong 등)가 있어도 톤 유지 */
.noticearea.notice-area *,
.notice-area * {
    min-width: 0;
    max-width: 100%;
    white-space: inherit;
    word-break: inherit;
    overflow-wrap: inherit;
    color: inherit;
    font-weight: inherit;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;                  /* 공지바가 별도 상단 영역이므로 상단 패딩을 정상화 */
    background: #f7fafc;
    min-height: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;

    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
}
.chat-messages::-webkit-scrollbar {
    width: 6px;
}

.chat-messages::-webkit-scrollbar-track {
    background: transparent;
}

.chat-messages::-webkit-scrollbar-thumb {
    background: #94a3b8;
    border-radius: 3px;
}

.chat-messages::-webkit-scrollbar-thumb:hover {
    background: #667eea;
}

.loading-message {
    text-align: center;
    color: #64748b;
    padding: 20px;
    font-weight: 500;
}

.message {
    margin-bottom: 8px;
    max-width: 66.6667%;
    display: flex;
    flex-direction: column;
}

.message-user {
    margin-left: auto;
    align-items: flex-end;
}

.message-admin {
    margin-right: auto;
    align-items: flex-start;
}

.message-sender {
    font-size: 11px;
    color: #475569;
    margin-bottom: 4px;
    font-weight: 500;
}

.message-content {
    padding: 12px 16px;
    border-radius: 12px;
    word-wrap: break-word;
    white-space: pre-wrap;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    font-size: 13px;
    line-height: 1.4;

    overflow-wrap: anywhere;

    word-break: break-word;

    width: fit-content;
}

.message-user .message-content {
    background: #6d6ace;
    color: #ffffff;
    border-bottom-right-radius: 4px;

    overflow-wrap: anywhere;

    word-break: break-word;

    width: fit-content;
}

.message-admin .message-content {
    background-color: #f8fafc;
    color: #1e293b;
    border: 1px solid #d8d8d8;
    border-bottom-left-radius: 4px;

    overflow-wrap: anywhere;

    word-break: break-word;

    width: fit-content;
}

.message-time {
    font-size: 11px;
    color: #64748b;
    margin-top: 4px;
}

.chat-input-area {
    padding: 16px 20px;
    background-color: #ffffff;
    border-top: 1px solid #e6e6e6;
    flex-shrink: 0;
}

.chat-input-area form {
    display: flex;
    gap: 12px;
}

.chat-input-area textarea {
    flex: 1;
    box-sizing: border-box;
    padding: 6px 10px;
    border: 1px solid #cbd5e0;
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;

    /* 1줄 기본 높이(컴팩트) + JS auto-grow inline height 허용 */

    resize: none;
    background-color: #f8fafc;
    transition: all 0.3s ease;
    color: #1e293b;
}

/* Desktop/tablet: keep compact 1-line base height without affecting Android mobile auto-grow */
@media (min-width: 769px) {
  .chat-input-area textarea {
    min-height: 34px;
    height: 34px;
    max-height: 160px;
  }
}

/*
  Android Chrome 실기기에서만 발생하는 textarea auto-grow 렌더링 버그 대응
  - flex 컨텍스트 내부 textarea에서 inline height 변경이 롤백되는 케이스가 있어,
    모바일에서는 입력 form 레이아웃을 flex -> grid 로 바꿔 flex 컨텍스트를 제거.
  - 기존 JS(auto-grow) 변경 없이, 높이 고정 규칙은 모바일에서 두지 않음.
*/
@media (max-width: 768px) {
  /* Android 실기기 안정화: flex 컨텍스트를 피하고(이미 적용됨) 입력창/버튼을 같은 높이로 정렬 */
  .chat-input-area form {
    display: grid;
    grid-template-columns: 1fr 64px;
    column-gap: 12px;
    align-items: stretch; /* 같은 row 높이로 늘려서 버튼/텍스트박스 높이 일치 */
  }

  .chat-input-area textarea {
    width: 100%;
    min-width: 0;

    /* 채팅목록/말풍선과 동일 톤 */
    font-size: 13px !important;
    line-height: 18px !important;
    padding: 8px 10px !important;

    /* Android Chrome: textarea를 '스크롤 컨트롤'로 오인하는 트랙(밑줄) 잔상 방지 */
    background-color: #ffffff !important;
    overflow: visible !important;
    overflow-y: visible !important;
    scrollbar-width: none;
    -ms-overflow-style: none;

    /* 남는 1px 라인이 있을 경우를 대비해 하단 2~3px을 배경색으로 마스킹 */
    box-shadow: inset 0 -3px 0 #ffffff !important;

    -webkit-appearance: none;
    text-decoration: none;
  }

  .chat-input-area textarea::-webkit-scrollbar {
    width: 0;
    height: 0;
    display: none;
  }

  .chat-input-area .btn-send {
    width: 64px !important;
    min-width: 64px !important;

    /* textarea가 결정한 row 높이에 맞춰 동일 높이로 */
    height: 100% !important;

    display: flex;
    align-items: center;   /* 텍스트 수직 중앙 */
    justify-content: center; /* 텍스트 수평 중앙 */

    padding: 0 10px !important;
    line-height: 1 !important;
    font-size: 13px !important;
  }
}
/* Hide scrollbars (Android underline/track-like line) without defining overflow rules */
.chat-input-area textarea::-webkit-scrollbar {
  width: 0;
  height: 0;
}


.chat-input-area textarea::placeholder {
    color: #64748b;
}

.chat-input-area textarea:focus,
.chat-input-area textarea:focus-visible {
    outline: none;
    box-shadow: none;
    border-color: #cbd5e0;
    background-color: #f8fafc;
}

.btn-send:focus,
.btn-send:focus-visible {
    outline: none;
    box-shadow: none;
}

.btn-send {
    height: 34px;
    min-height: 34px;
    padding: 0 14px;
    line-height: 34px;

    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #ffffff;
    border: none;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
    white-space: nowrap;
}

.btn-send:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(102, 126, 234, 0.4);
}

.btn-send:active {
    transform: translateY(0);
}

/* ===== 모달 ===== */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.modal-content {
    background-color: #ffffff;
    margin: 10% auto;
    padding: 30px;
    border-radius: 12px;
    width: 90%;
    max-width: 500px;
    position: relative;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.1);
    border: 1px solid #cbd5e0;
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        transform: translateY(20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-content h2 {
    margin-bottom: 20px;
    font-size: 20px;
    font-weight: 700;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.modal-content p {
    color: #94a3b8;
    line-height: 1.6;
}

.close {
    position: absolute;
    right: 20px;
    top: 20px;
    font-size: 28px;
    font-weight: bold;
    color: #64748b;
    cursor: pointer;
    transition: all 0.3s ease;
    line-height: 1;
}

.close:hover {
    color: #667eea;
    transform: rotate(90deg);
}

/* ===== 반응형 디자인 ===== */

/* ===== 로그인/회원가입: 모바일에서 키보드/주소창 변화로 인한 '센터링 점프' 최소화 ===== */
@media (max-width: 768px) {
    .login-container,
    .register-container {
        /* 화면 변화 시에도 상단 기준으로 안정적으로 유지 */
        justify-content: flex-start;
    }

    .login-box,
    .register-box {
        /* 너무 위로 붙지 않게 최소 여백 */
        margin-top: 20px;
    }
}

/* ===== PC(데스크톱)에서 iframe 폭이 768px 이하로 줄어도 로그인/회원가입은 중앙정렬 유지 =====
   - 데스크톱 환경(마우스/트랙패드)에서만 적용: 실제 모바일(터치)은 기존 동작 유지 */
@media (max-width: 768px) and (hover: hover) and (pointer: fine) {
    .login-container,
    .register-container {
        justify-content: center;
    }

    .login-box,
    .register-box {
        margin-top: 0;
    }
}



@media (max-width: 768px) {
    .login-box,
    .register-box {
        padding: 30px 20px;
        margin: 20px;
    }

    .chat-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .header-right {
        width: 100%;
        justify-content: space-between;
    }

    .message {
        max-width: 66.6667%;
    }

    .chat-input-area form {
        flex-direction: column;
    }

    .btn-send {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .login-box,
    .register-box {
        padding: 24px 16px;
        margin: 16px;
        max-width: 100%;
    }

    .login-box h1,
    .register-box h1 {
        font-size: 24px;
    }

    .message {
        max-width: 66.6667%;
    }

    .chat-messages {
        padding: 12px;
    }

    .chat-input-area {
        padding: 12px 16px;
    }

    .modal-content {
        width: 90%;
        margin: 20% auto;
        padding: 20px;
    }
}

/* ===== Mobile: sticky/fixed chat input (Kakao-style) ===== */


/* ===== User: hide sender labels (상담원/나) ===== */
.message-sender { display: none !important; }

/* ===== User Mobile: tighter message spacing ===== */
@media (max-width: 768px) {
  .message { margin-bottom: 4px !important; }
  .message-time { margin-top: 2px !important; }
  .message-content { padding: 10px 14px !important; 
    overflow-wrap: anywhere;

    word-break: break-word;

    width: fit-content;
}
  .chat-messages { padding-left: 12px !important; padding-right: 12px !important; }
}

/* 모바일: 마지막 채팅 ↔ 입력창 간격 축소 */
@media (max-width: 768px) {
  .chat-messages {
    padding-bottom: 6px !important;
  }
}

/* PC: 마지막 채팅 ↔ 입력창 간격 살짝 축소 */
@media (min-width: 769px) {
  .chat-messages {
    padding-bottom: 40px;
  }
}

/* --- Chat message wrap fix (long text/URL) --- */
.message {
    min-width: 0;
    max-width: 66.6667%;
}

.message-content,
.message-content * {
    min-width: 0;
    max-width: 100%;
}

.message-content {
    overflow-wrap: anywhere;   /* break very long strings (URL, no-space text) */
    word-break: break-word;   /* fallback */
    white-space: pre-wrap;    /* keep line breaks + allow wrapping */

    width: fit-content;
}


/* ===============================

/* [NOTICE] cleanup: removed duplicate notice bubble overrides to prevent layout height/clip issues.
   - Notice bar styles are defined earlier under '공지(Notice) - 유저 채팅방'.
*/
/* ===============================
   [NOTICE TUNE] 공지 높이/글자 통일 (입력창 높이 + 채팅목록 글자)
   - 박스/구조/기능 변경 없음 (CSS만)
   - 공지 높이: 하단 입력 textarea 1줄 높이와 체감 동일
   - 공지 글자: 채팅 메시지(.message-content) 글자 크기/행간과 동일
================================= */
.notice-area{
  /* textarea(PC) 기본 1줄 높이(34px) 체감 맞춤 */
  min-height: 34px !important;
  display: flex !important;
  align-items: center !important;
  padding: 0 20px !important; /* 기존 그리드 유지 */
}

#noticeText{
  flex: 1 1 auto !important;
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;

  /* 채팅목록(메시지) 글자 톤 */
  font-size: 13px !important;
  line-height: 1.4 !important;

  /* 높이는 padding으로 잡되, min-height는 부모가 담당 */
  padding: 8px 0 !important;
  margin: 0 !important;

  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}


/* =========================
   [NOTICE ICON] 여러 줄에서도 아이콘은 '첫 줄'에 고정 + 줄정렬(행걸이) 유지
   - 다른 규칙(display:flex/align-items 등) 영향 차단
   - 새로고침 시 아이콘이 살짝 움직이는 현상(폰트 스왑/transition) 최소화
========================= */

#noticeArea.notice-area{
  /* 혹시 모를 애니메이션/트랜지션 영향 차단 */
  transition: none !important;
}

#noticeText{
  position: relative !important;
  display: block !important;
  /* 기존에 맞춘 높이(입력창 체감) 유지: 세로 padding은 그대로,
     아이콘 자리만큼 왼쪽 padding 추가 */
  padding: 8px 0 8px 28px !important;
  margin: 0 !important;
  font-size: 13px !important;
  line-height: 1.4 !important;
  font-weight: 400 !important;
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  outline: 0 !important;
  /* flex/inline 영향 차단 */
  float: none !important;
  clear: none !important;
  align-items: initial !important;
  justify-content: initial !important;
  transition: none !important;
}

#noticeText::before{
  content: "📣" !important;
  position: absolute !important;
  left: 0 !important;
  /* 첫 줄(1.4em) 기준으로 배지를 수직 가운데 정렬 */
  top: calc(8px + (1.4em - 18px) / 2) !important;
  width: 18px !important;
  height: 18px !important;
  border-radius: 999px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  background: #5865f2 !important;
  color: #ffffff !important;
  font-size: 12px !important;
  line-height: 1 !important;
  /* 폰트 스왑으로 인한 미세한 점프 완화 */
  font-family: "Apple Color Emoji","Segoe UI Emoji","Noto Color Emoji",sans-serif !important;
  transform: translateZ(0) !important;
  transition: none !important;
}

/* ===============================
   [HEADER TUNE] 모바일 헤더 1줄 유지 + 로그아웃 버튼 정렬/스타일
================================= */
@media (max-width: 768px){
  .chat-header{
    flex-direction: row !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 10px !important;
  }

  .header-left{
    min-width: 0 !important;
    flex: 1 1 auto !important;
    display: flex !important;
    align-items: center !important;
  }

  /* 헤더 텍스트(예: test님 환영합니다) 한줄 유지 */
  .header-left *{
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }

  .header-right{
    width: auto !important;
    flex: 0 0 auto !important;
    display: flex !important;
    align-items: center !important;
    justify-content: flex-end !important;
    flex-wrap: nowrap !important;
    gap: 8px !important;
  }
}

/* 로그아웃 버튼: 전송 버튼처럼 짧은 파란 버튼 */
.chat-header .header-right .btn-logout,
.chat-header .header-right .logout-btn,
.chat-header .header-right a[href*="logout"],
.chat-header .header-right button[name*="logout"],
.chat-header .header-right form[action*="logout"] button{
  height: 34px !important;
  min-height: 34px !important;
  padding: 0 12px !important;
  line-height: 34px !important;

  background: linear-gradient(135deg, #362072 0%, #2b165d 100%) !important;
  color: #ffffff !important;

  border: none !important;
  border-radius: 8px !important;

  font-size: 13px !important;
  font-weight: 600 !important;

  cursor: pointer !important;
  white-space: nowrap !important;

  box-shadow: 0 4px 15px rgba(54, 32, 114, 0.28) !important;
  text-decoration: none !important;

  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
}

@media (max-width: 768px){
  .chat-header .header-right .btn-logout,
  .chat-header .header-right .logout-btn,
  .chat-header .header-right a[href*="logout"],
  .chat-header .header-right button[name*="logout"],
  .chat-header .header-right form[action*="logout"] button{
    width: auto !important;
    min-width: 68px !important; /* 전송 버튼처럼 짧게 */
  }
}


/* ===============================
   [REGISTER TUNE] 중복확인 버튼 색상/hover/active + 회원가입(비활성)도 색상 표시
   - 기능/로직/JS/HTML 변경 없음 (CSS만)
=============================== */

/* 회원가입 페이지: '중복확인' 버튼(입력 옆 버튼) */
.register-container .input-with-button .btn-secondary,
.register-box .input-with-button .btn-secondary {
    background-color: #6d6ace !important;
    border-color: #6d6ace !important;
    color: #ffffff !important;
    box-shadow: 0 4px 14px rgba(109, 106, 206, 0.28) !important;
}

.register-container .input-with-button .btn-secondary:hover,
.register-box .input-with-button .btn-secondary:hover {
    background-color: #5f5cc3 !important;
    border-color: #5f5cc3 !important;
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(109, 106, 206, 0.36) !important;
}

.register-container .input-with-button .btn-secondary:active,
.register-box .input-with-button .btn-secondary:active {
    background-color: #5451b0 !important;
    border-color: #5451b0 !important;
    transform: translateY(0);
}

/* 회원가입 버튼: '중복확인 통과 전'(disabled)에도 색상이 보이도록 */
.register-container .btn-primary:disabled,
.register-box .btn-primary:disabled {
    background: #6d6ace !important;
    opacity: 0.78;
    box-shadow: 0 4px 15px rgba(109, 106, 206, 0.22) !important;
}

/* ===============================
   [REGISTER] 전화번호 placeholder "010-1234-5678" 표시 제거(투명 처리)
   - HTML placeholder 텍스트 자체는 CSS로 변경 불가 → 보이지만 않게 처리
=============================== */
.register-container input[placeholder="010-1234-5678"]::placeholder,
.register-box input[placeholder="010-1234-5678"]::placeholder,
.register-container input[placeholder*="010-1234-5678"]::placeholder,
.register-box input[placeholder*="010-1234-5678"]::placeholder {
    color: transparent !important;
}

/* iOS/Safari 등 구형 placeholder 호환 */
.register-container input[placeholder="010-1234-5678"]::-webkit-input-placeholder,
.register-box input[placeholder="010-1234-5678"]::-webkit-input-placeholder,
.register-container input[placeholder*="010-1234-5678"]::-webkit-input-placeholder,
.register-box input[placeholder*="010-1234-5678"]::-webkit-input-placeholder {
    color: transparent !important;
}

/* ===============================
   [CHAT] 채팅 없을 때 "채팅 기록을 불러오는 중..." 문구 제거
   - 기능/로직 변경 없음 (표시만 숨김)
=============================== */
.chat-messages .loading-message {
    display: none !important;
}


/* =========================
   iOS Safari input zoom 방지
   - iOS Safari는 input/textarea font-size가 16px 미만이면 포커스 시 자동 확대(줌)될 수 있음
   - 기능/JS 변경 없이 CSS만으로 방지하는 가장 안전한 방법: iOS에서만 16px 적용
   ========================= */
@supports (-webkit-touch-callout: none) {
  .chat-input-area textarea {
    font-size: 16px !important;
  }


/* iOS Safari: 로그인/회원가입 input 포커스 시 자동 확대(줌) 방지 */
.login-container .form-group input,
.register-container .form-group input,
.login-box .form-group input,
.register-box .form-group input {
  font-size: 16px !important;
}
}


/* ===== Touch devices: hover 효과로 인한 흔들림/움직임 방지 (iOS/Android) ===== */
@media (hover: none), (pointer: coarse) {
    .btn-primary:hover:not(:disabled),
    .btn-secondary:hover,
    .btn-send:hover,
    .btn-icon:hover,
    .close:hover {
        transform: none !important;
    }

    .btn-link:hover {
        text-decoration: none !important;
    }
}
