:root {
  color-scheme: light;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #20313a;
  background: #f5faf9;
}

html {
  scroll-behavior: smooth;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: #f7f9fa !important;
  overflow-y: auto;
}

.shell {
  width: min(960px, calc(100% - 32px));
  margin: 0 auto;
  padding: 56px 0;
}

.panel {
  border: 1px solid #d7e6e3;
  border-radius: 8px;
  background: #ffffff;
  padding: 32px;
}

.eyebrow {
  margin: 0 0 8px;
  color: #4b7f78;
  font-size: 14px;
  font-weight: 700;
}

h1 {
  margin: 0 0 16px;
  font-size: 32px;
  line-height: 1.2;
}

p {
  margin: 0 0 12px;
  line-height: 1.7;
}

.links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 24px;
}

a {
  color: #236b62;
  font-weight: 700;
}

.button-link {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  border: 1px solid #b9d8d2;
  border-radius: 6px;
  padding: 0 14px;
  text-decoration: none;
  background: #eef8f6;
}

.student-card {
  width: 100%;
  max-width: 800px !important;
  margin: 0 auto;
}

.lead {
  color: #39545d;
  font-size: 17px;
}

.form-stack {
  display: grid;
  gap: 18px;
  margin-top: 24px;
}

label {
  display: grid;
  gap: 8px;
  font-weight: 700;
}

input[type="text"],
input[type="password"],
input:not([type]),
select,
textarea {
  width: 100%;
  border: 1px solid #b9d8d2;
  border-radius: 6px;
  padding: 10px 12px;
  font: inherit;
}

input[type="text"]:focus,
input[type="password"]:focus,
input:not([type]):focus,
select:focus,
textarea:focus {
  border-color: #5bae9e;
  outline: none;
  box-shadow: 0 0 0 3px rgba(91, 174, 158, 0.16);
}

input[type="text"],
input[type="password"],
input:not([type]),
select {
  min-height: 44px;
}

textarea {
  min-height: 96px;
  resize: vertical;
}

button {
  min-height: 44px;
  border: 1px solid #236b62;
  border-radius: 6px;
  padding: 0 18px;
  color: #ffffff;
  background: #236b62;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

button:disabled {
  border-color: #c9d8d5;
  color: #8aa09c;
  background: #eef4f3;
  cursor: not-allowed;
}

button.secondary {
  color: #236b62;
  background: #ffffff;
}

button.danger-outline {
  border-color: #b8322a;
  color: #9f241d;
}

button.danger-outline:hover:not(:disabled) {
  background: #fff4f2;
}

.message {
  border-radius: 6px;
  padding: 12px 14px;
}

.message.error {
  color: #8a1f17;
  background: #fff0ee;
}

.message.warning {
  color: #6f4b00;
  background: #fff7df;
}

.message.success {
  color: #1f5c3b;
  background: #eaf8ef;
}

.notice-card {
  display: grid;
  gap: 10px;
  margin: 20px 0;
  border: 1px solid #d7e6e3;
  border-radius: 8px;
  padding: 18px;
  background: #f8fcfb;
}

.notice-card p {
  margin: 0;
}

.check-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 18px 0;
  font-weight: 700;
}

.check-row input {
  width: 18px;
  height: 18px;
}

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

.meta-line {
  color: #4b7f78;
  font-weight: 700;
}

.assistant-row {
  display: grid;
  grid-template-columns: 56px 1fr;
  gap: 16px;
  align-items: start;
}

.assistant-avatar {
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  color: #ffffff;
  background: #236b62;
  font-weight: 800;
}

.chat-block,
.module-header,
.question-card {
  display: grid;
  gap: 16px;
}

.conversation-shell {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 16px;
  width: 100%;
  max-width: 768px;
  min-height: 0;
  margin: 0 auto;
}

.chat-log {
  display: flex;
  flex: 1;
  flex-direction: column;
  justify-content: flex-start;
  gap: 14px;
  min-height: 0;
  overflow-y: auto;
  padding: 4px 4px 35vh;
  scroll-behavior: smooth !important;
}

.messages-end-anchor {
  clear: both;
  flex: 0 0 1px;
  height: 1px;
  width: 1px;
}

.questionnaire-chat {
  min-height: 340px;
}

