/* Extracted from index.html. Keep loaded before responsive.css. */

.brand {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 12px;
    }

.brand-logo-link {
      display: inline-flex;
      align-items: center;
      flex: 1 1 auto;
      min-width: 0;
      text-decoration: none;
    }

.brand-logo {
      display: block;
      width: min(128px, 100%);
      max-height: 32px;
      height: auto;
      object-fit: contain;
    }

.brand-actions {
      display: flex;
      align-items: center;
      gap: 8px;
    }

.status {
      display: inline-flex;
      align-items: center;
      gap: 7px;
      min-height: 28px;
      padding: 6px 10px;
      border-radius: 999px;
      color: var(--muted);
      background: var(--panel-soft);
      font-size: 12px;
      white-space: nowrap;
    }

.status-dot {
      width: 8px;
      height: 8px;
      border-radius: 999px;
      background: #94a3b8;
    }

.status.connected .status-dot {
      background: var(--success);
    }

.status.disconnected .status-dot,
    .status.error .status-dot {
      background: var(--danger);
    }

.settings-button,
    .secondary-button,
    .danger-button,
    .link-button,
    .chat-back-button,
    .load-more-button {
      border: 0;
      border-radius: 12px;
      padding: 9px 12px;
      font-weight: 800;
      cursor: pointer;
      transition: opacity 0.15s, transform 0.15s;
    }

.settings-button:hover,
    .secondary-button:hover,
    .danger-button:hover,
    .link-button:hover,
    .load-more-button:hover {
      transform: translateY(-1px);
    }

.settings-button:disabled,
    .secondary-button:disabled,
    .danger-button:disabled,
    .link-button:disabled,
    .load-more-button:disabled {
      cursor: not-allowed;
      opacity: 0.55;
      transform: none;
    }

.settings-button {
      color: var(--primary);
      background: var(--primary-soft);
      white-space: nowrap;
    }

.secondary-button,
    .load-more-button {
      color: var(--text);
      background: var(--panel-soft);
      border: 1px solid var(--line);
    }

.danger-button {
      color: white;
      background: var(--danger);
    }

.link-button {
      color: var(--primary);
      background: transparent;
      padding: 4px 0;
    }

.chat-back-button {
      display: none;
      align-items: center;
      justify-content: center;
      flex: 0 0 auto;
      color: var(--primary);
      background: var(--primary-soft);
      white-space: nowrap;
    }

.profile-card,
    .account-card,
    .section,
    .agent-card,
    .api-key-box {
      border: 1px solid var(--line);
      border-radius: 18px;
      background: var(--panel-soft);
      padding: 14px;
    }

.profile-card label,
    .section-title,
    .field-label {
      display: block;
      margin-bottom: 10px;
      color: var(--muted);
      font-size: 12px;
      font-weight: 700;
      letter-spacing: 0.08em;
      text-transform: uppercase;
    }

.rooms,
    .notifications {
      display: flex;
      flex-direction: column;
      gap: 10px;
    }

.room,
    .notification,
    .settings-room {
      border: 1px solid transparent;
      border-radius: 16px;
      background: white;
      padding: 12px;
      cursor: pointer;
      transition: transform 0.15s, border-color 0.15s, background 0.15s;
    }

.room:hover,
    .notification:hover,
    .settings-room:hover {
      transform: translateY(-1px);
      border-color: #bfdbfe;
      background: #f8fbff;
    }

.room.active,
    .settings-room.active {
      border-color: #93c5fd;
      background: var(--primary-soft);
    }

.room-name,
    .notification-title,
    .settings-room-title {
      font-weight: 750;
    }

.badge {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      min-width: 24px;
      height: 24px;
      border-radius: 999px;
      padding: 0 8px;
      color: white;
      background: var(--danger);
      font-size: 12px;
      font-weight: 800;
    }

.notice,
    .preview {
      margin-top: 6px;
      color: var(--muted);
      font-size: 13px;
      line-height: 1.35;
    }

.preview {
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }

.chat-title {
      margin: 0;
      font-size: 20px;
      letter-spacing: -0.03em;
    }

.chat-subtitle {
      margin-top: 4px;
      color: var(--muted);
      font-size: 13px;
    }

.typing-indicator {
      display: flex;
      position: absolute;
      top: -24px;
      left: 0;
      right: 0;
      align-items: flex-end;
      min-height: 30px;
      padding: 0 24px 10px;
      color: var(--primary);
      background: #00000000;
      font-size: 13px;
      font-weight: 700;
    }

.empty-state {
      display: grid;
      place-items: center;
      height: 100%;
      color: var(--muted);
      text-align: center;
    }

.load-more-wrap {
      display: flex;
      justify-content: center;
      margin-bottom: 18px;
    }

.scroll-to-bottom-button {
      position: absolute;
      left: 50%;
      bottom: calc(var(--composer-height, 86px) + 14px);
      z-index: 20;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      width: 44px;
      height: 44px;
      border: 1px solid rgba(37, 99, 235, 0.18);
      border-radius: 999px;
      color: var(--primary);
      background: rgba(255, 255, 255, 0.96);
      font-size: 24px;
      font-weight: 900;
      line-height: 1;
      box-shadow: 0 14px 34px rgba(15, 23, 42, 0.18);
      cursor: pointer;
      transform: translateX(-50%);
      transition: transform 0.15s, box-shadow 0.15s, opacity 0.15s;
    }

