* { margin: 0; padding: 0; box-sizing: border-box; }
body {
  font-family: "Hiragino Sans", "Yu Gothic", "Meiryo", sans-serif;
  background: #f5f5f0; color: #333; line-height: 1.7;
}
#app { max-width: 760px; margin: 0 auto; padding: 16px; }
header { text-align: center; margin-bottom: 20px; padding-bottom: 14px; border-bottom: 2px solid #8b7355; }
header h1 { font-size: 1.3rem; color: #4a3520; }
#status { margin-top: 6px; font-size: 0.8rem; color: #888; }
main { background: #fff; border-radius: 8px; padding: 24px; box-shadow: 0 2px 8px rgba(0,0,0,0.08); }

.section-title { font-size: 1.05rem; color: #4a3520; margin-bottom: 14px; font-weight: bold; }

.persona-card {
  padding: 16px; border: 2px solid #ddd; border-radius: 8px;
  margin-bottom: 12px; cursor: pointer; transition: all 0.2s;
}
.persona-card:hover { border-color: #8b7355; background: #faf8f0; }
.persona-card h3 { color: #4a3520; margin-bottom: 6px; }
.persona-card .complaint { color: #666; font-size: 0.95rem; }

/* Chat */
.chat-area { max-height: 360px; overflow-y: auto; border: 1px solid #eee; border-radius: 8px; padding: 12px; margin-bottom: 12px; background: #faf8f0; }
.msg { margin-bottom: 10px; padding: 10px 14px; border-radius: 10px; max-width: 85%; word-wrap: break-word; }
.msg.patient { background: #fff; border: 1px solid #e0d8c8; }
.msg.student { background: #e6f0fa; border: 1px solid #c8d8e8; margin-left: auto; text-align: right; }
.msg .role { font-size: 0.75rem; color: #999; margin-bottom: 2px; }
.msg.patient .role { color: #8b7355; }
.msg.student .role { color: #5a8; }

.input-row { display: flex; gap: 8px; margin-bottom: 12px; }
.input-row input { flex: 1; padding: 10px; border: 1px solid #ddd; border-radius: 6px; font-family: inherit; font-size: 0.95rem; }
.send-btn { padding: 10px 20px; border: none; border-radius: 6px; background: #8b7355; color: #fff; cursor: pointer; font-family: inherit; font-size: 0.95rem; }
.send-btn:hover { background: #6b5340; }
.send-btn:disabled { background: #ccc; cursor: not-allowed; }

.end-btn { display: block; width: 100%; padding: 12px; border: none; border-radius: 6px; background: #c44; color: #fff; font-size: 1rem; cursor: pointer; font-family: inherit; margin-bottom: 12px; }
.end-btn:hover { background: #a33; }

/* Assessment form */
.assessment { padding: 16px; background: #faf8f0; border-radius: 8px; }
.assessment label { display: block; font-weight: bold; color: #4a3520; margin: 12px 0 4px; }
.assessment input, .assessment textarea { width: 100%; padding: 10px; border: 1px solid #ddd; border-radius: 6px; font-family: inherit; font-size: 0.95rem; }
.assessment textarea { min-height: 60px; resize: vertical; }
.assessment .hint { font-size: 0.8rem; color: #999; margin-top: 2px; }

.submit-btn { display: block; width: 100%; padding: 14px; border: none; border-radius: 6px; background: #8b7355; color: #fff; font-size: 1.05rem; cursor: pointer; font-family: inherit; margin-top: 16px; }
.submit-btn:hover { background: #6b5340; }

/* Results */
.results h2 { color: #4a3520; margin-bottom: 16px; }
.results-table { width: 100%; border-collapse: collapse; margin-bottom: 16px; }
.results-table th, .results-table td { padding: 8px 12px; border-bottom: 1px solid #eee; text-align: left; }
.results-table th { background: #faf8f0; color: #4a3520; font-size: 0.9rem; }
.results-table .score-cell { font-weight: bold; text-align: center; }
.total-score { font-size: 1.5rem; color: #8b7355; text-align: center; margin: 20px 0; }
.feedback-section { padding: 12px; background: #faf8f0; border-radius: 6px; margin-bottom: 12px; }
.feedback-section .label { font-weight: bold; color: #4a3520; }

.restart-btn { display: block; width: 100%; padding: 12px; border: none; border-radius: 6px; background: #8b7355; color: #fff; font-size: 1rem; cursor: pointer; font-family: inherit; }
.restart-btn:hover { background: #6b5340; }

/* API settings */
.api-bar { display: flex; gap: 8px; margin-bottom: 16px; flex-wrap: wrap; }
.api-bar select, .api-bar input { padding: 6px 10px; border: 1px solid #ddd; border-radius: 4px; font-family: inherit; font-size: 0.85rem; }
.api-bar input { flex: 1; min-width: 180px; }
.api-bar label { font-size: 0.8rem; color: #888; align-self: center; }