.chat-message {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.chat-message.student {
  justify-content: flex-end;
}

.message-group.assistant {
  display: grid;
  gap: 12px;
}

.question-block-container {
  min-height: 136px;
}

.chat-avatar {
  position: relative;
  display: inline-flex;
  flex: 0 0 44px;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border: 1px solid #bfe5df;
  border-radius: 999px;
  color: #4fa79c;
  background: #eaf8f6;
}

.chat-avatar svg {
  display: block;
  width: 34px;
  height: 34px;
}

.chat-avatar svg path {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.chat-avatar svg .whale-body {
  fill: #73c7bd;
  stroke: #4fa79c;
  stroke-width: 1.3;
}

.chat-avatar svg .whale-belly {
  fill: #f8fffb;
  stroke: #b9ded8;
  stroke-width: 1.1;
}

.chat-avatar svg .whale-fin {
  fill: #69bab1;
  stroke: #4fa79c;
  stroke-width: 1.2;
}

.chat-avatar svg .whale-eye {
  fill: #1f3437;
  stroke: #ffffff;
  stroke-width: 1;
}

.chat-avatar svg .whale-eye-shine {
  fill: #ffffff;
  stroke: none;
}

.chat-avatar svg .whale-smile,
.chat-avatar svg .whale-sprout-stem,
.chat-avatar svg .whale-wave {
  fill: none;
  stroke: #4f9f93;
}

.chat-avatar svg .whale-leaf {
  fill: #8bd4ca;
  stroke: #4f9f93;
  stroke-width: 1.2;
}

.ai-avatar.is-thinking::after,
.ai-avatar.is-listening::after {
  content: "";
  position: absolute;
  inset: -6px;
  border: 1px solid rgba(91, 174, 158, 0.35);
  border-radius: 999px;
  pointer-events: none;
  animation: avatar-breathe 2.2s ease-in-out infinite;
}

@keyframes avatar-breathe {
  0%,
  100% {
    transform: scale(0.96);
    opacity: 0.25;
  }

  50% {
    transform: scale(1.06);
    opacity: 0.65;
  }
}

.chat-avatar.ghost-avatar {
  border-color: transparent;
  color: transparent;
  background: transparent;
}

.bubble {
  max-width: min(82%, 760px);
  border-radius: 8px;
  padding: 13px 15px;
  line-height: 1.7;
}

.ai-bubble {
  border: 1px solid #d7e6e3;
  border-radius: 8px;
  padding: 14px 16px;
  background: #f8fcfb;
}

.chat-message .ai-bubble {
  margin: 0;
}

.student-bubble {
  color: #ffffff;
  background: #236b62;
}

.module-intro-bubble .ai-bubble {
  border-color: #c9e3df;
  background: #eef8f6;
  color: #244c47;
}

.current-question .ai-bubble {
  border-color: #9ccac2;
}

.questionnaire-edit-hint {
  margin: -6px 0 0;
  color: #5f7777;
  font-size: 13px;
  font-weight: 700;
}

.questionnaire-chat {
  gap: 7px;
  padding-bottom: 24vh;
}

.progressive-question-block {
  min-height: auto;
  padding-bottom: 0;
  gap: 6px;
}

.progressive-question-block.answered-question:not(.current-question) {
  border: 1px solid rgba(203, 231, 225, 0.55);
  border-radius: 12px;
  padding: 6px 7px 7px;
  background: rgba(255, 255, 255, 0.78);
  opacity: 0.86;
}

.progressive-question-block.answered-question:not(.current-question):focus-within,
.progressive-question-block.answered-question:not(.current-question):hover {
  opacity: 1;
}

.progressive-question-block.current-question {
  border: 1px solid #9fd4ca;
  border-radius: 12px;
  padding: 7px 7px 8px;
  background: #f1faf7;
  box-shadow: 0 7px 16px rgba(55, 112, 103, 0.065);
}

.module-intro-card {
  display: grid;
  gap: 12px;
  border: 1px solid #bde1da;
  border-radius: 16px;
  padding: 14px 12px 16px;
  background: #f3fbf8;
  box-shadow: 0 10px 24px rgba(55, 112, 103, 0.08);
}

.module-intro-card .chat-message {
  align-items: flex-start;
}

.module-intro-card .module-intro-bubble {
  width: min(100%, 680px);
  max-width: 680px;
  border-color: #c9e3df;
  background: #ffffff;
}

.module-intro-card h2 {
  margin: 0 0 6px;
  color: #244c47;
  font-size: 18px;
  line-height: 1.35;
}

.module-intro-card p {
  margin: 0;
  color: #486765;
  line-height: 1.75;
}

.module-intro-actions {
  margin-left: 54px;
}

.module-intro-actions button {
  min-width: 144px;
  min-height: 42px;
  border-color: #84cdbb;
  border-radius: 999px;
  padding: 0 18px;
  color: #315f59;
  background: #aee4d4;
  font-weight: 800;
  box-shadow: 0 8px 18px rgba(91, 174, 158, 0.12);
}

.module-intro-actions button:hover:not(:disabled) {
  border-color: #76c1af;
  background: #9cdbc9;
}

.progressive-question-block .ai-bubble {
  width: min(100%, 680px);
  max-width: 680px;
  padding: 10px 13px;
  line-height: 1.6;
}

.progressive-question-block .quick-reply-panel {
  width: min(calc(100% - 44px), 680px);
  margin-bottom: 6px;
}

.progressive-question-block .option-grid {
  gap: 7px;
}

.question-number-label {
  margin-right: 4px;
  color: #4f8f86;
  font-weight: 800;
}

.questionnaire-submit-panel {
  display: grid;
  gap: 12px;
  margin: 10px 0 28px 54px;
  border: 1px solid #cbe7e1;
  border-radius: 16px;
  padding: 16px;
  background: #f8fcfb;
  box-shadow: 0 10px 24px rgba(55, 112, 103, 0.08);
}

.questionnaire-submit-panel p {
  margin: 0;
  color: #244c47;
  font-weight: 700;
}

.questionnaire-submit-panel button {
  justify-self: start;
}

.questionnaire-submit-progress {
  z-index: 80;
}

.questionnaire-submit-progress-panel {
  display: grid;
  gap: 14px;
  width: min(420px, 100%);
}

.questionnaire-submit-progress-panel h2 {
  margin-bottom: 0;
}

.submit-progress-detail,
.submit-progress-hint {
  margin: 0;
  color: #49615e;
  line-height: 1.6;
}

.submit-progress-hint {
  color: #6d8280;
  font-size: 13px;
}

.submit-progress-track {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: #e7f3f1;
}

.submit-progress-track span {
  display: block;
  width: 8%;
  height: 100%;
  border-radius: inherit;
  background: #236b62;
  transition: width 180ms ease;
}

.submit-progress-close {
  justify-self: start;
  margin-top: 2px;
}

.current-question .bubble,
.current-question .quick-reply-panel {
  animation: smoothAppear 0.4s ease-out both;
  will-change: opacity, transform;
}

@keyframes smoothAppear {
  from {
    opacity: 0;
    transform: translateY(15px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.current-answer-panel {
  display: grid;
  gap: 12px;
  border-top: 1px solid #e5efed;
  padding-top: 16px;
}

.quick-reply-panel {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: flex-start;
  margin-top: -4px;
  margin-left: 44px;
  margin-bottom: 28px;
  padding-top: 0;
}

.chat-history-note {
  justify-self: center;
  margin: 0;
  border-radius: 999px;
  padding: 4px 10px;
  color: #7b8d91;
  background: #f3f8f7;
  font-size: 12px;
}

.chat-history-divider {
  display: block;
  margin: 24px 0;
  text-align: center;
}

.chat-history-divider::before,
.chat-history-divider::after {
  content: "";
  display: none;
}

.chat-history-divider span {
  display: inline-flex;
  border: 0;
  border-radius: 12px;
  padding: 6px 14px;
  color: #6b8080;
  background: #edf7f5;
  font-size: 14px;
  font-weight: 500;
}

.option-grid {
  display: grid;
  gap: 10px;
}

.choice-button {
  min-height: 46px;
  border-color: #b9d8d2;
  color: #20313a;
  background: #ffffff;
  text-align: left;
}

.choice-button.selected {
  border-color: #236b62;
  color: #ffffff;
  background: #236b62;
}

.student-body {
  --student-shell-padding-y: clamp(8px, 2.5svh, 24px);
  --student-panel-padding-y: clamp(18px, 3svh, 32px);
  --student-panel-padding-bottom: clamp(18px, 2.8svh, 28px);
  --student-ai-bottom-bar-space: calc(clamp(168px, 22svh, 236px) + env(safe-area-inset-bottom));
  color: #1f3437;
  background: #f3f8f5 !important;
  min-height: 100svh;
  height: auto;
  overflow-y: auto;
}

.student-body .shell {
  width: min(960px, calc(100% - 32px));
  max-width: 960px;
  min-height: 100svh;
  height: auto;
  overflow: visible;
  padding: var(--student-shell-padding-y) 0;
}

.student-body .app-container {
  display: flex;
  flex-direction: column;
  min-height: 100svh;
  height: auto;
  overflow: visible;
  background-color: transparent !important;
}

.student-body .panel {
  display: flex;
  flex-direction: column;
  min-height: calc(100svh - (var(--student-shell-padding-y) * 2));
  height: auto;
  overflow: visible;
  border-color: #e1ece8;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.98);
  padding: var(--student-panel-padding-y) 52px var(--student-panel-padding-bottom);
  box-shadow: 0 18px 42px rgba(54, 111, 105, 0.07);
}

.student-body .main-card {
  position: relative;
  flex: 1;
  display: flex;
  flex-direction: column;
  width: 100% !important;
  max-width: 960px !important;
  margin: 0 auto !important;
  border-radius: 18px !important;
  background-color: #fffefd !important;
}

.student-body #app {
  position: relative;
  display: flex;
  flex: 1;
  flex-direction: column;
  min-height: 0;
  height: 100%;
  overflow: visible;
}

.student-body .global-app-container {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-height: 0 !important;
  height: 100%;
  width: 100% !important;
  max-width: 960px !important;
  margin: 0 auto !important;
  overflow: visible;
  background-color: transparent !important;
}

.student-body #app[data-stage="ai_chat"],
.student-body #app[data-stage="voice_retest"] {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  height: calc(100vh - var(--student-shell-padding-y) - var(--student-shell-padding-y) - var(--student-panel-padding-y) - var(--student-panel-padding-bottom));
  height: calc(100dvh - var(--student-shell-padding-y) - var(--student-shell-padding-y) - var(--student-panel-padding-y) - var(--student-panel-padding-bottom));
  max-height: calc(100dvh - var(--student-shell-padding-y) - var(--student-shell-padding-y) - var(--student-panel-padding-y) - var(--student-panel-padding-bottom));
  min-height: 0 !important;
  overflow: hidden;
}

.student-body #app[data-stage="info"],
.student-body #app[data-stage="questionnaire"] {
  height: calc(100vh - var(--student-shell-padding-y) - var(--student-shell-padding-y) - var(--student-panel-padding-y) - var(--student-panel-padding-bottom));
  height: calc(100dvh - var(--student-shell-padding-y) - var(--student-shell-padding-y) - var(--student-panel-padding-y) - var(--student-panel-padding-bottom));
  max-height: calc(100dvh - var(--student-shell-padding-y) - var(--student-shell-padding-y) - var(--student-panel-padding-y) - var(--student-panel-padding-bottom));
  min-height: 0 !important;
  overflow: hidden;
}

.student-body .main-container {
  position: relative;
  display: flex;
  flex: 1;
  flex-direction: column;
  min-height: 0;
  height: auto;
  width: 100%;
  max-width: 860px;
  margin: 0 auto;
  overflow: visible;
}

.student-body #app[data-stage="info"] .main-container.questionnaire-stage,
.student-body #app[data-stage="questionnaire"] .main-container.questionnaire-stage {
  height: 100%;
  max-height: 100%;
  min-height: 0;
  overflow: hidden;
}

.student-body .report-stage,
.student-body .report-page {
  max-width: 960px;
}

.student-body .chat-content-area {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-height: 0;
  overflow: visible;
  padding-bottom: 80px;
}

.student-body #app[data-stage="info"] .chat-content-area,
.student-body #app[data-stage="questionnaire"] .chat-content-area {
  min-height: 0;
  overflow: hidden;
  padding-bottom: 0;
}

.student-body #app[data-stage="ai_chat"] .main-container.ai-stage,
.student-body #app[data-stage="voice_retest"] .main-container.ai-stage,
.student-body #app[data-stage="ai_chat"] .chat-content-area.ai-chat-content,
.student-body #app[data-stage="voice_retest"] .chat-content-area.ai-chat-content {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  height: 100%;
  max-height: 100%;
  min-height: 0;
  overflow: hidden;
}

.student-body #app[data-stage="ai_chat"] .chat-content-area.ai-chat-content,
.student-body #app[data-stage="voice_retest"] .chat-content-area.ai-chat-content {
  padding-bottom: 0;
}

.student-body .chat-scroll-area {
  flex: 1;
  overflow-y: auto;
  padding-bottom: 40px;
}

.student-body #app[data-stage="info"] .conversation-shell,
.student-body #app[data-stage="questionnaire"] .conversation-shell {
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

.student-body #app[data-stage="info"] .chat-log,
.student-body #app[data-stage="questionnaire"] .chat-log {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding-bottom: clamp(80px, 14svh, 132px);
  scroll-behavior: auto !important;
  scrollbar-color: rgba(142, 166, 169, 0.34) rgba(255, 255, 255, 0.12);
  scrollbar-width: thin;
}

.student-body #app[data-stage="info"] .chat-log::-webkit-scrollbar,
.student-body #app[data-stage="questionnaire"] .chat-log::-webkit-scrollbar {
  width: 8px;
}

.student-body #app[data-stage="info"] .chat-log::-webkit-scrollbar-track,
.student-body #app[data-stage="questionnaire"] .chat-log::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.12);
}

.student-body #app[data-stage="info"] .chat-log::-webkit-scrollbar-thumb,
.student-body #app[data-stage="questionnaire"] .chat-log::-webkit-scrollbar-thumb {
  background: rgba(142, 166, 169, 0.34);
  border: 2px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
}

.student-body #app[data-stage="info"] .chat-log::-webkit-scrollbar-thumb:hover,
.student-body #app[data-stage="questionnaire"] .chat-log::-webkit-scrollbar-thumb:hover {
  background: rgba(112, 139, 143, 0.48);
}

.student-body .question-footer {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  flex: 0 0 auto;
  margin-top: auto;
  padding: clamp(10px, 1.8svh, 18px) 0 0;
}

.student-body .question-footer-links,
.student-body .ai-bottom-actions,
.student-body .ai-feedback-actions {
  display: flex;
  gap: 16px;
  align-items: center;
  justify-content: flex-end;
}

.student-body .ai-bottom-actions {
  justify-content: center;
  margin-top: 6px;
}

.student-body .ai-feedback-actions {
  justify-content: center;
  margin-top: 14px;
}

.student-body .question-edit-link {
  border: 0;
  padding: 0;
  color: #8aa0a0;
  background: none;
  font-size: 13px;
}

.student-body .eyebrow,
.student-body .meta-line,
.student-body .progress-meta {
  color: #5f7476;
}

.student-body .lead,
.student-body .muted,
.student-body .save-note {
  color: #5f7476;
}

.student-body h1 {
  color: #1f3437;
}

.student-body .lead {
  max-width: 640px;
  font-size: 16px;
  line-height: 1.75;
}

.student-body .login-title {
  text-align: center;
}

