:root {
  --ink: #17212b;
  --muted: #687381;
  --line: #d8dee6;
  --panel: #ffffff;
  --soft: #f4f7f6;
  --teal: #157f82;
  --teal-dark: #0e5f62;
  --coral: #d96d4a;
  --amber: #b7791f;
  --green: #287d4f;
  --red: #b42318;
  --shadow: 0 22px 60px rgba(22, 33, 43, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: Arial, Helvetica, sans-serif;
  color: var(--ink);
  background:
    linear-gradient(120deg, rgba(21, 127, 130, 0.12), rgba(217, 109, 74, 0.08)),
    #eef3f1;
}

button,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  width: 100%;
  min-height: 100vh;
  padding: 28px;
}

.workspace {
  max-width: 1180px;
  margin: 0 auto;
}

.topbar,
.report-header,
.section-heading {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: center;
  margin-bottom: 18px;
}

.eyebrow,
.advisor-label {
  margin: 0 0 6px;
  color: var(--teal-dark);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: clamp(2rem, 4vw, 3.3rem);
}

h2 {
  margin-bottom: 10px;
}

.mode-toggle {
  display: grid;
  grid-template-columns: repeat(2, minmax(170px, 1fr));
  gap: 8px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.78);
}

.mode-button,
.primary-button,
.secondary-button,
.icon-button {
  min-height: 44px;
  border-radius: 8px;
  border: 1px solid transparent;
  padding: 10px 14px;
  font-weight: 700;
}

.mode-button {
  color: var(--muted);
  background: transparent;
}

.mode-button.active,
.primary-button {
  color: #fff;
  background: var(--teal);
}

.secondary-button,
.icon-button {
  color: var(--ink);
  border-color: var(--line);
  background: #fff;
}

.primary-button:hover,
.mode-button.active:hover {
  background: var(--teal-dark);
}

.notice {
  margin-bottom: 18px;
  padding: 14px 16px;
  border-left: 5px solid var(--coral);
  border-radius: 8px;
  background: #fff7f2;
  color: #6b3322;
  font-weight: 700;
}

.interview-layout {
  display: grid;
  grid-template-columns: 340px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.example-panel,
.ai-help-panel,
.advisor-panel,
.session-panel,
.report-panel {
  border: 1px solid rgba(216, 222, 230, 0.9);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--shadow);
}

.example-panel {
  margin-bottom: 18px;
  padding: 20px;
}

.ai-help-panel {
  margin-bottom: 18px;
  padding: 20px;
}

.section-heading h2 {
  margin-bottom: 0;
}

.video-strip {
  display: grid;
  grid-template-columns: repeat(5, minmax(180px, 1fr));
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.video-card {
  min-width: 180px;
  padding: 10px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--soft);
}

.video-card video {
  display: block;
  width: 100%;
  aspect-ratio: 9 / 16;
  max-height: 320px;
  border-radius: 8px;
  background: #111;
  object-fit: cover;
}

.video-card strong {
  display: block;
  margin-top: 10px;
}

.profile-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.profile-grid label {
  display: grid;
  gap: 8px;
  color: var(--ink);
  font-weight: 800;
}

.profile-grid input,
.profile-grid textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  color: var(--ink);
  background: #fff;
  line-height: 1.45;
}

.profile-grid label:first-child {
  grid-column: 1 / -1;
}

.guide-panel {
  margin-top: 16px;
  padding: 16px;
  border-radius: 8px;
  background: #f8fbfa;
  border: 1px solid var(--line);
}

.guide-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.guide-header h3 {
  margin-bottom: 0;
}

