.crgl-feedback-modal,
.crgl-feedback-modal * {
  box-sizing: border-box;
}

.crgl-feedback-modal body,
.crgl-feedback-modal h1,
.crgl-feedback-modal h2,
.crgl-feedback-modal h3,
.crgl-feedback-modal h4,
.crgl-feedback-modal h5,
.crgl-feedback-modal h6,
.crgl-feedback-modal p,
.crgl-feedback-modal ul,
.crgl-feedback-modal ol {
  margin: 0;
  padding: 0;
}

.crgl-feedback-modal button,
.crgl-feedback-modal input,
.crgl-feedback-modal textarea,
.crgl-feedback-modal select {
  margin: 0;
  padding: 0;
  background: none;
  border: none;
  font: inherit;
  color: inherit;
}

.crgl-feedback-modal textarea {
  resize: none;
}

.crgl-feedback-modal ul,
.crgl-feedback-modal ol {
  list-style: none;
}

.crgl-feedback-modal img {
  max-width: 100%;
  display: block;
}

#feedback-ai-btn {
  background: url("assets/faq-bot.svg") no-repeat center center;
  position: fixed;
  right: 30px;
  bottom: 5%;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 2px solid #00843d;
  background-color: #fff;
  cursor: pointer;
  z-index: 3010;
  box-shadow: 0 2px 8px 2px rgba(0, 132, 61, 0.15);
  animation: float 3s ease-in-out infinite;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  will-change: transform;
  transform: translateZ(0);
}
#feedback-ai-btn:hover {
  animation-play-state: paused;
  transform: translate3d(0, -8px, 0);
  box-shadow: 0 4px 8px rgba(0, 132, 61, 0.2);
}
#feedback-ai-btn:active {
  transform: translate3d(0, -8px, 0);
}

#crgl-cover-layer {
  width: 100vw;
  height: 100vh;
  overflow-x: hidden;
  overflow-y: hidden;
  background-color: #000;
  opacity: 0.5;
  position: fixed;
  top: 0;
  left: 0;
  z-index: 3000;
}

.feedback-listener {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.crgl-feedback-modal {
  background: white;
  border-radius: 12px;
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.2);
  width: 430px;
  height: 620px;
  min-width: 430px;
  min-height: 620px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  position: fixed;
  right: 30px;
  bottom: 1%;
  z-index: 3010;
}

.crgl-feedback-modal-header-container {
  padding: 4px;
  background: #f9fafb;
  border-bottom: 1px solid #e5e7eb;
}

.crgl-feedback-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 16px;
  background: #f9fafb;
  -webkit-user-select: none;
          user-select: none;
}
.crgl-feedback-modal-header h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 400;
  color: #3b4047;
  pointer-events: none;
}
.crgl-feedback-modal-header .close-btn {
  border: none;
  font-size: 20px;
  color: #6b7280;
  cursor: pointer;
  padding: 0;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  transition: all 0.2s;
  background: url("assets/close.svg") no-repeat center center;
}

.crgl-feedback-modal-content {
  flex: 1;
  overflow-y: auto;
  padding: 16px 20px;
}

.qa-section {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.qa-section .question-section,
.qa-section .answer-section {
  margin-bottom: 0;
  max-width: 80%;
  display: flex;
  align-items: flex-start;
  gap: 8px;
}
.qa-section .answer-section {
  align-self: flex-start;
  flex-direction: row;
}
.qa-section .answer-section .label {
  text-align: left;
}
.qa-section .question-section {
  align-self: flex-end;
  flex-direction: row-reverse;
}
.qa-section .question-section .label {
  text-align: right;
}
.qa-section .label {
  font-size: 12px;
  font-weight: 600;
  color: #6b7280;
  margin-bottom: 0;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  line-height: 1;
  white-space: nowrap;
  max-width: 40px;
  max-height: 40px;
}
.qa-section .question-text,
.qa-section .answer-text {
  padding: 12px 16px;
  border-radius: 4px;
  font-size: 14px;
  line-height: 1.5;
  color: #3b4047;
  position: relative;
  flex: 1;
  max-width: 100%;
  font-weight: 400;
  background: #f8f8fa;
  word-break: break-all;
}
.qa-section .question-text a,
.qa-section .answer-text a {
  color: #00843d;
  text-decoration: none;
  font-size: 14px;
}
.qa-section .answer-text .answer-text-table {
  max-width: 100%;
  overflow-x: auto;
}
.qa-section .answer-text .answer-text-table::-webkit-scrollbar {
  height: 6px !important;
}
.qa-section .answer-text .answer-text-table::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 4px;
}
.qa-section .answer-text .answer-text-table::-webkit-scrollbar-thumb {
  background: #888;
  border-radius: 4px;
}
.qa-section .answer-text .answer-text-table::-webkit-scrollbar-thumb:hover {
  background: #555;
}
.qa-section .answer-text .answer-text-table table {
  border-collapse: collapse;
  white-space: nowrap;
  border: 1px solid #d1d5db;
  background-color: white;
}
.qa-section .answer-text .answer-text-table table th,
.qa-section .answer-text .answer-text-table table td {
  border: 1px solid #d1d5db;
  padding: 8px 12px;
}
.qa-section .answer-text .answer-text-table table th {
  background-color: #f9fafb;
  font-weight: 600;
}