.student-body .login-lead {
  max-width: 720px;
  margin-right: auto;
  margin-left: auto;
  color: #5f7476;
  text-align: center;
}

.student-body a {
  color: #4f9f91;
}

.student-body button {
  border-color: #8acdbd;
  color: #163d38;
  background: #a8dfcf;
  box-shadow: none;
}

.student-body button:hover:not(:disabled) {
  border-color: #76c1af;
  color: #123632;
  background: #94d5c4;
}

.student-body button.secondary {
  border-color: #dbeae6;
  color: #4f6968;
  background: rgba(255, 255, 255, 0.5);
}

.student-body button.secondary:hover:not(:disabled) {
  border-color: #bfdad3;
  color: #2f5f58;
  background: #f7fbf9;
}

.student-body button:disabled {
  border-color: #dcebe8;
  color: #9aafad;
  background: #f3f8f7;
}

.student-body .progress-bar {
  background: #e7f3f1;
}

.student-body .progress-bar span {
  background: #8acdbd;
}

.student-body .chat-avatar,
.student-body .assistant-avatar {
  color: #5bae9e;
  background: #eaf7f4;
}

.student-body .chat-avatar.ghost-avatar {
  color: transparent;
  border-color: transparent;
  background: transparent;
}

.student-body .ai-bubble {
  border-color: #d7ece8;
  color: #1f3437;
  background: #ffffff;
}

.student-body .ai-thinking-bubble {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  color: #5f7476;
  background: #f6fbfa;
}

.student-body .typing-dots {
  display: inline-flex;
  gap: 4px;
  align-items: center;
}

.student-body .typing-dots i {
  width: 5px;
  height: 5px;
  border-radius: 999px;
  background: #8fcfc3;
  animation: typing-dot-pulse 1.2s ease-in-out infinite;
}

.student-body .typing-dots i:nth-child(2) {
  animation-delay: 0.16s;
}

.student-body .typing-dots i:nth-child(3) {
  animation-delay: 0.32s;
}

@keyframes typing-dot-pulse {
  0%,
  80%,
  100% {
    opacity: 0.35;
    transform: translateY(0);
  }

  40% {
    opacity: 1;
    transform: translateY(-2px);
  }
}

.student-body .module-intro-bubble .ai-bubble,
.student-body .support-note-bubble .ai-bubble {
  border-color: #d7ece8;
  background: #f2f8f7;
}

.student-body .student-bubble {
  color: #173b3a;
  background: #ddf3ed;
}

.student-body .current-question .ai-bubble {
  border-color: #bfe3dc;
}

.student-body .quick-reply-panel .option-grid,
.student-body .quick-reply-panel .ai-option-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.student-body .welcome-stage .chat-content-area {
  flex: 0 1 auto;
  padding-bottom: 0;
}

.student-body .welcome-stage {
  min-height: min(510px, calc(100vh - 190px));
  display: flex;
  flex-direction: column;
}

.student-body .welcome-stage .chat-log {
  padding-bottom: 8px;
}

.student-body .welcome-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  grid-template-rows: auto auto;
  align-items: center;
  column-gap: 18px;
  row-gap: 24px;
  width: 100%;
  margin-top: auto;
  padding-top: clamp(26px, 5vh, 44px);
  padding-bottom: 10px;
}

.student-body .welcome-actions .welcome-later {
  grid-column: 1;
  grid-row: 2;
  justify-self: start;
}

.student-body .welcome-actions .welcome-start {
  grid-column: 2;
  grid-row: 1;
  justify-self: center;
}

.student-body .welcome-actions .welcome-back {
  grid-column: 3;
  grid-row: 2;
  justify-self: end;
}

.student-body .welcome-actions #start-button {
  min-width: 168px;
  min-height: 44px;
  border-color: #84cdbb;
  border-radius: 999px;
  padding: 0 24px;
  color: #425653;
  background: #aee4d4;
  font-weight: 700;
  box-shadow: 0 8px 18px rgba(91, 174, 158, 0.1);
}

.student-body .welcome-actions #start-button:hover:not(:disabled) {
  border-color: #76c1af;
  color: #3b504d;
  background: #9cdbc9;
}

.student-body .welcome-actions .welcome-weak-button {
  min-width: 118px;
  min-height: 40px;
  border: 1px solid #dfece8;
  border-radius: 999px;
  padding: 0 18px;
  color: #718583;
  background: rgba(255, 255, 255, 0.42);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  box-shadow: none;
}

.student-body .welcome-actions .welcome-weak-button:hover:not(:disabled) {
  border-color: #cddfda;
  color: #56716e;
  background: rgba(255, 255, 255, 0.72);
  text-decoration: none;
}

.student-body .complete-stage .quick-reply-panel {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 32px;
  width: 100%;
  margin-top: 18px;
  margin-bottom: 40px;
  margin-left: 0;
}

.student-body .complete-stage .quick-reply-panel button {
  min-height: 42px;
  border-radius: 999px;
  padding: 0 18px;
}

.student-body .complete-stage .quick-reply-panel #finish-logout {
  order: 2;
  min-width: 188px;
  border-color: #84cdbb;
  color: #425653;
  background: #aee4d4;
  font-weight: 700;
  box-shadow: 0 8px 18px rgba(91, 174, 158, 0.1);
}

.student-body .complete-stage .quick-reply-panel #finish-logout:hover:not(:disabled) {
  border-color: #76c1af;
  color: #3b504d;
  background: #9cdbc9;
}

.student-body .complete-stage .quick-reply-panel button.secondary {
  order: 1;
  min-width: 138px;
  border-color: #dfece8;
  color: #718583;
  background: rgba(255, 255, 255, 0.42);
  font-weight: 600;
  box-shadow: none;
}

.student-body .complete-stage .quick-reply-panel button.secondary:hover:not(:disabled) {
  border-color: #cddfda;
  color: #56716e;
  background: rgba(255, 255, 255, 0.72);
}

.student-body .chat-log {
  overflow: visible;
  padding-bottom: 22vh;
}

.student-body #login-form {
  gap: 18px;
  width: 100%;
  max-width: 680px;
  margin: 36px auto 0;
}

.student-body #login-form label {
  color: #1f3437;
  font-weight: 600;
}

.student-body #login-form input:not([type="checkbox"]) {
  min-height: 50px;
  border-color: #d7ece8;
  border-radius: 12px;
  padding: 0 14px;
  color: #1f3437;
  background: #ffffff;
}

.student-body #login-form input:not([type="checkbox"])::placeholder {
  color: #8aa0a0;
}

.student-body #login-form input:not([type="checkbox"]):focus {
  border-color: #5bae9e;
  outline: none;
  box-shadow: 0 0 0 3px rgba(91, 174, 158, 0.16);
  background: #ffffff;
}

.student-body #login-form input:-webkit-autofill,
.student-body #login-form input:-webkit-autofill:hover,
.student-body #login-form input:-webkit-autofill:focus {
  -webkit-box-shadow: 0 0 0 1000px #ffffff inset;
  -webkit-text-fill-color: #1f3437;
  caret-color: #1f3437;
}

.student-body #login-form button[type="submit"] {
  min-height: 52px;
  border-radius: 12px;
  box-shadow: 0 8px 18px rgba(91, 174, 158, 0.1);
}

.login-consent-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: -4px;
  color: #5f7476;
  font-size: 14px;
  font-weight: 600;
}

.login-consent-row input {
  width: 16px;
  height: 16px;
  accent-color: #5bae9e;
}

.login-consent-row a {
  margin-left: 2px;
  color: #3d8f82;
  text-decoration: none;
}

.login-consent-row a:hover {
  text-decoration: underline;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(31, 52, 55, 0.28);
}

.modal-backdrop[hidden] {
  display: none;
}

.modal-panel {
  width: min(620px, 100%);
  max-height: calc(100vh - 40px);
  overflow-y: auto;
  border: 1px solid #d7ece8;
  border-radius: 12px;
  padding: 24px;
  background: #ffffff;
  box-shadow: 0 20px 60px rgba(31, 52, 55, 0.18);
}

.modal-panel h2 {
  margin: 0 0 14px;
  color: #1f3437;
}

.student-body .modal-panel h2 {
  margin: 0 0 32px;
  color: #2f4a4d;
  font-size: 24px;
  font-weight: 600;
  text-align: center;
}

.student-body .chat-input-form {
  margin-top: 28px;
  margin-bottom: 44px;
  border-top: 1px solid #e6f2ef;
  padding-top: 24px;
}

.student-body .p06-continuation-form {
  margin-top: 10px;
  border-top: 0;
  padding-top: 0;
}

.student-body .ai-chat-status {
  width: min(100%, 768px);
  flex: 0 0 auto;
  margin: 0 auto 18px;
  color: #6f8386;
  font-size: 14px;
  font-weight: 700;
}

.student-body .voice-retest-nav {
  width: min(100%, 768px);
  flex: 0 0 auto;
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) 44px;
  align-items: center;
  gap: 8px;
  margin: 0 auto 18px;
}

.student-body .voice-retest-nav .ai-chat-status {
  width: auto;
  margin: 0;
  text-align: center;
}

.student-body .voice-retest-back-button {
  width: 40px;
  height: 40px;
  border: 1px solid #d4e6e8;
  border-radius: 999px;
  color: #4f6f73;
  background: #ffffff;
  font-size: 24px;
  line-height: 1;
  font-weight: 700;
}

.student-body .voice-retest-back-button:hover:not(:disabled) {
  border-color: #9fcacf;
  background: #f2fbfc;
}

.student-body .voice-retest-nav-spacer {
  width: 40px;
  height: 40px;
}

.student-body .ai-chat-shell {
  padding-bottom: 150px;
}

.student-body #app[data-stage="ai_chat"] .ai-chat-shell,
.student-body #app[data-stage="voice_retest"] .voice-retest-shell {
  flex: 1 1 auto;
  width: 100%;
  max-width: 100%;
  min-height: 0;
  min-width: 0;
  max-height: 100%;
  overflow: hidden;
  padding-bottom: 0;
}

