* { box-sizing: border-box; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  max-width: 720px;
  margin: 0 auto;
  padding: 24px;
  color: #1a1a1a;
  background: #fafafa;
}

header {
  margin-bottom: 24px;
}

h1 {
  font-size: 1.4rem;
  margin-bottom: 4px;
}

.subtitle {
  color: #666;
  font-size: 0.85rem;
  margin-top: 0;
}

section {
  margin-bottom: 28px;
  padding: 16px;
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 8px;
}

.hidden {
  display: none;
}

.lesson-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.lesson-btn {
  text-align: left;
  padding: 10px 12px;
  border: 1px solid #ccc;
  border-radius: 6px;
  background: #f5f5f5;
  cursor: pointer;
}

.lesson-btn:hover {
  background: #eee;
}

.lesson-btn .lesson-unit {
  display: block;
  font-size: 0.75rem;
  color: #777;
}

.lesson-btn .lesson-checkpoint {
  color: #a35a00;
  font-weight: 600;
}

#scenario-content p {
  margin: 4px 0;
}

#guide-panel ul {
  padding-left: 18px;
}

#guide-panel .criterion-met {
  text-decoration: line-through;
  color: #2a8f2a;
}

.chat-log {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 400px;
  overflow-y: auto;
  margin-bottom: 12px;
  padding: 8px;
  background: #fcfcfc;
  border: 1px solid #eee;
  border-radius: 6px;
}

.chat-msg {
  padding: 8px 10px;
  border-radius: 8px;
  max-width: 85%;
  font-size: 0.92rem;
}

.chat-msg.npc {
  background: #eef2ff;
  align-self: flex-start;
}

.chat-msg.user {
  background: #dff5e1;
  align-self: flex-end;
}

.chat-msg .speaker {
  display: block;
  font-size: 0.7rem;
  color: #777;
  margin-bottom: 2px;
}

.mic-btn {
  padding: 0 10px;
  font-size: 0.95rem;
  line-height: 1.4;
  background: none;
  border: 1px solid #ccc;
  border-radius: 4px;
  cursor: pointer;
  opacity: 0.7;
}

.mic-btn:hover {
  opacity: 1;
}

.mic-btn:disabled {
  cursor: default;
  opacity: 0.4;
}

.mic-btn.listening {
  opacity: 1;
  border-color: #c0392b;
  background: #f8d7da;
}

.chat-msg.flag-mild {
  border: 1px solid #d99700;
}

.chat-msg.flag-severe {
  border: 1px solid #c0392b;
}

#turn-form {
  display: flex;
  align-items: stretch;
  gap: 8px;
}

#turn-input {
  flex: 1;
  padding: 8px;
  font-size: 0.95rem;
}

button {
  padding: 8px 14px;
  cursor: pointer;
}

#turn-counter {
  font-size: 0.8rem;
  color: #777;
  margin-top: 6px;
}

.checklist-item {
  display: flex;
  gap: 8px;
  align-items: baseline;
}

.checklist-item .met {
  color: #2a8f2a;
}

.checklist-item .unmet {
  color: #c0392b;
}

.resolution-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 0.8rem;
  font-weight: 600;
  margin-bottom: 8px;
}

.resolution-approving { background: #dff5e1; color: #1e6b1e; }
.resolution-scaled { background: #fff3cd; color: #8a6300; }
.resolution-negative { background: #f8d7da; color: #a12b2b; }

.stt-results {
  display: flex;
  gap: 16px;
  margin-top: 12px;
}

.stt-results > div {
  flex: 1;
}

.stt-transcript {
  min-height: 3em;
  padding: 8px;
  background: #fcfcfc;
  border: 1px solid #eee;
  border-radius: 6px;
  font-size: 0.9rem;
}
