body {
  min-height: 100vh;
  margin: 0;
  background: linear-gradient(135deg, #2c0f54, #5e2750, #77216f);
  color: #222;
  font-family: system-ui, sans-serif;
}

.page-shell {
  min-height: calc(100vh - 150px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.top-nav {
  width: 100%;
  padding: 1rem 1.5rem;
}

.top-nav-inner {
  max-width: 1100px;
  margin: 0 auto;

  display: flex;
  justify-content: space-between;
  align-items: center;
}

.top-nav-brand {
  color: white;
  font-weight: 700;
  font-size: 1rem;
}

.landing-card {
  width: 100%;
  max-width: 760px;
  background: rgba(255, 252, 245, 0.97);
  border-radius: 1.5rem;
  padding: 2rem;
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.25);
}

.hero-title {
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 800;
  color: #2c0f54;
}

.hero-subtitle {
  color: #5e2750;
  font-size: 1.05rem;
}

.section-title {
  font-weight: 700;
  color: #2c0f54;
}

.feature-box {
  background: #f5eef8;
  border-radius: 1rem;
  padding: 1rem;
  height: 100%;
}

.code-input {
  font-size: 1.2rem;
  text-transform: uppercase;
  letter-spacing: 0.15rem;
  text-align: center;
  border-radius: 0.9rem;
}

.continue-button {
  background: #5e2750;
  border: none;
  border-radius: 0.9rem;
  font-weight: 700;
  padding: 0.8rem 1.2rem;
}

.continue-button:hover {
  background: #77216f;
}

.small-note {
  font-size: 0.9rem;
  color: #555;
}

.consent-card {
  max-width: 900px;
}

.document-content h2 {
  color: #2c0f54;
  font-weight: 800;
  margin-top: 2rem;
  margin-bottom: 1rem;
}

.document-content h3 {
  color: #5e2750;
  font-weight: 700;
  margin-top: 1.5rem;
  margin-bottom: 0.75rem;
}

.document-content p {
  line-height: 1.7;
  margin-bottom: 1rem;
}

.document-content ul {
  padding-left: 1.5rem;
  margin-bottom: 1.25rem;
}

.document-content li {
  margin-bottom: 0.5rem;
}

/* Chat CSS */
.page-shell.chat-page {
  height: calc(100vh - 80px);
  min-height: 0;
  align-items: stretch;
  justify-content: center;
  padding: 1rem;
  overflow: hidden;
}

.app-shell {
  height: calc(100vh - 80px);
  max-width: 1200px;
  width: 100%;
  display: grid;
  grid-template-columns: 42% 1fr;
  gap: 1rem;
  padding: 1rem;
  margin: 0 auto;
  min-height: 0;
}

.diagram-card,
.chat-card {
  background: rgba(255, 252, 245, 0.96);
  border-radius: 1.25rem;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.22);
  min-height: 0;
  height: 100%;
}

.diagram-card {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  overflow: hidden;
}

.diagram-placeholder {
  border: 2px dashed rgba(94, 39, 80, 0.35);
  border-radius: 1rem;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: #5e2750;
}

.chat-card {
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}

.chat-messages {
  flex: 1;
  min-height: 0;
  padding: 1rem;
  overflow-y: auto;
}

.message {
  max-width: 82%;
  padding: 0.7rem 0.9rem;
  border-radius: 1rem;
  margin-bottom: 0.75rem;
  line-height: 1.35;
}

.student-message {
  margin-left: auto;
  background: #5e2750;
  color: white;
  border-bottom-right-radius: 0.2rem;
}

.tutor-message {
  margin-right: auto;
  background: #efe7f3;
  color: #2c0f54;
  border-bottom-left-radius: 0.2rem;
}

.input-area {
  display: flex;
  flex-shrink: 0;
  gap: 0.5rem;
  padding: 0.75rem;
  border-top: 1px solid rgba(0, 0, 0, 0.08);
}

.input-area textarea {
  resize: none;
  border-radius: 0.9rem;
}

.send-button {
  border-radius: 0.9rem;
  color: #5e2750;
  font-weight: 700;
}

.talk-button {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  width: 4.25rem;
  height: 4.25rem;
  border-radius: 50%;
  border: none;
  background: #ffffff;
  color: #5e2750;
  font-size: 1.8rem;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.35);
  z-index: 10;
}

.talk-button.listening {
  background: #f6c177;
  transform: scale(1.05);
}

/* Learning check page css */

.page-shell.check-page {
  min-height: calc(100vh - 80px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.check-card {
  width: 100%;
  max-width: 760px;
  background: rgba(255, 252, 245, 0.97);
  border-radius: 1.5rem;
  padding: 2rem;
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.25);
}

.check-question {
  font-size: clamp(1.6rem, 3vw, 2.3rem);
  font-weight: 800;
  color: #2c0f54;
  margin-bottom: 1.5rem;
}

.option-list {
  display: grid;
  gap: 0.75rem;
}

.option-button {
  width: 100%;
  text-align: left;
  border: none;
  border-radius: 0.9rem;
  padding: 0.9rem 1rem;
  background: #efe7f3;
  color: #2c0f54;
  font-weight: 700;
}

.option-button:hover {
  background: #e2d3eb;
}

@media (max-width: 899px) {
  .page-shell.chat-page {
    height: calc(100vh - 80px);
    padding: 0.75rem;
    overflow: hidden;
  }

  .app-shell {
    height: 100%;
    grid-template-columns: 1fr;
    grid-template-rows: minmax(160px, 32%) minmax(0, 1fr);
    gap: 0.75rem;
    padding: 0;
  }

  .diagram-card {
    height: 100%;
    min-height: 0;
    overflow: hidden;
  }

  .chat-card {
    height: 100%;
    min-height: 0;
  }

  .chat-messages {
    min-height: 0;
    overflow-y: auto;
  }

  .message {
    max-width: 92%;
  }

  .input-area {
    flex-shrink: 0;
  }

  .talk-button {
    width: 3.75rem;
    height: 3.75rem;
    font-size: 1.5rem;
    right: 0.75rem;
    bottom: 0.75rem;
  }
}