.student-body #app[data-stage="ai_chat"] .ai-chat-shell .chat-log,
.student-body #app[data-stage="voice_retest"] .voice-retest-shell .chat-log {
  flex: 1 1 auto;
  min-height: 0;
  min-width: 0;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  padding-bottom: var(--student-ai-bottom-bar-space);
  scroll-behavior: auto !important;
  scroll-padding-bottom: var(--student-ai-bottom-bar-space);
}

.student-body #app[data-stage="ai_chat"] .messages-end-anchor,
.student-body #app[data-stage="voice_retest"] .messages-end-anchor {
  flex: 0 0 28px;
  width: 100%;
  height: 28px;
}

.student-body .chat-bottom-bar {
  position: absolute;
  bottom: 0;
  left: 50%;
  z-index: 9999;
  display: grid;
  gap: 6px;
  width: min(100%, 860px);
  max-width: 860px;
  min-width: 0;
  margin: 0;
  transform: translateX(-50%);
  border-top: 1px solid #e4f1ee;
  padding: 12px 20px calc(16px + env(safe-area-inset-bottom));
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 -4px 12px rgba(31, 52, 55, 0.05);
  backdrop-filter: blur(8px);
}

.student-body .voice-retest-bottom-bar {
  gap: 10px;
  padding-top: 12px;
}

.student-body .voice-mic-button {
  --voice-level: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 52px;
  width: 100%;
  border-radius: 999px;
  padding: 0 20px;
  border-color: #86bfe6;
  color: #335f7e;
  background: #d6f0ff;
  font-weight: 700;
}

.student-body .voice-mic-button.is-recording {
  border-color: #e59191;
  color: #7a2e2e;
  background: #ffd8d8;
}

.student-body .voice-waveform {
  display: inline-grid;
  grid-template-columns: repeat(5, 3px);
  align-items: center;
  gap: 3px;
  width: 27px;
  height: 18px;
}

.student-body .voice-waveform i {
  display: block;
  width: 3px;
  min-height: 4px;
  border-radius: 999px;
  background: currentColor;
  opacity: calc(0.45 + var(--voice-level) * 0.45);
  transform: scaleY(calc(0.45 + var(--voice-level) * 1.35));
  transform-origin: center;
  animation: voice-wave-pulse 820ms ease-in-out infinite;
}

.student-body .voice-waveform i:nth-child(2) {
  animation-delay: 90ms;
}

.student-body .voice-waveform i:nth-child(3) {
  animation-delay: 180ms;
}

.student-body .voice-waveform i:nth-child(4) {
  animation-delay: 270ms;
}

.student-body .voice-waveform i:nth-child(5) {
  animation-delay: 360ms;
}

@keyframes voice-wave-pulse {
  0%,
  100% {
    height: calc(5px + var(--voice-level) * 6px);
  }
  50% {
    height: calc(9px + var(--voice-level) * 13px);
  }
}

.student-body .voice-mic-icon {
  position: relative;
  display: inline-block;
  width: 14px;
  height: 20px;
  border-radius: 8px;
  background: currentColor;
}

.student-body .voice-mic-icon::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -7px;
  width: 10px;
  height: 7px;
  border: 2px solid currentColor;
  border-top: 0;
  border-radius: 0 0 10px 10px;
  transform: translateX(-50%);
}

.student-body .voice-hint-row {
  display: flex;
  flex-wrap: wrap;
  align-content: flex-start;
  gap: 8px;
  margin-top: 12px;
  min-height: 72px;
  overflow: hidden;
  overflow-anchor: none;
}

.student-body .voice-hint-chip {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  border: 1px solid #d7e8ff;
  border-radius: 999px;
  padding: 0 12px;
  color: #5b6f83;
  background: #f6fbff;
  pointer-events: none;
  cursor: default;
  user-select: none;
  max-width: 100%;
  overflow-wrap: anywhere;
}

.voice-retest-body {
  width: 100%;
  max-width: 100vw;
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0;
  overflow-x: hidden;
  background: #f5f7f6;
  color: #243739;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.voice-retest-body *,
.voice-retest-body *::before,
.voice-retest-body *::after {
  box-sizing: border-box;
}

.voice-retest-body .voice-retest-app {
  width: 100%;
  max-width: 100vw;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  justify-content: center;
  padding: clamp(12px, 3vw, 28px);
  box-sizing: border-box;
}

.voice-retest-body .voice-retest-shell {
  width: min(100%, 860px);
  max-width: 100vw;
  min-width: 0;
  height: calc(100vh - clamp(24px, 6vw, 56px));
  height: calc(100dvh - clamp(24px, 6vw, 56px));
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  border: 1px solid #dce8e5;
  border-radius: 8px;
  background: #ffffff;
  overflow: hidden;
  box-shadow: 0 12px 32px rgba(28, 49, 52, 0.08);
}

.voice-retest-body .voice-retest-header {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px clamp(18px, 4vw, 28px);
  border-bottom: 1px solid #e5efec;
}

.voice-retest-body .voice-retest-header h1 {
  margin: 2px 0 0;
  font-size: 22px;
  line-height: 1.2;
  letter-spacing: 0;
}

.voice-retest-body .voice-retest-header > div {
  min-width: 0;
}

.voice-retest-body .voice-retest-kicker,
.voice-retest-body .voice-retest-status,
.voice-retest-body .voice-retest-hint {
  margin: 0;
  color: #667c7f;
  font-size: 13px;
  line-height: 1.5;
}

.voice-retest-body .voice-retest-status {
  flex: 0 0 auto;
  max-width: 44vw;
  border: 1px solid #d6e5e1;
  border-radius: 999px;
  padding: 5px 10px;
  background: #f7fbfa;
  color: #416568;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.voice-retest-body .voice-retest-chat {
  min-height: 0;
  min-width: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 22px clamp(16px, 4vw, 32px) 28px;
  background: linear-gradient(180deg, #fbfdfc 0%, #ffffff 100%);
}

.voice-retest-body .voice-retest-module-card,
.student-body .voice-retest-module-card,
.voice-retest-body .voice-retest-reading-block,
.student-body .voice-retest-reading-block {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 16px;
  border: 1px solid #dce8e5;
  border-radius: 8px;
  padding: 12px 14px;
  background: #f8fbfa;
}

.voice-retest-body .voice-retest-module-card h2,
.student-body .voice-retest-module-card h2 {
  margin: 2px 0 0;
  font-size: 16px;
  line-height: 1.35;
  letter-spacing: 0;
}

.voice-retest-body .voice-retest-module-card span,
.voice-retest-body .voice-retest-module-kicker,
.student-body .voice-retest-module-card span,
.student-body .voice-retest-module-kicker {
  margin: 0;
  color: #647b7d;
  font-size: 13px;
  line-height: 1.4;
}

.voice-retest-body .voice-retest-module-prompt,
.student-body .voice-retest-module-prompt {
  margin: 0;
  color: #26393b;
  font-size: 15px;
  line-height: 1.75;
  letter-spacing: 0;
  white-space: pre-wrap;
}

.voice-retest-body .voice-retest-message {
  max-width: min(78%, 620px);
  margin: 0 0 12px;
  overflow-wrap: anywhere;
}

.voice-retest-body .voice-retest-message p {
  margin: 0;
  border-radius: 8px;
  padding: 12px 14px;
  font-size: 15px;
  line-height: 1.7;
}

.voice-retest-body .voice-retest-message.assistant p {
  border: 1px solid #e2ece9;
  background: #ffffff;
}

.voice-retest-body .voice-retest-message.student {
  margin-left: auto;
}

.voice-retest-body .voice-retest-message.student p {
  background: #dff1ee;
  color: #243f42;
}

.voice-retest-body .voice-retest-message.is-loading p::after {
  content: "";
  display: inline-block;
  width: 1.4em;
  animation: voice-retest-dots 1.2s steps(4, end) infinite;
}

@keyframes voice-retest-dots {
  0% { content: ""; }
  25% { content: "."; }
  50% { content: ".."; }
  75%, 100% { content: "..."; }
}

.voice-retest-body .voice-hint-row {
  display: flex;
  flex-wrap: wrap;
  align-content: flex-start;
  gap: 8px;
  margin-top: 14px;
  min-height: 72px;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  overflow-anchor: none;
}

.voice-retest-body .voice-hint-chip {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  border: 1px solid #d7e5e2;
  border-radius: 999px;
  padding: 0 12px;
  color: #5b7072;
  background: #f8fbfa;
  font-size: 13px;
  pointer-events: none;
  user-select: none;
  max-width: 100%;
  overflow-wrap: anywhere;
}

.voice-retest-body .voice-retest-controls {
  min-width: 0;
  display: grid;
  gap: 10px;
  border-top: 1px solid #e5efec;
  padding: 14px clamp(16px, 4vw, 28px) calc(16px + env(safe-area-inset-bottom));
  background: rgba(255, 255, 255, 0.96);
}

.voice-retest-body .voice-retest-record {
  --voice-level: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 52px;
  width: 100%;
  border: 1px solid #78b7bd;
  border-radius: 999px;
  padding: 0 20px;
  background: #d9f1ef;
  color: #285d62;
  font-weight: 800;
  white-space: nowrap;
}

.voice-retest-body .voice-retest-record.is-recording {
  border-color: #d98c8c;
  background: #ffe0de;
  color: #7c3232;
}

.voice-retest-body .voice-retest-record:disabled {
  opacity: 0.6;
}

.voice-retest-body .voice-mic-icon {
  position: relative;
  display: inline-block;
  width: 14px;
  height: 20px;
  border-radius: 8px;
  background: currentColor;
}

.voice-retest-body .voice-mic-icon::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -7px;
  width: 10px;
  height: 7px;
  border: 2px solid currentColor;
  border-top: 0;
  border-radius: 0 0 10px 10px;
  transform: translateX(-50%);
}

.voice-retest-body .voice-waveform {
  display: inline-grid;
  grid-template-columns: repeat(5, 3px);
  align-items: center;
  gap: 3px;
  width: 27px;
  height: 18px;
}

.voice-retest-body .voice-waveform i {
  display: block;
  width: 3px;
  min-height: 4px;
  border-radius: 999px;
  background: currentColor;
  opacity: calc(0.45 + var(--voice-level) * 0.45);
  transform: scaleY(calc(0.45 + var(--voice-level) * 1.35));
  transform-origin: center;
  animation: voice-wave-pulse 820ms ease-in-out infinite;
}

.voice-retest-body .voice-waveform i:nth-child(2) { animation-delay: 90ms; }
.voice-retest-body .voice-waveform i:nth-child(3) { animation-delay: 180ms; }
.voice-retest-body .voice-waveform i:nth-child(4) { animation-delay: 270ms; }
.voice-retest-body .voice-waveform i:nth-child(5) { animation-delay: 360ms; }

.voice-retest-body .voice-retest-text-fallback {
  border: 1px solid #e3eeeb;
  border-radius: 8px;
  padding: 10px 12px;
  background: #fbfdfc;
}

.voice-retest-body .voice-retest-text-fallback summary {
  color: #526b6e;
  cursor: pointer;
  font-size: 14px;
  font-weight: 700;
}

.voice-retest-body .voice-retest-text-fallback form {
  display: grid;
  gap: 10px;
  margin-top: 10px;
}

.voice-retest-body .voice-retest-text-fallback textarea {
  width: 100%;
  box-sizing: border-box;
  resize: vertical;
  border: 1px solid #d6e5e1;
  border-radius: 8px;
  padding: 10px 12px;
  font: inherit;
  line-height: 1.5;
}

.voice-retest-body .voice-retest-error {
  margin: 0;
  color: #9a3b3b;
  font-size: 14px;
}

.voice-retest-body .voice-retest-loading {
  align-self: center;
  width: min(100%, 420px);
  border: 1px solid #dce8e5;
  border-radius: 8px;
  padding: 28px;
  background: #ffffff;
  text-align: center;
}

.voice-retest-body .voice-retest-login-shell {
  align-self: center;
  width: min(100%, 560px);
  border: 1px solid #dce8e5;
  border-radius: 8px;
  padding: clamp(22px, 5vw, 34px);
  background: #ffffff;
  box-shadow: 0 12px 32px rgba(28, 49, 52, 0.08);
}

.voice-retest-body #login-form {
  margin-top: 20px;
}