.scroll-to-bottom-button:hover {
      box-shadow: 0 18px 40px rgba(15, 23, 42, 0.22);
      transform: translateX(-50%) translateY(-1px);
    }

.scroll-to-bottom-button:focus-visible {
      outline: 3px solid var(--primary-soft);
      outline-offset: 3px;
    }

.scroll-to-bottom-button[hidden] {
      display: none;
    }

.message-row {
      display: flex;
      margin-bottom: 14px;
    }

.message-row.mine {
      justify-content: flex-end;
    }

.message-bubble {
      max-width: min(620px, 74%);
      border: 1px solid var(--line);
      border-radius: 18px 18px 18px 6px;
      background: var(--bubble-other);
      padding: 10px 13px;
      box-shadow: 0 10px 24px rgba(15, 23, 42, 0.05);
    }

.message-row.mine .message-bubble {
      border-color: #facc15;
      border-radius: 18px 18px 6px 18px;
      background: var(--bubble-mine);
    }

.meta {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 12px;
      margin-bottom: 5px;
      color: var(--muted);
      font-size: 12px;
    }

.text {
      white-space: pre-wrap;
      word-break: break-word;
      line-height: 1.45;
    }

.read-count {
      position: relative;
      margin-left: 8px;
      color: #a16207;
      font-size: 12px;
      font-weight: 800;
      cursor: help;
    }

.read-count[data-tooltip]:hover::after {
      position: absolute;
      right: 0;
      bottom: calc(100% + 8px);
      z-index: 30;
      min-width: 160px;
      max-width: 260px;
      padding: 8px 10px;
      border-radius: 10px;
      color: white;
      background: rgba(15, 23, 42, 0.92);
      content: attr(data-tooltip);
      line-height: 1.35;
      white-space: normal;
      box-shadow: 0 10px 28px rgba(15, 23, 42, 0.18);
    }

.message-input {
      flex: 1 1 auto;
      display: block;
      width: 100%;
      min-width: 0;
      min-height: 46px;
      max-height: min(28vh, 180px);
      border: 1px solid #cbd5e1;
      border-radius: 16px;
      background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
      padding: 12px 14px;
      color: var(--text);
      resize: none;
      overflow-y: hidden;
      line-height: 1.45;
      white-space: pre-wrap;
      box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.04), 0 8px 20px rgba(15, 23, 42, 0.04);
      transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
    }

.message-input:focus {
      border-color: var(--primary);
      background: #ffffff;
      box-shadow: 0 0 0 4px var(--primary-soft), 0 10px 24px rgba(37, 99, 235, 0.08);
    }

.message-input::placeholder {
      color: #94a3b8;
    }


.send-button {
      align-self: flex-end;
      min-height: 46px;
      border: 0;
      border-radius: 14px;
      color: white;
      background: var(--primary);
      padding: 0 20px;
      font-weight: 800;
      cursor: pointer;
      transition: opacity 0.15s, transform 0.15s;
    }

.send-button:hover:not(:disabled) {
      transform: translateY(-1px);
    }

.send-button:disabled,
    input:disabled,
    textarea:disabled {
      cursor: not-allowed;
      opacity: 0.55;
    }

.error {
      min-height: 18px;
      margin-top: 8px;
      color: var(--danger);
      font-size: 13px;
    }

.modal h2,
    .modal h3 {
      margin: 0 0 12px;
      letter-spacing: -0.03em;
    }

.modal-actions,
    .form-actions {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 10px;
      margin-top: 14px;
    }

.settings-room-list,
    .member-list {
      display: flex;
      flex-direction: column;
      gap: 10px;
    }

.field {
      margin-bottom: 16px;
    }

.member-option {
      display: flex;
      align-items: center;
      gap: 10px;
      border: 1px solid var(--line);
      border-radius: 14px;
      background: white;
      padding: 10px 12px;
      color: var(--text);
      font-size: 14px;
    }

.member-option input {
      width: auto;
      margin: 0;
    }

.auth-logo-wrap {
      display: flex;
      align-items: center;
      width: min(260px, 82%);
      max-width: 100%;
      margin-bottom: 16px;
    }

.auth-logo {
      display: block;
      width: 100%;
      max-height: 64px;
      height: auto;
      object-fit: contain;
    }

.auth-hero p {
      margin: 0;
      color: var(--muted);
      line-height: 1.6;
    }

.auth-tabs {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 8px;
      margin-bottom: 18px;
      padding: 6px;
      border-radius: 16px;
      background: var(--panel-soft);
    }

.auth-tab {
      border: 0;
      border-radius: 12px;
      background: transparent;
      color: var(--muted);
      padding: 10px 12px;
      cursor: pointer;
      font-weight: 800;
    }

.auth-tab.active {
      background: white;
      color: var(--primary);
      box-shadow: 0 8px 18px rgba(15, 23, 42, 0.08);
    }