.crgl-feedback-modal-footer {
  padding: 18px 16px;
  background: #fff;
}

.feedback-input {
  margin-bottom: 8px;
  width: 100%;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  box-sizing: border-box;
}
.feedback-input .label {
  font-size: 12px;
  font-weight: 600;
  color: #6b7280;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  line-height: 1;
  white-space: nowrap;
  margin-top: 4px;
  min-width: 48px;
  text-align: right;
}
.feedback-input .textarea-wrapper {
  position: relative;
  width: 100%;
  flex: 1;
}
.feedback-input textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #8c96a7;
  font-size: 14px;
  font-family: inherit;
  resize: none;
  min-height: 60px;
  transition: border-color 0.2s;
  box-sizing: border-box;
  background-color: transparent;
  border-radius: 4px;
  color: #3b4047;
}
.feedback-input textarea:focus {
  outline: none;
}
.feedback-input textarea::placeholder {
  color: #9ca3af;
}
.feedback-input .textarea-counter {
  position: absolute;
  right: 12px;
  bottom: 8px;
  font-size: 11px;
  color: #6b7280;
}

#crgl-modal-container .voice-input-wrapper {
  width: 100%;
  flex: 1;
}
#crgl-modal-container .voice-input-wrapper .voice-record-btn {
  width: 100% !important;
  min-height: 60px !important;
  padding: 12px 16px !important;
  border: 2px dashed #8c96a7 !important;
  border-radius: 4px !important;
  background: #f9fafb !important;
  color: #3b4047 !important;
  font-size: 14px !important;
  font-weight: 500 !important;
  cursor: pointer !important;
  transition: all 0.3s !important;
  position: relative !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  -webkit-user-select: none !important;
          user-select: none !important;
}
#crgl-modal-container .voice-input-wrapper .voice-record-btn:hover {
  background: #f3f4f6 !important;
  border-color: #00843d !important;
}
#crgl-modal-container .voice-input-wrapper .voice-record-btn:active {
  background: #e5e7eb;
}
#crgl-modal-container .voice-input-wrapper .voice-record-btn.recording {
  background: #dcfce7 !important;
  border-color: #00843d !important;
  border-style: solid !important;
  animation: pulse-recording 1.5s ease-in-out infinite !important;
}
#crgl-modal-container .voice-input-wrapper .voice-record-btn.recording .record-text {
  display: none;
}
#crgl-modal-container .voice-input-wrapper .voice-record-btn.recording .recording-text {
  display: block;
  color: #00843d !important;
  font-weight: 600 !important;
}
#crgl-modal-container .voice-input-wrapper .voice-record-btn .record-text,
#crgl-modal-container .voice-input-wrapper .voice-record-btn .recording-text {
  pointer-events: none;
}

@keyframes pulse-recording {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(0, 132, 61, 0.4);
  }
  50% {
    box-shadow: 0 0 0 8px rgba(0, 132, 61, 0);
  }
}
#crgl-modal-container .action-buttons {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  align-items: center;
  margin: 12px 0;
}
#crgl-modal-container .action-buttons .input-mode-toggle-btn {
  padding: 0 !important;
  border-radius: 6px !important;
  background: #f3f4f6 !important;
  border: none !important;
  cursor: pointer !important;
  transition: all 0.2s !important;
  width: 36px !important;
  height: 36px !important;
  background-repeat: no-repeat !important;
  background-position: center !important;
  background-size: 20px 20px !important;
}
#crgl-modal-container .action-buttons .input-mode-toggle-btn:hover {
  background-color: #e5e7eb !important;
}
#crgl-modal-container .action-buttons .input-mode-toggle-btn.mode-voice {
  background-image: url("assets/input_yy.svg") !important;
}
#crgl-modal-container .action-buttons .input-mode-toggle-btn.mode-keyboard {
  background-image: url("assets/input_jp.svg") !important;
}
#crgl-modal-container .action-buttons button {
  padding: 8px 16px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  border: none;
}
#crgl-modal-container .action-buttons button.cancel-btn {
  background: #f3f4f6;
  color: #374151;
}
#crgl-modal-container .action-buttons button.cancel-btn:hover {
  background: #e5e7eb;
}
#crgl-modal-container .action-buttons button.submit-btn {
  background: #00843d;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