.voice-retest-body #login-form label {
  display: grid;
  gap: 8px;
  color: #40595c;
  font-size: 14px;
  font-weight: 700;
}

.voice-retest-body #login-form input:not([type="checkbox"]) {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid #d6e5e1;
  border-radius: 8px;
  padding: 12px 13px;
  color: #243739;
  background: #fbfdfc;
  font: inherit;
}

.voice-retest-body #login-form button[type="submit"] {
  width: 100%;
  min-height: 46px;
}

.voice-retest-body .voice-retest-loading h1 {
  margin: 0 0 10px;
  font-size: 22px;
  letter-spacing: 0;
}

.voice-retest-body .voice-retest-loading p {
  margin: 0 0 16px;
  color: #5b7072;
  line-height: 1.6;
}

.voice-retest-body .voice-retest-end {
  display: block;
  height: 1px;
}

@media (max-width: 640px) {
  html:has(.voice-retest-body) {
    width: 100%;
    max-width: 100vw;
    overflow: hidden;
  }

  .voice-retest-body {
    position: fixed;
    inset: 0;
    width: 100vw;
    max-width: 100vw;
    height: 100vh;
    height: 100svh;
    min-height: 0;
    overflow: hidden;
  }

  .voice-retest-body .voice-retest-app {
    width: 100vw;
    max-width: 100vw;
    height: 100vh;
    height: 100svh;
    min-height: 0;
    padding: 0;
    overflow: hidden;
  }

  .voice-retest-body .voice-retest-shell {
    width: 100%;
    max-width: 100vw;
    height: 100%;
    max-height: 100%;
    border-width: 0;
    border-radius: 0;
    box-shadow: none;
  }

  .voice-retest-body .voice-retest-message {
    max-width: 92%;
  }

  .voice-retest-body .voice-retest-header {
    align-items: flex-start;
    gap: 10px;
    padding: 14px 16px;
  }

  .voice-retest-body .voice-retest-status {
    max-width: 38vw;
    padding-inline: 8px;
    font-size: 12px;
  }

  .voice-retest-body .voice-retest-chat {
    padding: 16px 14px 22px;
  }

  .voice-retest-body .voice-retest-controls {
    padding: 12px 14px calc(14px + env(safe-area-inset-bottom));
  }

  .voice-retest-body .voice-retest-loading,
  .voice-retest-body .voice-retest-login-shell {
    max-height: calc(100svh - 24px);
    overflow-y: auto;
  }
}

.student-body #app[data-stage="ai_chat"] > #ai-error,
.student-body #app[data-stage="voice_retest"] > #voice-retest-error {
  position: absolute;
  left: 50%;
  bottom: calc(var(--student-ai-bottom-bar-space) + 8px);
  z-index: 10000;
  width: min(100%, 860px);
  margin: 0;
  transform: translateX(-50%);
}

.student-body .report-page {
  width: 100%;
  max-width: 960px;
  margin: 0 auto;
  padding: 28px 0 96px;
}

.student-body .report-title {
  margin-bottom: 20px;
  color: #333333;
  text-align: center;
  font-size: 30px;
  font-weight: 500;
}

.student-body .report-subtitle {
  max-width: 680px;
  margin: 0 auto 22px;
  color: #666666;
  text-align: center;
  line-height: 1.75;
}

.student-body .report-intro {
  margin: 0 auto 28px;
  border: 1px solid #d7ece8;
  border-radius: 18px;
  padding: 18px 20px;
  color: #3f5558;
  background: #f6fbfa;
  line-height: 1.75;
}

.student-body .report-generation-banner {
  display: grid;
  gap: 12px;
  margin: 0 auto 22px;
  border: 1px solid #d7ece8;
  border-radius: 18px;
  padding: 18px 20px;
  background: #f7fcfb;
  box-shadow: 0 8px 22px rgba(54, 111, 105, 0.045);
}

.student-body .report-generation-copy {
  display: grid;
  gap: 4px;
  color: #39545d;
}

.student-body .report-generation-copy strong {
  color: #244c47;
  font-size: 16px;
  font-weight: 700;
}

.student-body .report-generation-copy span,
.student-body .report-generation-hint {
  color: #5b7174;
  line-height: 1.7;
}

.student-body .report-generation-track {
  overflow: hidden;
  width: 100%;
  height: 10px;
  border-radius: 999px;
  background: #e4f0ee;
}

.student-body .report-generation-track span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #8fd8c4 0%, #5bae9e 100%);
  transition: width 0.35s ease;
}

.student-body .report-generation-steps {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.student-body .report-generation-steps span {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  border: 1px solid #d3e6e2;
  border-radius: 999px;
  padding: 0 12px;
  color: #6a8082;
  background: #ffffff;
  font-size: 13px;
  font-weight: 700;
}

.student-body .report-generation-steps span.active {
  border-color: #5bae9e;
  color: #236b62;
  background: #eaf8f6;
}

.student-body .report-generation-steps span.done {
  border-color: #bfe5df;
  color: #4f7770;
  background: #f0fbf8;
}

.student-body .report-generation-hint {
  margin: 0;
  font-size: 14px;
}

.student-body .report-overall {
  margin: 0 auto 28px;
  border: 1px solid #d7ece8;
  border-radius: 24px;
  padding: 26px 28px;
  background: #fffefd;
  box-shadow: 0 10px 26px rgba(54, 111, 105, 0.05);
}

.student-body .report-overall-heading {
  display: block;
  margin-bottom: 16px;
  color: #2f8f7b;
  font-size: 16px;
  font-weight: 600;
}

.student-body .report-overall p {
  margin: 0 0 16px;
  color: #666666;
  line-height: 1.7;
}

.student-body .report-overall p:last-child {
  margin-bottom: 0;
}

.student-body .report-topic-prompt {
  margin: 24px 0 12px !important;
  color: #4f6968 !important;
  font-size: 16px;
  line-height: 1.65 !important;
}

.student-body .report-topic-list {
  display: grid;
  gap: 12px;
  margin-top: 4px;
}

.student-body .report-topic-entry {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  border: 1px solid rgba(191, 218, 213, 0.7);
  border-radius: 16px;
  padding: 14px 16px;
  background: rgba(255, 255, 255, 0.6);
  box-shadow: 0 6px 16px rgba(54, 111, 105, 0.035);
  cursor: pointer;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease, background 0.18s ease;
}

.student-body .report-topic-entry:hover,
.student-body .report-topic-entry:focus-visible {
  border-color: rgba(147, 202, 190, 0.8);
  outline: none;
  box-shadow: 0 10px 22px rgba(54, 111, 105, 0.065);
  transform: translateY(-1px);
}

.student-body .report-topic-icon {
  width: 22px;
  height: 22px;
  justify-self: center;
  border-radius: 999px;
  background: #8fd8c4;
  box-shadow: 0 0 0 7px rgba(143, 216, 196, 0.14);
}

.student-body .report-topic-copy {
  display: grid;
  gap: 4px;
}

.student-body .report-topic-entry h3 {
  margin: 0;
  color: #333333;
  font-size: 18px;
  font-weight: 500;
  line-height: 1.35;
}

.student-body .report-topic-entry p {
  margin: 0;
  color: #666666;
  font-size: 15px;
  line-height: 1.58;
}

.student-body .report-dimension-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.student-body .report-recommended {
  display: grid;
  gap: 12px;
  margin: 24px 0 0;
}

.student-body .report-recommended h2 {
  margin: 0;
  color: #333333;
  font-size: 22px;
  font-weight: 500;
  text-align: center;
}

.student-body .report-recommended > p {
  max-width: 680px;
  margin: 0 auto;
  color: #666666;
  line-height: 1.7;
  text-align: center;
}

.student-body .report-topic-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 18px;
  margin-top: 10px;
}