.guide-content {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.guide-card {
  padding: 14px;
  border-radius: 8px;
  background: #fff;
  border: 1px solid var(--line);
}

.guide-card strong {
  display: block;
  margin-bottom: 8px;
}

.guide-card p {
  color: var(--muted);
  line-height: 1.5;
}

.guide-card button {
  width: 100%;
}

.advisor-panel {
  position: sticky;
  top: 24px;
  padding: 20px;
}

.avatar-stage {
  position: relative;
  display: grid;
  place-items: center;
  aspect-ratio: 1;
  overflow: hidden;
  border-radius: 8px;
  background: linear-gradient(145deg, #dcebe8, #f7f4ef);
}

.avatar {
  width: 100%;
  height: 100%;
  object-fit: cover;
  position: relative;
  z-index: 2;
}

.speaking-ring {
  position: absolute;
  width: 78%;
  height: 78%;
  border: 3px solid rgba(21, 127, 130, 0.45);
  border-radius: 50%;
  opacity: 0;
  transform: scale(0.9);
}

.agent-live .speaking-ring {
  animation: pulse 1.5s ease-in-out infinite;
  opacity: 1;
}

@keyframes pulse {
  50% {
    transform: scale(1.04);
    opacity: 0.45;
  }
}

.advisor-copy {
  margin-top: 18px;
}

.advisor-copy p:last-child {
  color: var(--muted);
  line-height: 1.5;
}

.interview-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 18px;
}

.interview-stats div {
  padding: 12px 8px;
  border-radius: 8px;
  background: var(--soft);
  text-align: center;
}

.interview-stats span {
  display: block;
  font-size: 1.45rem;
  font-weight: 800;
}

.interview-stats small {
  color: var(--muted);
}

.session-panel {
  padding: 20px;
}

.question-card {
  padding: 18px;
  border-radius: 8px;
  background: #eef7f6;
}

.question-meta,
.tool-row,
.navigation-row,
.feedback-header,
.report-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.question-meta {
  justify-content: space-between;
  color: var(--teal-dark);
  font-size: 0.86rem;
  font-weight: 700;
  margin-bottom: 12px;
}

.question-card h2 {
  margin-bottom: 0;
  font-size: clamp(1.35rem, 3vw, 2rem);
  line-height: 1.2;
}

.answer-tools {
  margin-top: 18px;
}

.agent-status {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  padding: 12px 14px;
  border-radius: 8px;
  background: #eef7f6;
  color: var(--teal-dark);
  font-weight: 800;
}

.agent-mode .question-card {
  border: 2px solid rgba(21, 127, 130, 0.22);
  background: linear-gradient(180deg, #edf8f6, #f8fbfa);
}

.agent-mode .avatar-stage::after {
  content: "Robot IA";
  position: absolute;
  right: 12px;
  bottom: 12px;
  z-index: 3;
  padding: 6px 9px;
  border-radius: 999px;
  color: #fff;
  background: var(--teal-dark);
  font-size: 0.78rem;
  font-weight: 800;
}

.agent-mode .advisor-panel {
  border-color: rgba(21, 127, 130, 0.45);
  background:
    linear-gradient(180deg, rgba(255,255,255,0.96), rgba(245,249,248,0.96)),
    #fff;
}

.status-dot {
  width: 12px;
  height: 12px;
  flex: 0 0 12px;
  border-radius: 50%;
  background: var(--teal);
  box-shadow: 0 0 0 6px rgba(21, 127, 130, 0.12);
}

.listening-live .status-dot {
  background: var(--coral);
  animation: dotPulse 1s ease-in-out infinite;
}

.speaking-live .avatar {
  animation: consulSpeak 0.55s ease-in-out infinite alternate;
}

@keyframes consulSpeak {
  from {
    transform: translateY(0) scale(1);
  }
  to {
    transform: translateY(-3px) scale(1.015);
  }
}

@keyframes dotPulse {
  50% {
    transform: scale(1.25);
    box-shadow: 0 0 0 10px rgba(217, 109, 74, 0.16);
  }
}

.answer-tools label {
  display: block;
  margin-bottom: 8px;
  font-weight: 800;
}

textarea {
  width: 100%;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  color: var(--ink);
  background: #fff;
  line-height: 1.5;
}

textarea:focus,
button:focus-visible {
  outline: 3px solid rgba(21, 127, 130, 0.25);
  outline-offset: 2px;
}

.agent-mode textarea {
  min-height: 150px;
  background: #fbfdfc;
}

.agent-mode #clearButton {
  display: none;
}

.agent-mode #speakQuestionButton {
  flex: 2 1 260px;
  min-height: 56px;
  font-size: 1.02rem;
}

.agent-mode #finishSpeakingButton {
  flex: 2 1 240px;
  min-height: 56px;
  border-color: rgba(217, 109, 74, 0.45);
  background: #fff7f2;
  color: #6b3322;
}

.agent-mode #micButton {
  flex: 1 1 180px;
}

.agent-mode #submitButton {
  flex: 1 1 180px;
}

.tool-row {
  justify-content: flex-end;
  margin-top: 12px;
}

.icon-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.speech-support {
  min-height: 22px;
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.feedback-panel {
  margin-top: 18px;
  padding: 18px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #fff;
}

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

.feedback-header h3 {
  margin-bottom: 0;
}

.badge {
  border-radius: 999px;
  padding: 6px 10px;
  color: #fff;
  background: var(--muted);
  font-size: 0.85rem;
  font-weight: 800;
}

.badge.green {
  background: var(--green);
}

.badge.amber {
  background: var(--amber);
}

.badge.red {
  background: var(--red);
}

.feedback-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-top: 14px;
}

.feedback-grid article,
.report-card {
  padding: 14px;
  border-radius: 8px;
  background: var(--soft);
}

.wide-feedback {
  grid-column: span 2;
}

.wide-feedback button {
  margin-top: 8px;
}

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

.feedback-actions button {
  flex: 1 1 180px;
}

.feedback-grid p,
.report-card p,
.report-card li {
  color: var(--muted);
  line-height: 1.48;
}

.navigation-row {
  justify-content: space-between;
  margin-top: 18px;
}

.report-panel {
  margin-top: 18px;
  padding: 20px;
}

.report-content {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.report-card.full {
  grid-column: 1 / -1;
}

.traffic-light {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 1.4rem;
  font-weight: 900;
}

.light-dot {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--muted);
}

.light-dot.green {
  background: var(--green);
}

.light-dot.amber {
  background: var(--amber);
}

.light-dot.red {
  background: var(--red);
}

@media (max-width: 880px) {
  .app-shell {
    padding: 16px;
  }

  .topbar,
  .report-header,
  .section-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .mode-toggle,
  .interview-layout,
  .feedback-grid,
  .profile-grid,
  .guide-content,
  .report-content {
    grid-template-columns: 1fr;
  }

  .wide-feedback {
    grid-column: auto;
  }

  .video-strip {
    grid-template-columns: repeat(5, minmax(220px, 74vw));
  }

  .advisor-panel {
    position: static;
  }

  .avatar-stage {
    max-height: 320px;
  }

  .tool-row,
  .navigation-row,
  .report-actions {
    justify-content: stretch;
  }

  .tool-row button,
  .navigation-row button,
  .report-actions button,
  .section-heading button {
    flex: 1 1 150px;
  }
}

@media print {
  body {
    background: #fff;
  }

  .topbar,
  .interview-layout,
  .example-panel,
  .ai-help-panel,
  .notice,
  .report-actions {
    display: none;
  }

  .app-shell {
    padding: 0;
  }

  .report-panel {
    display: block !important;
    box-shadow: none;
    border: 0;
  }
}