.auth-form {
      display: none;
    }

.auth-form.active {
      display: block;
    }

.auth-submit {
      width: 100%;
      border: 0;
      border-radius: 14px;
      color: white;
      background: var(--primary);
      padding: 13px 16px;
      font-weight: 850;
      cursor: pointer;
    }

.auth-submit:disabled {
      cursor: not-allowed;
      opacity: 0.55;
    }

.account-card {
      display: flex;
      flex-direction: column;
      gap: 10px;
    }

.account-email {
      overflow: hidden;
      color: var(--text);
      font-weight: 800;
      text-overflow: ellipsis;
      white-space: nowrap;
    }

.agent-management {
      margin-top: 24px;
      padding-top: 18px;
      border-top: 1px solid var(--line);
    }

.agent-list {
      display: flex;
      flex-direction: column;
      gap: 10px;
      margin-bottom: 16px;
    }

.agent-card {
      display: flex;
      flex-direction: column;
      gap: 10px;
      background: white;
    }

.agent-meta {
      color: var(--muted);
      font-size: 12px;
      line-height: 1.45;
      word-break: break-all;
    }

.agent-actions {
      display: flex;
      flex-wrap: wrap;
      justify-content: flex-end;
      gap: 8px;
    }

.api-key-box {
      display: flex;
      flex-direction: column;
      gap: 10px;
      margin: 14px 0;
      background: #fff7ed;
      border-color: #fed7aa;
    }

.api-key-box[hidden] {
      display: none;
    }

.api-key-value {
      width: 100%;
      border: 1px solid #fdba74;
      border-radius: 12px;
      background: white;
      padding: 10px;
      color: #9a3412;
      font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
      font-size: 12px;
      line-height: 1.45;
      overflow-wrap: anywhere;
      user-select: all;
    }
/* Feedback request card and action styles */
.feedback-card {
  border: 1px solid var(--line);
  padding: 14px;
  border-radius: 12px;
  background-color: var(--panel-soft);
  width: 100%;
  box-sizing: border-box;
  margin-top: 6px;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.03);
}

.feedback-header {
  font-weight: 800;
  margin-bottom: 8px;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.feedback-actions {
  margin-top: 12px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.btn-approve,
.btn-reject,
.btn-feedback-input {
  border: 0;
  border-radius: 8px;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: opacity 0.15s, transform 0.15s;
  color: white;
}

.btn-approve:hover,
.btn-reject:hover,
.btn-feedback-input:hover {
  transform: translateY(-1px);
  opacity: 0.9;
}

.btn-approve {
  background-color: var(--success);
}

.btn-reject {
  background-color: var(--danger);
}

.btn-feedback-input {
  background-color: #0284c7; /* info blue */
}

.feedback-status {
  margin-top: 10px;
  font-weight: 800;
  font-size: 13px;
  padding: 6px 10px;
  border-radius: 6px;
  display: inline-block;
}

.feedback-status.approved {
  color: var(--success);
  background-color: #f0fdf4;
}

.feedback-status.rejected {
  color: var(--danger);
  background-color: #fef2f2;
}

.feedback-status.submitted {
  color: #0284c7;
  background-color: #f0f9ff;
  font-style: italic;
}

/* Feedback Mode Bar above composer */
.feedback-mode-bar {
  background-color: #eff6ff;
  border: 1px solid #bfdbfe;
  padding: 10px 14px;
  border-radius: 12px;
  margin-bottom: 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  color: #1e40af;
  animation: slideDown 0.2s ease-out;
}

.btn-cancel-feedback {
  background: none;
  border: none;
  color: var(--danger);
  cursor: pointer;
  font-weight: 800;
  font-size: 13px;
  padding: 4px 8px;
}

.btn-cancel-feedback:hover {
  text-decoration: underline;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Clean standalone feedback request bubble styling to avoid nested borders/shadows */
.message-bubble.feedback-request-bubble {
  max-width: 85%;
  width: 100%;
  border: 1px solid var(--line);
  padding: 14px;
  border-radius: 12px;
  background-color: var(--panel-soft) !important;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.03);
}

.message-row.mine .message-bubble.feedback-request-bubble {
  border-color: var(--line) !important;
  border-radius: 12px !important;
  background: var(--panel-soft) !important;
  color: var(--text) !important;
}

.feedback-request-bubble .text {
  color: var(--text) !important;
  font-size: 14px;
  line-height: 1.5;
}

/* -----------------------------------------------
 * [지훈님 피드백 반영] 마크다운 적용에 따른 말풍선 크기 & 줄간격 개선안
 * ----------------------------------------------- */

.message-bubble .text {
  white-space: normal;
  line-height: 1.5;
}

.message-bubble .text p {
  display: inline;
  margin: 0;
}

.message-bubble .text p + p {
  display: block;
  margin-top: 8px;
}

.message-bubble .text ul,
.message-bubble .text ol {
  margin: 4px 0;
  padding-left: 20px;
}

.message-bubble .text li {
  margin: 2px 0;
}

.message-bubble .text blockquote {
  margin: 6px 0;
  padding-left: 10px;
  border-left: 3px solid var(--line);
  color: var(--muted);
}