.student-body .report-topic-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  border: 1px solid rgba(204, 225, 220, 0.9);
  border-radius: 18px;
  padding: 24px;
  background: #fffefd !important;
  box-shadow: 0 8px 20px rgba(54, 111, 105, 0.045);
  cursor: pointer;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.student-body .report-topic-card:hover,
.student-body .report-topic-card:focus-visible {
  border-color: rgba(147, 202, 190, 0.85);
  outline: none;
  box-shadow: 0 12px 24px rgba(54, 111, 105, 0.075);
  transform: translateY(-1px);
}

.student-body .report-topic-card h3 {
  display: flex;
  position: relative;
  justify-content: center;
  align-items: center;
  gap: 14px;
  width: 100%;
  margin: 0;
  color: #333333;
  font-size: 21px;
  font-weight: 500;
  line-height: 1.35;
}

.student-body .report-topic-title {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.student-body .report-topic-card p {
  margin: 0;
  color: #666666;
  font-size: 17px;
  line-height: 1.68;
  text-align: center;
}

.student-body .report-full-summary {
  margin: 18px 0 0;
}

.student-body .report-full-summary summary {
  cursor: pointer;
  color: #6f8386;
  font-size: 14px;
  font-weight: 700;
  text-align: center;
  list-style-position: inside;
}

.student-body .report-full-summary[open] summary {
  margin-bottom: 16px;
}

.student-body .report-dimension-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 260px;
  border: 1px solid rgba(183, 218, 212, 0.78);
  border-radius: 24px;
  padding: 20px;
  background: #ffffff;
  box-shadow: 0 12px 30px rgba(54, 111, 105, 0.055);
}

.student-body .report-dimension-card h2 {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  color: #244c47;
  font-size: 18px;
}

.student-body .report-card-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: #5bae9e;
  box-shadow: 0 0 0 5px rgba(91, 174, 158, 0.12);
  flex: 0 0 auto;
}

.student-body .report-dimension-card p {
  margin: 0;
  color: #4b5f61;
  line-height: 1.7;
}

.student-body .report-dimension-card .report-suggestion {
  color: #5f7476;
}

.student-body .report-card-arrow {
  flex: 0 0 auto;
  color: #9aa9a6;
  font-size: 26px;
  line-height: 1;
}

.student-body .report-bottom-note {
  margin: 28px 0 18px;
  color: #6b8080;
  text-align: center;
}

.student-body .report-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  align-items: center;
  width: 100%;
  margin-top: 24px;
}

.student-body .report-ai-invite {
  border-top: 1px solid #d7ece8;
  margin-top: 16px;
  padding-top: 14px;
  color: #355a58;
  font-weight: 600;
}

.student-body .report-actions #report-direct-chat,
.student-body .report-actions #report-voice-retest {
  min-width: 220px;
  min-height: 44px;
  border-color: #84cdbb;
  border-radius: 999px;
  padding: 0 22px;
  color: #4f7770;
  background: #aee4d4;
  box-shadow: 0 8px 18px rgba(91, 174, 158, 0.1);
}

.student-body .report-actions #report-direct-chat:hover:not(:disabled),
.student-body .report-actions #report-voice-retest:hover:not(:disabled) {
  border-color: #76c1af;
  color: #466c66;
  background: #9cdbc9;
}

.student-body .report-skip-button {
  min-height: 40px;
  color: #999999;
  font-size: 13px;
  font-weight: 500;
}

