/* Header */
.site-header {
  position: sticky;
  top: 0;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: saturate(180%) blur(10px);
  border-bottom: 1px solid var(--border);
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
}

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

.logo {
  font-weight: 700;
  letter-spacing: 0.4px;
  font-size: 22px;
  color: var(--text);
}

.logo-img {
  height: auto;
  width: 100px;
  display: block;
}

@media (min-width: 900px) {
  .logo-img {
    max-height: 28px;
  }
}

.tagline {
  color: var(--muted);
  font-size: 12px;
}

.top-nav a {
  color: var(--brand);
  font-weight: 400;
  padding: 8px 12px;
}

.top-nav a:hover {
  background: #f2f2f2;
  text-decoration: none;
}

.top-nav a+a {
  margin-left: 8px;
}

td {
  vertical-align: middle;
}

audio {
  width: 100% !important;
  min-width: unset !important;
  max-width: unset !important;
}

.timestamp-label {
  color: gray;
}

table.wide-audio audio {
  width: 40vw;
  max-width: 40vw;
}

.chat-container {
  max-width: 800px;
  margin: 0px auto;
  font-family: Arial, sans-serif;
  background-color: white;
  border-radius: 8px;
}

.message {
  padding: 10px 15px;
  border-radius: 15px;
  max-width: 70%;
  clear: both;
  background-color: #f8f9fa;
  border: 1px solid #ddd;
}

.user-message {
  float: left;
  background-color: white;
}

.assistant-message {
  float: right;
}

.music-message {
  float: right;
  font-family: monospace;
}

/* Ground truth와 prediction 섹션의 메시지들도 동일하게 적용 */
.ground-truth.assistant-message,
.ground-truth.music-message,
.prediction.assistant-message,
.prediction.music-message {
  float: right;
}

.ground-truth.user-message,
.prediction.user-message {
  float: left;
}

.message-container {
  overflow: hidden;
  margin-bottom: 10px;
}

/* Highlight last assistant and music messages */
.message-container:nth-last-of-type(1) .music-message,
.message-container:nth-last-of-type(2) .assistant-message {
  background-color: #e8f5e9;
  border: 1px solid #c8e6c9;
}

.chat-section {
  margin: 40px 0;
  padding: 20px;
  border: 1px solid #ddd;
  border-radius: 8px;
}

.chat-title {
  font-size: 1.2em;
  margin-bottom: 20px;
  color: #333;
  text-align: left;
}

.comparison-container {
  /* border-top: 2px solid #eee; */
  padding-top: 20px;
  /* margin: 0 -10px; */
}

.ground-truth {
  border: 2px solid #af9d4c;
}

.prediction {
  border: 2px solid #2196F3;
}

h5 {
  color: #666;
  margin-bottom: 15px;
  text-align: left;
}

.col-md-6 {
  padding: 0 15px;
}

.col-md-6+.col-md-6 {
  border-left: 1px solid #eee;
  padding-left: 30px;
}

/* Ground Truth와 Prediction 섹션의 메시지 너비 확장 */
.ground-truth.message,
.prediction.message {
  max-width: 100%;
}

.tag-list {
  margin: 8px 0;
}

.tag {
  display: inline-block;
  background-color: #e9ecef;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 0.8em;
  margin: 2px;
  color: #666;
}

.more-tag {
  background-color: #dee2e6;
  color: #495057;
}

.music-title {
  margin-bottom: 8px;
}

.music-message audio {
  margin-top: 8px;
  width: 100%;
}

.section-divider {
  margin: 30px 0;
  border: 0;
  border-top: 1px solid #dee2e6;
  opacity: 0.8;
}

.text-small-gray {
  font-size: 0.85em;
  color: #6c757d;
  display: inline-block;
  margin: 0px;
}

/* --- Enhanced chat UI for tools page (.chat-msg based markup) --- */
.chat-msg {
  position: relative;
  display: block;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
  transition: background-color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.chat-msg+.chat-msg {
  margin-top: 10px;
}

.chat-msg.is-user {
  background-color: #ffffff;
  border-color: #e6e9ef;
}

.chat-msg.is-assistant {
  background-color: #eef8f2;
  border-color: #d9f0e3;
}

.chat-msg.is-music {
  background-color: #f2ecff;
  border-color: #e3d9ff;
}

/* CoT bubbles: white background as requested */
.chat-msg.is-cot {
  background-color: #ffffff;
  border-color: #ffffff;
  box-shadow: none;
}

.role-cot {
  color: #6c757d;
}

.chat-role {
  font-size: 0.8rem;
  letter-spacing: 0.02em;
  opacity: 0.8;
}

.chat-msg.align-right {
  margin-left: auto;
}

/* Subtle hover emphasis */
.chat-msg:hover {
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

/* Monospace content tweaks */
.chat-msg .mono {
  word-break: break-all;
}

/* Responsive bubble width */
@media (max-width: 576px) {
  .chat-msg {
    max-width: 100% !important;
  }
}

/* Music thumbnail in bubbles */
.music-thumb {
  width: 112px;
  height: 112px;
  object-fit: cover;
  border-radius: 6px;
  display: block;
}

.music-block {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.music-meta {
  flex: 1;
  min-width: 0;
}

/* Tiny CoT text blocks */
.cot-small {
  font-size: 0.9em;
  color: #8a8f98;
  white-space: pre-wrap;
}