#crgl-modal-container .action-buttons button.submit-btn:hover:not(:disabled) {
  background: #006b32;
}
#crgl-modal-container .action-buttons button.submit-btn:disabled {
  background: #9ca3af;
  cursor: not-allowed;
}
#crgl-modal-container .action-buttons button.submit-btn .loading-spinner {
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top: 2px solid white;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

.warning-text {
  color: #6b7280;
  font-size: 12px;
  text-align: center;
}

.crgl-dot-loader {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.crgl-dot-loader span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #666;
  opacity: 0.4;
  animation: crgl-dot-pulse 1s infinite ease-in-out;
}
.crgl-dot-loader span:nth-child(2) {
  animation-delay: 0.15s;
}
.crgl-dot-loader span:nth-child(3) {
  animation-delay: 0.3s;
}

.content-spinner {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-top: 14px;
}
.content-spinner .loading-spinner {
  width: 14px;
  height: 14px;
  border: 2px solid rgb(156, 163, 175);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  border-top: 2px solid white;
}

.crgl-greeting-popup {
  position: fixed;
  z-index: 3011;
  background: white;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  padding: 32px 16px 12px 16px;
  width: 380px;
  box-sizing: border-box;
  cursor: pointer;
}
.crgl-greeting-popup .answer-section {
  margin-bottom: 0;
  max-width: 100%;
  display: flex;
  align-items: flex-start;
  align-self: flex-start;
  flex-direction: row;
  gap: 8px;
}
.crgl-greeting-popup .answer-section .label {
  text-align: left;
  font-size: 12px;
  font-weight: 600;
  color: #6b7280;
  margin-bottom: 0;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  line-height: 1;
  white-space: nowrap;
  max-width: 40px;
  max-height: 40px;
}
.crgl-greeting-popup .answer-section .answer-text {
  padding: 12px 16px;
  border-radius: 4px;
  font-size: 14px;
  line-height: 1.5;
  color: #3b4047;
  position: relative;
  flex: 1;
  max-width: 100%;
  font-weight: 400;
  background: #f8f8fa;
  word-wrap: break-word;
  overflow-wrap: break-word;
  padding-right: 24px;
}
.crgl-greeting-popup .answer-section .answer-text a {
  color: #00843d;
  text-decoration: none;
  font-size: 14px;
}
.crgl-greeting-popup .answer-section .answer-text .answer-text-table {
  max-width: 100%;
  overflow-x: auto;
}
.crgl-greeting-popup .answer-section .answer-text .answer-text-table::-webkit-scrollbar {
  height: 6px;
}
.crgl-greeting-popup .answer-section .answer-text .answer-text-table::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 4px;
}
.crgl-greeting-popup .answer-section .answer-text .answer-text-table::-webkit-scrollbar-thumb {
  background: #888;
  border-radius: 4px;
}
.crgl-greeting-popup .answer-section .answer-text .answer-text-table::-webkit-scrollbar-thumb:hover {
  background: #555;
}
.crgl-greeting-popup .answer-section .answer-text .answer-text-table table {
  border-collapse: collapse;
  white-space: nowrap;
  border: 1px solid #d1d5db;
  background-color: white;
}
.crgl-greeting-popup .answer-section .answer-text .answer-text-table table th,
.crgl-greeting-popup .answer-section .answer-text .answer-text-table table td {
  border: 1px solid #d1d5db;
  padding: 8px 12px;
}
.crgl-greeting-popup .answer-section .answer-text .answer-text-table table th {
  background-color: #f9fafb;
  font-weight: 600;
}
.crgl-greeting-popup .crgl-greeting-popup-close {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 16px;
  height: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 20px;
  color: #6b7280;
  border-radius: 4px;
  transition: all 0.2s;
  background: url("assets/close.svg") no-repeat center center;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}