.student-body .report-dimension-body_energy {
  background: linear-gradient(135deg, #f2fbf8 0%, #e8f7f3 100%);
}

.student-body .report-dimension-mood_emotion {
  background: linear-gradient(135deg, #f7f6ff 0%, #eef2ff 100%);
}

.student-body .report-dimension-study_pressure {
  background: linear-gradient(135deg, #f3f9ff 0%, #e8f3fb 100%);
}

.student-body .report-dimension-family_feeling {
  background: linear-gradient(135deg, #fffaf0 0%, #fdf3d9 100%);
}

.student-body .report-dimension-class_peers {
  background: linear-gradient(135deg, #f3fcf8 0%, #e8f8ee 100%);
}

.student-body .report-dimension-social_change {
  background: linear-gradient(135deg, #fff7f3 0%, #fdeee6 100%);
}

.student-body .report-dimension-support_available {
  background: linear-gradient(135deg, #f2fbf4 0%, #e5f6ea 100%);
}

.student-body .report-dimension-phone_internet {
  background: linear-gradient(135deg, #f1fbfa 0%, #e3f4f1 100%);
}

.student-body .report-topic-card.report-dimension-body_energy {
  background: #f3fbf8 !important;
}

.student-body .report-topic-card.report-dimension-study_pressure {
  background: #f4f8fb !important;
}

.student-body .report-topic-entry.report-dimension-body_energy {
  background: #f3fbf8;
}

.student-body .report-topic-entry.report-dimension-study_pressure {
  background: #f4f8fb;
}

.student-body .loading-report {
  display: grid;
  min-height: 60vh;
  place-items: center;
}

.student-body .feedback-stage .chat-content-area {
  justify-content: flex-start;
  padding-bottom: 120px;
}

.student-body .ai-feedback-shell {
  width: 100%;
  max-width: 860px;
  margin: 0 auto;
  border: 0;
  padding: 18px 0 0;
  background: transparent;
  box-shadow: none;
}

.student-body .ai-feedback-kicker {
  margin: 0 0 16px 44px;
  color: #7b9292;
  font-size: 13px;
  font-weight: 600;
}

.student-body .ai-feedback-bubble .ai-bubble {
  max-width: min(82%, 680px);
}

.student-body .ai-feedback-options {
  display: flex;
  flex-wrap: nowrap;
  justify-content: flex-start;
  gap: 10px;
  margin: 14px 0 18px 44px;
}

.student-body .ai-feedback-option {
  flex: 0 0 auto;
  min-width: 116px;
  min-height: 38px;
  border: 1px solid #cbe7e1;
  border-radius: 999px;
  padding: 0 14px;
  color: #347b70;
  background: #f8fcfb;
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
}

.student-body .ai-feedback-option:hover:not(:disabled) {
  border-color: #9fd4ca;
  color: #28685f;
  background: #eef9f6;
}

.student-body .ai-feedback-skip {
  min-height: 36px;
  color: #6b8080;
  margin: 0 0 0 44px;
}

.student-body .ai-feedback-anchor {
  height: 1px;
}

.student-body .chat-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
  height: 52px;
  margin: 0 auto;
  border: 1px solid #d7ece8;
  border-radius: 28px;
  padding: 0 50px 0 16px;
  background: #ffffff;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.student-body .chat-input-wrapper:focus-within {
  border-color: #5bae9e;
  box-shadow: 0 0 0 3px rgba(91, 174, 158, 0.16);
}

.student-body .chat-input-label {
  flex: 1;
  min-width: 0;
  height: 100%;
}

.student-body .chat-input {
  width: 100%;
  height: 100%;
  border: 0;
  padding: 0;
  color: #1f3437;
  background: transparent;
  font-size: 16px;
  outline: none;
  box-shadow: none;
}

.student-body .chat-input:focus {
  border: 0;
  outline: none;
  box-shadow: none;
}

.student-body .chat-send-button {
  position: absolute;
  top: 50%;
  right: 10px;
  display: grid;
  place-items: center;
  width: 40px;
  height: 34px;
  min-height: 34px;
  transform: translateY(-50%);
  border-radius: 999px;
  padding: 0;
  color: #163d38;
  background: #a8dfcf;
}

.student-body .chat-send-button:hover:not(:disabled) {
  background: #94d5c4;
}

.student-body .ai-boundary-note {
  width: 100%;
  margin: 0 auto;
  color: #8aa0a0;
  font-size: 11px;
  line-height: 1.5;
  text-align: center;
}

.student-body .ai-input-hint {
  width: 100%;
  margin: 6px auto 2px;
  color: #6f8585;
  font-size: 12px;
  line-height: 1.5;
  text-align: center;
}

.student-body .modify-note {
  width: 100%;
  margin: 0;
  color: #6f8386;
  font-size: 12px;
}

.student-body .chat-input-form label {
  color: #5f7476;
  font-weight: 700;
}

.student-body .chat-input-form button {
  justify-self: start;
}

.student-body .conversation-shell + .form-stack {
  margin-top: 22px;
}

.student-body .form-stack + .actions {
  margin-top: 24px;
}

.student-body .actions {
  gap: 14px;
  margin-top: 32px;
  margin-bottom: 80px;
}

.student-body .p06-soft-actions,
.student-body .ai-soft-replies,
.student-body .safety-replies {
  margin-bottom: 88px;
}

.student-body .ai-soft-replies {
  margin-bottom: 20px;
}

.student-body .ai-end-replies {
  margin-top: 6px;
  margin-bottom: 24px;
  opacity: 0.92;
}

.student-body .delayed-ai-options {
  opacity: 0;
  pointer-events: none;
  transition: opacity 1600ms ease;
}

.student-body .delayed-ai-options.is-peeking {
  opacity: 0.16;
  pointer-events: auto;
}

.student-body .delayed-ai-options.is-hinting {
  opacity: 0.42;
  pointer-events: auto;
}

.student-body .delayed-ai-options.is-visible {
  opacity: 0.92;
  pointer-events: auto;
}

.student-body .delayed-ai-options.is-suppressed,
.student-body .safety-replies.is-suppressed {
  display: none;
}

.student-body .ai-end-button {
  min-height: 32px;
  border-color: transparent;
  padding: 4px 10px;
  color: #6f8585;
  background: transparent;
  font-size: 13px;
  font-weight: 500;
  box-shadow: none;
}

.student-body .ai-end-button:hover {
  border-color: #d7ece8;
  color: #4f9f93;
  background: #f6fbfa;
}

.student-body .info-shell .quick-reply-panel,
.student-body .questionnaire-shell .quick-reply-panel {
  margin-top: -2px;
  margin-bottom: 20px;
}

.student-body .questionnaire-shell .progressive-question-block .quick-reply-panel {
  width: min(calc(100% - 44px), 680px);
  margin-bottom: 6px;
}

.student-body .inline-replies {
  margin-left: 44px;
}

.student-body .info-action-row {
  flex-basis: 100%;
  margin-top: 2px;
}

.student-body .info-next-button {
  min-width: 96px;
}

.student-body .subtle-actions {
  display: flex;
  gap: 14px;
  align-items: center;
  justify-content: flex-start;
  margin-top: auto;
  margin-left: 44px;
  padding-top: 20px;
}

.student-body .subtle-actions.between {
  justify-content: space-between;
}

.student-body .text-link-button {
  min-height: auto;
  border: 0;
  padding: 0;
  color: #6f8386;
  background: transparent;
  box-shadow: none;
  font-size: 13px;
  font-weight: 700;
}

.student-body .back-layer-button {
  color: #7d9294;
  font-weight: 600;
}

.student-body .text-link-button:hover:not(:disabled) {
  color: #4f9f91;
  background: transparent;
  text-decoration: underline;
}

.student-body .text-link-button:disabled {
  color: #c0cecc;
  background: transparent;
}

.student-body .p06-soft-actions {
  gap: 8px;
  margin-top: 4px;
}

.student-body .p06-soft-actions > button {
  min-height: 34px;
  border-color: #d7ece8;
  color: #5f7476;
  background: #fbfefd;
  font-weight: 600;
  box-shadow: none;
}

.student-body .conversation-shell > .chat-input-form {
  margin-left: 44px;
  max-width: 560px;
}

.student-body .conversation-shell > .chat-composer-form {
  max-width: 768px;
  margin-left: auto;
}

.student-body .quick-reply-panel input {
  max-width: 340px;
  border-color: #cbe7e1;
  background: #ffffff;
}

.student-body .choice-button,
.student-body .quick-reply-panel > button {
  width: auto;
  min-height: 38px;
  border-color: #cbe7e1;
  border-radius: 999px;
  padding: 0 14px;
  color: #1f3437;
  background: #ffffff;
  text-align: left;
  box-shadow: 0 3px 10px rgba(54, 111, 105, 0.04);
}

.student-body .choice-button:hover:not(:disabled),
.student-body .quick-reply-panel > button:hover:not(:disabled) {
  border-color: #9fd4ca;
  color: #173b3a;
  background: #f2faf8;
}

.student-body .choice-button.selected {
  border-color: #9fd4ca;
  color: #173b3a;
  background: #cdede4;
}

.student-body .option-grid.has-selected:not(.ai-option-grid) .choice-button:not(.selected) {
  opacity: 0.38;
}

.student-body .progressive-question-block.answered-question .choice-button {
  border-color: #c6e3dd;
  color: #244244;
  background: #ffffff;
  opacity: 0.92;
}

.student-body .progressive-question-block.answered-question .choice-button.selected {
  border-color: #7fc9bd;
  color: #173b3a;
  background: #c8eee5;
  box-shadow: inset 0 0 0 1px rgba(91, 174, 158, 0.16);
  opacity: 1;
}

.student-body .progressive-question-block.answered-question .option-grid.has-selected:not(.ai-option-grid) .choice-button:not(.selected) {
  opacity: 0.78;
}

.student-body .message.error {
  color: #8a1f17;
  background: #fff7f5;
}

.student-body .message.warning,
.student-body .message.warning {
  border-color: #f5dfb8;
  color: #694b14;
  background: #fff7ed;
}

.student-body .notice-card {
  border-color: #e4f1ee;
  border-radius: 18px;
  padding: 28px 32px;
  color: #1f3437;
  background: #ffffff;
  line-height: 1.7;
}

.student-body .notice-card strong {
  color: #1f3437;
  font-weight: 700;
}

.student-body .modal-panel .notice-card {
  border-color: #d7ece8;
  border-radius: 20px;
  padding: 36px 40px;
  color: #3f5558;
  background: #f3faf7;
  line-height: 1.8;
}

.student-body .modal-panel .notice-card strong {
  color: #243d40;
  font-weight: 600;
}

.student-body .modal-panel .actions {
  justify-content: flex-end;
  margin-top: 32px;
}

.student-body .message.success {
  color: #1f5c3b;
  background: #edf9f4;
}

.student-body .safety-shell {
  margin-bottom: 18px;
}

.student-body .support-note-bubble .ai-bubble {
  border-color: #d7ece8;
  background: #ffffff;
}

.between {
  justify-content: space-between;
}

.progress-wrap {
  display: grid;
  gap: 7px;
  position: sticky;
  top: 0;
  z-index: 20;
  margin-bottom: 22px;
  margin-inline: 0;
  padding: 0 0 12px;
  border: 0;
  background: rgba(255, 254, 253, 0.92);
  backdrop-filter: blur(6px);
}

.progress-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  color: #6d8280;
  font-size: 13px;
  font-weight: 600;
}

.progress-bar {
  height: 3px;
  width: 100%;
  overflow: hidden;
  border-radius: 999px;
  background: #e6efec;
}

.progress-bar span {
  display: block;
  width: var(--progress-value, 100%) !important;
  height: 100%;
  border-radius: inherit;
  background: #236b62;
}

.progress-kicker,
.progress-detail,
.progress-hint {
  display: none;
}

.progress-kicker {
  display: none;
}

.progress-detail {
  color: #1f3437;
  font-size: 13px;
  line-height: 1.4;
}

.progress-hint {
  display: none;
}

.question-card {
  margin-top: 18px;
}

.question-item {
  display: grid;
  gap: 10px;
  border: 1px solid #d7e6e3;
  border-radius: 8px;
  padding: 16px;
  background: #ffffff;
}

.question-title {
  margin: 0;
  font-weight: 700;
}

.save-note {
  color: #60747a;
  font-size: 14px;
}

.admin-shell {
  width: min(1680px, calc(100% - 24px));
}

.admin-login-card {
  max-width: 640px;
  margin: 0 auto;
}

.admin-panel {
  display: grid;
  gap: 20px;
  min-height: calc(100vh - 112px);
  padding-left: 256px;
}

.admin-header,
.section-title {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
}

.admin-nav {
  position: fixed;
  top: 56px;
  left: max(12px, calc((100vw - 1680px) / 2 + 12px));
  z-index: 20;
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 220px;
  max-height: calc(100vh - 112px);
  border: 1px solid #d7e6e3;
  border-radius: 8px;
  padding: 12px;
  overflow-y: auto;
  background: #f8fcfb;
  box-shadow: 0 12px 28px rgba(54, 111, 105, 0.08);
}

.admin-nav button {
  width: 100%;
  justify-content: flex-start;
  border-color: #b9d8d2;
  color: #236b62;
  background: #ffffff;
  text-align: left;
}

.admin-nav button.active {
  color: #ffffff;
  background: #236b62;
}

.admin-content {
  display: grid;
  gap: 20px;
}

@media (max-width: 900px) {
  .admin-panel {
    min-height: auto;
    padding-left: 32px;
  }

  .admin-nav {
    position: sticky;
    top: 0;
    left: auto;
    flex-direction: row;
    flex-wrap: wrap;
    width: 100%;
    max-height: none;
  }

  .admin-nav button {
    width: auto;
  }
}

.parent-report-preview-frame {
  width: 100%;
  min-height: 78vh;
  border: 1px solid #d7e6e3;
  border-radius: 8px;
  background: #ffffff;
}

.compact {
  margin: 0;
}

.muted {
  color: #60747a;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
}

.stat-card {
  display: grid;
  gap: 8px;
  min-height: 104px;
  border: 1px solid #d7e6e3;
  border-radius: 8px;
  padding: 16px;
  background: #f8fcfb;
}

.stat-card[role="button"] {
  cursor: pointer;
}

.stat-card[role="button"]:hover {
  border-color: #236b62;
}

.stat-card span {
  color: #60747a;
  font-weight: 700;
}

.stat-card strong {
  font-size: 30px;
}

.subpanel,
.detail-card {
  border: 1px solid #d7e6e3;
  border-radius: 8px;
  padding: 18px;
  background: #ffffff;
}

.subpanel h3,
.detail-card h3,
.section-title h2 {
  margin: 0 0 12px;
}

.level-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.level-chip,
.badge,
.reserved-filter {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 30px;
  border-radius: 999px;
  padding: 0 10px;
  background: #eef8f6;
  color: #236b62;
  font-weight: 700;
}

.badge {
  min-height: 24px;
  font-size: 13px;
}

.badge-warning {
  color: #7a4e00;
  background: #fff3cf;
}

.badge-level {
  color: #20313a;
  background: #e9f0ff;
}

.filter-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  align-items: end;
}

.filter-summary {
  margin: 8px 0 4px;
  font-size: 13px;
}

.filter-summary .compact-refresh {
  min-height: 28px;
  margin-left: 10px;
  padding: 4px 10px;
  font-size: 12px;
}

.reserved-filter {
  border-radius: 6px;
  justify-content: center;
  min-height: 44px;
  color: #60747a;
  background: #f2f6f5;
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid #d7e6e3;
  border-radius: 8px;
}

.student-list-wrap {
  max-height: min(68vh, 720px);
  overflow: auto;
}

table {
  width: 100%;
  min-width: 980px;
  border-collapse: collapse;
  background: #ffffff;
}

th,
td {
  border-bottom: 1px solid #e5efed;
  padding: 12px;
  text-align: left;
  vertical-align: top;
  font-size: 14px;
}

th {
  color: #39545d;
  background: #f8fcfb;
  font-weight: 800;
}

tbody tr {
  cursor: pointer;
}

tbody tr:hover {
  background: #f8fcfb;
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 14px;
}

.compact-list {
  display: grid;
  grid-template-columns: minmax(100px, max-content) 1fr;
  gap: 8px 12px;
  margin: 0;
}

.compact-list dt {
  color: #60747a;
  font-weight: 700;
}

.compact-list dd {
  margin: 0;
}

.domain-list {
  display: grid;
  gap: 8px;
}

.domain-item {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid #e5efed;
  padding: 8px 0;
}

.plain-list {
  margin: 0;
  padding-left: 20px;
}

.compact-actions {
  margin-top: 0;
}

.compact-section-title {
  margin-bottom: 12px;
}

.student-detail-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 16px;
  border-bottom: 1px solid #d7e6e3;
}

.student-detail-tabs button {
  min-height: 40px;
  border: 1px solid transparent;
  border-bottom: 0;
  border-radius: 8px 8px 0 0;
  padding: 8px 16px;
  background: transparent;
  color: #39545d;
  font-weight: 800;
}

.student-detail-tabs button.active {
  border-color: #d7e6e3;
  background: #ffffff;
  color: #236b62;
}

.nested-subpanel {
  margin-top: 16px;
  background: #fbfefd;
}

.admin-report-summary {
  display: grid;
  gap: 14px;
}

.report-overview-text {
  margin: 14px 0 0;
  border-left: 3px solid #bfe1da;
  padding-left: 12px;
  color: #39545d;
  line-height: 1.7;
}

.admin-report-dimension-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 12px;
}

.admin-report-dimension {
  border: 1px solid #d7e6e3;
  border-radius: 10px;
  padding: 14px;
  background: #ffffff;
}

.admin-report-dimension-head {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.admin-report-dimension h5 {
  margin: 0;
  color: #20313a;
  font-size: 15px;
}

.admin-report-dimension p {
  margin: 8px 0;
  line-height: 1.65;
}

.admin-source-refs {
  margin-top: 10px;
  color: #60747a;
  font-size: 13px;
}

.admin-source-refs summary {
  cursor: pointer;
  font-weight: 700;
}

.ai-summary-list dd {
  white-space: pre-wrap;
}

.ai-turn-card-list {
  display: grid;
  gap: 14px;
}

.ai-turn-card {
  border: 1px solid #d7e6e3;
  border-radius: 8px;
  padding: 16px;
  background: #ffffff;
}

.ai-turn-card.student-turn {
  border-left: 4px solid #89b8ad;
}

.ai-turn-card.assistant-turn {
  border-left: 4px solid #236b62;
  background: #fbfefd;
}

.ai-turn-card-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.ai-turn-card-header h4 {
  margin: 0 0 4px;
}

.ai-turn-content {
  border: 1px solid #e5efed;
  border-radius: 8px;
  padding: 12px;
  background: #ffffff;
  line-height: 1.7;
}

.ai-turn-content p {
  margin: 0;
  white-space: pre-wrap;
}

.form-grid {
  display: grid;
  gap: 14px;
}

.form-grid.two-col {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.mini-form,
.review-form {
  display: grid;
  gap: 12px;
}

.compact-check {
  margin: 0;
}

.timeline {
  display: grid;
  gap: 12px;
}

.timeline-item {
  border: 1px solid #d7e6e3;
  border-radius: 8px;
  padding: 14px;
  background: #f8fcfb;
}

.timeline-item h4 {
  margin: 0 0 8px;
}

@media (max-width: 640px) {
  .student-body {
    --student-shell-padding-y: 0px;
    --student-panel-padding-y: 20px;
    --student-panel-padding-bottom: 16px;
    --student-ai-bottom-bar-space: calc(clamp(178px, 28svh, 260px) + env(safe-area-inset-bottom));
  }

  html:has(.student-body #app[data-stage="voice_retest"]),
  html:has(.student-body #app[data-stage="ai_chat"]) {
    width: 100%;
    max-width: 100vw;
    height: 100%;
    overflow: hidden;
  }

  .student-body[data-stage="voice_retest"],
  .student-body[data-stage="ai_chat"] {
    position: fixed;
    inset: 0;
    width: 100vw;
    max-width: 100vw;
    height: 100vh;
    height: 100svh;
    min-height: 0;
    overflow: hidden;
  }

  .student-body:has(#app[data-stage="voice_retest"]),
  .student-body:has(#app[data-stage="ai_chat"]) {
    position: fixed;
    inset: 0;
    width: 100vw;
    max-width: 100vw;
    height: 100vh;
    height: 100svh;
    min-height: 0;
    overflow: hidden;
  }

  .student-body[data-stage="voice_retest"] .shell,
  .student-body[data-stage="ai_chat"] .shell,
  .student-body[data-stage="voice_retest"] .app-container,
  .student-body[data-stage="ai_chat"] .app-container,
  .student-body[data-stage="voice_retest"] .panel,
  .student-body[data-stage="ai_chat"] .panel,
  .student-body[data-stage="voice_retest"] .main-card,
  .student-body[data-stage="ai_chat"] .main-card {
    width: 100vw;
    max-width: 100vw !important;
    min-height: 0;
    height: 100%;
    max-height: 100%;
    margin: 0 !important;
    border: 0;
    border-radius: 0 !important;
    padding: 0;
    overflow: hidden;
  }

  .student-body:has(#app[data-stage="voice_retest"]) .shell,
  .student-body:has(#app[data-stage="ai_chat"]) .shell,
  .student-body:has(#app[data-stage="voice_retest"]) .app-container,
  .student-body:has(#app[data-stage="ai_chat"]) .app-container,
  .student-body:has(#app[data-stage="voice_retest"]) .panel,
  .student-body:has(#app[data-stage="ai_chat"]) .panel,
  .student-body:has(#app[data-stage="voice_retest"]) .main-card,
  .student-body:has(#app[data-stage="ai_chat"]) .main-card {
    width: 100vw;
    max-width: 100vw !important;
    min-height: 0;
    height: 100%;
    max-height: 100%;
    margin: 0 !important;
    border: 0;
    border-radius: 0 !important;
    padding: 0;
    overflow: hidden;
  }

  .student-body #app[data-stage="voice_retest"],
  .student-body #app[data-stage="ai_chat"] {
    width: 100vw;
    max-width: 100vw;
    height: 100vh;
    height: 100svh;
    max-height: 100svh;
  }

  .shell {
    width: 100%;
    min-height: 100svh;
    height: auto;
    padding: 0;
  }

  .panel {
    padding: 20px;
  }

  .student-body .panel {
    min-height: 100svh;
    height: auto;
    border-radius: 0;
    padding: 20px 16px 16px;
  }

  .student-body .shell {
    min-height: 100svh;
    padding: 0;
  }

  .student-body .chat-log {
    padding-bottom: 22vh;
  }

  .student-body .welcome-stage .chat-log {
    padding-bottom: 8px;
  }

  .student-body .quick-reply-panel {
    margin-left: 0;
    margin-bottom: 28px;
  }

  .student-body .welcome-stage {
    min-height: auto;
  }

  .student-body .welcome-actions {
    grid-template-columns: 1fr;
    row-gap: 16px;
    margin-top: 28px;
    padding-top: 0;
    padding-bottom: 8px;
  }

  .student-body .welcome-actions .welcome-start {
    order: 1;
    grid-column: auto;
    grid-row: auto;
    width: min(100%, 260px);
    margin-bottom: 4px;
  }

  .student-body .welcome-actions .welcome-later {
    order: 2;
    grid-column: auto;
    grid-row: auto;
  }

  .student-body .welcome-actions .welcome-back {
    order: 3;
    grid-column: auto;
    grid-row: auto;
  }

  .student-body .welcome-actions .welcome-later,
  .student-body .welcome-actions .welcome-back {
    justify-self: center;
    width: min(100%, 220px);
  }

  .student-body .complete-stage .quick-reply-panel {
    flex-direction: column;
    gap: 18px;
    align-items: center;
    justify-content: flex-start;
    margin-top: 18px;
  }

  .student-body .complete-stage .quick-reply-panel #finish-logout {
    order: 1;
  }

  .student-body .complete-stage .quick-reply-panel button.secondary {
    order: 2;
  }

  .student-body .complete-stage .quick-reply-panel #finish-logout,
  .student-body .complete-stage .quick-reply-panel button.secondary {
    width: min(100%, 280px);
  }

  .student-body .conversation-shell > .chat-input-form {
    margin-left: 0;
  }

  .student-body .report-page {
    padding: 20px 0 80px;
  }

  .student-body .report-topic-grid {
    grid-template-columns: 1fr;
  }

  .student-body .report-topic-card {
    min-height: 0;
    padding: 22px;
  }

  .student-body .report-actions {
    flex-direction: column;
    gap: 14px;
    justify-content: flex-start;
    margin-top: 88px;
  }

  .student-body .report-actions #report-direct-chat,
  .student-body .report-actions #report-voice-retest {
    order: 1;
    width: min(100%, 300px);
  }

  .student-body .report-skip-button {
    order: 2;
    width: min(100%, 240px);
  }

  .student-body .report-dimension-grid {
    grid-template-columns: 1fr;
  }

  .student-body .report-dimension-card {
    min-height: 0;
  }

  .student-body .ai-feedback-shell {
    padding: 16px 0 0;
  }

  .student-body .ai-feedback-kicker,
  .student-body .ai-feedback-options,
  .student-body .ai-feedback-skip {
    margin-left: 0;
  }

  .student-body .ai-feedback-options {
    flex-wrap: wrap;
    gap: 10px;
  }

  .student-body .ai-feedback-option {
    flex: 1 1 160px;
  }

  h1 {
    font-size: 26px;
  }

  .assistant-row {
    grid-template-columns: 1fr;
  }

  .admin-header,
  .section-title {
    display: grid;
  }
}

@media (prefers-reduced-motion: reduce) {
  .ai-avatar.is-thinking::after,
  .ai-avatar.is-listening::after {
    animation: none;
    opacity: 0.35;
  }

  .student-body .typing-dots i {
    animation: none;
  }
}