@keyframes float {
  0%, 100% {
    transform: translate3d(0, 0, 0);
  }
  50% {
    transform: translate3d(0, -8px, 0);
  }
}
@keyframes floatAndScale {
  0%, 100% {
    transform: translate3d(0, 0, 0) scale(1);
  }
  50% {
    transform: translate3d(0, 0, 0) scale(1.1);
  }
}
@keyframes pulse {
  0% {
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
  }
  50% {
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.2);
  }
  100% {
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
  }
}
@keyframes crgl-dot-pulse {
  0% {
    opacity: 0.2;
  }
  50% {
    opacity: 1;
  }
  100% {
    opacity: 0.2;
  }
}
@media (max-width: 650px) {
  #feedback-ai-btn {
    right: 15px;
    bottom: 15px;
    width: 44px;
    height: 44px;
  }
  .crgl-feedback-modal {
    width: 90%;
    height: 80vh;
    min-width: unset;
    min-height: unset;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    right: auto;
    bottom: auto;
    border-radius: 12px;
  }
  .crgl-feedback-modal-header {
    padding: 10px 16px;
  }
  .crgl-feedback-modal-header h3 {
    font-size: 15px;
  }
  .crgl-feedback-modal-header .close-btn {
    width: 32px;
    height: 32px;
    font-size: 22px;
  }
  .crgl-feedback-modal-content {
    padding: 12px 16px;
  }
  .qa-section {
    gap: 12px;
  }
  .qa-section .question-section,
  .qa-section .answer-section {
    max-width: 85%;
  }
  .qa-section .label {
    font-size: 11px;
    margin-bottom: 4px;
  }
  .qa-section .question-text,
  .qa-section .answer-text {
    padding: 10px 14px;
    font-size: 13px;
    border-radius: 16px;
  }
  .crgl-feedback-modal-footer {
    padding: 12px 16px;
  }
  .feedback-input-type {
    gap: 6px;
    margin-bottom: 12px;
  }
  .feedback-input-type .feedback-input-type-btn {
    padding: 5px 10px;
    font-size: 11px;
    border-radius: 10px;
  }
  .feedback-input {
    align-items: flex-start;
    gap: 8px;
  }
  .feedback-input .label {
    text-align: right;
    min-width: 40px;
    margin-top: 4px;
  }
  .feedback-input textarea {
    padding: 10px;
    font-size: 13px;
    min-height: 50px;
  }
  .action-buttons {
    margin: 6px;
    gap: 6px;
  }
  .action-buttons button {
    padding: 10px 20px;
    font-size: 12px;
  }
  .warning-text {
    font-size: 11px;
    margin-top: 4px;
  }
  .crgl-greeting-popup {
    width: 90%;
    padding: 32px 16px 12px 16px;
    left: 15px;
    right: 15px;
    bottom: auto;
    top: auto;
    transform: none;
  }
  .crgl-greeting-popup .answer-section .label {
    font-size: 11px;
    max-width: 36px;
    max-height: 36px;
  }
  .crgl-greeting-popup .answer-section .answer-text {
    padding: 10px 14px;
    font-size: 13px;
    padding-right: 20px;
  }
  .crgl-greeting-popup .crgl-greeting-popup-close {
    top: 6px;
    right: 6px;
    width: 28px;
    height: 28px;
    font-size: 22px;
  }
}
.feedback-input-type {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}
.feedback-input-type .feedback-input-type-btn {
  padding: 6px 8px;
  border: 1px solid #d1d5db;
  border-radius: 12px;
  background: white;
  color: #6b7280;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  -webkit-user-select: none;
          user-select: none;
}
.feedback-input-type .feedback-input-type-btn:hover {
  border-color: #00843d;
  color: #00843d;
  background: #f0f9f4;
}
.feedback-input-type .feedback-input-type-btn.active {
  background: #00843d;
  border-color: #00843d;
  color: white;
}
.feedback-input-type .feedback-input-type-btn.active:hover {
  background: #006b32;
  border-color: #006b32;
}

.question-text[data-is-voice=true] {
  display: inline-flex;
  align-items: center;
  padding: 8px 12px;
  background: #e0e7ff;
  border-radius: 8px;
  color: #4f46e5;
  font-weight: 500;
}
.question-text[data-is-voice=true]:hover {
  background: #c7d2fe;
}

.voice-player-container {
  display: inline-block;
  margin-left: 8px;
  vertical-align: middle;
}
.voice-player-container .voice-pause-btn {
  background-image: url("assets/stop.svg");
}
.voice-player-container .voice-pause-btn:hover {
  background-color: #f0f9f4;
}
.voice-player-container .voice-play-btn {
  background-image: url("assets/play.svg");
}
.voice-player-container .voice-play-btn:hover {
  background-color: #f0f9f4;
}
.voice-player-container .voice-pause-btn,
.voice-player-container .voice-play-btn {
  margin-right: 4px;
  background-repeat: no-repeat;
  background-position: center;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  background-size: 90%;
  border-radius: 50%;
  border: none;
  background-color: transparent;
  outline: none;
}