@import url("https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=Manrope:wght@500;600;700;800&display=swap");
:root {
  --green: #16a34a;
  --green-dark: #15803d;
  --green-soft: #f0fdf4;
  --sidebar-green: #07523b;
  --sidebar-green-deep: #06432f;
  --violet: #7c3aed;
  --violet-soft: #f5f3ff;
  --ink: #111827;
  --muted: #667085;
  --line: #e5e7eb;
  --paper: #fff;
  --canvas: #f3f7f5;
  --danger: #b42318;
  --font-body: "DM Sans", sans-serif;
  --font-display: "Manrope", sans-serif;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  overflow: hidden;
  background:
    radial-gradient(ellipse at 8% 4%, #e6f5eb 0, transparent 34rem),
    radial-gradient(ellipse at 92% 92%, #f0edff 0, transparent 30rem),
    var(--canvas);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.6;
}
button,
textarea {
  font: inherit;
}
button {
  cursor: pointer;
}
a {
  color: inherit;
}
.brand {
  display: flex;
  gap: 12px;
  align-items: center;
  text-decoration: none;
}
.brand-mark {
  width: 42px;
  height: 42px;
  border-radius: 0;
  display: block;
  object-fit: cover;
  border: 1px solid rgb(16 24 40 / 12%);
  box-shadow: 0 3px 8px rgb(16 24 40 / 10%);
}
.brand strong {
  font: 800 18px var(--font-display);
  letter-spacing: 0;
}
.brand small {
  display: block;
  color: var(--muted);
  font-size: 14px;
}
.service {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #344054;
  padding: 6px 10px;
  border: 1px solid #dcefe2;
  border-radius: 20px;
  background: var(--green-soft);
  font-size: 13px;
  font-weight: 700;
}
.service i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green);
}
.service.is-offline i {
  background: #dc6803;
}
.button {
  min-height: 40px;
  border: 1px solid transparent;
  border-radius: 7px;
  padding: 8px 14px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  transition:
    background 0.15s ease,
    border-color 0.15s ease;
}
.button:focus-visible,
.topic-button:focus-visible,
.suggestions button:focus-visible,
textarea:focus-visible {
  outline: 3px solid #c4b5fd;
  outline-offset: 2px;
}
.button-outline {
  background: #fff;
  border-color: #d0d5dd;
  color: #344054;
}
.button-outline:hover {
  background: #f9fafb;
}
.button-primary {
  background: var(--green);
  color: #fff;
}
.button-primary:hover {
  background: var(--green-dark);
}
.button-primary:disabled {
  opacity: 0.58;
  cursor: wait;
}
.app-shell {
  width: 100%;
  height: 100vh;
  height: 100dvh;
  min-height: 0;
  margin: 0;
  padding: 16px 20px;
  display: grid;
  grid-template-columns: minmax(290px, 23vw) minmax(0, 1fr);
  gap: 16px;
}
.side-panel,
.chat-panel {
  background: var(--paper);
  border: 1px solid rgb(229 231 235 / 82%);
  border-radius: 16px;
  box-shadow: 0 12px 34px rgb(16 24 40 / 6%), 0 2px 7px rgb(16 24 40 / 3%);
}
.chat-panel {
  box-shadow: 0 16px 38px rgb(16 24 40 / 12%), 0 4px 12px rgb(16 24 40 / 7%), inset 0 1px 0 #fff;
}
.side-panel {
  padding: 19px 17px 16px;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  background: linear-gradient(155deg, var(--sidebar-green), var(--sidebar-green-deep));
  border-color: #06432f;
  color: #f1f8f3;
  box-shadow: 0 12px 34px rgb(6 67 47 / 18%), 0 2px 7px rgb(16 24 40 / 7%);
}
.side-panel .brand {
  gap: 11px;
  margin: 3px 5px 28px;
  color: #fff;
}
.side-panel .brand-mark {
  flex: 0 0 42px;
  background: rgb(255 255 255 / 12%);
  color: #d1fae5;
  border-color: rgb(255 255 255 / 24%);
}
.side-panel .brand strong {
  display: block;
  color: #fff;
  font-size: 16px;
}
.side-panel .brand small {
  color: #c6ded0;
  font-size: 11px;
  line-height: 1.4;
}
.new-chat-button {
  width: 100%;
  min-height: 50px;
  margin-bottom: 27px;
  padding: 9px 12px;
  border: 1px solid rgb(255 255 255 / 36%);
  border-radius: 10px;
  background: rgb(255 255 255 / 9%);
  color: #fff;
  display: flex;
  align-items: center;
  gap: 10px;
  text-align: left;
  font-size: 16px;
  font-weight: 700;
  box-shadow: 0 3px 10px rgb(0 0 0 / 10%);
  transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}
.new-chat-button:hover {
  border-color: rgb(255 255 255 / 65%);
  background: rgb(255 255 255 / 16%);
  box-shadow: 0 5px 14px rgb(0 0 0 / 14%);
}
.new-chat-button span {
  width: 26px;
  height: 26px;
  border-radius: 7px;
  background: #d1fae5;
  color: var(--green-dark);
  display: grid;
  place-items: center;
  font-size: 20px;
  line-height: 1;
}
.new-chat-button:focus-visible {
  outline: 3px solid #bbf7d0;
  outline-offset: 2px;
}
.panel-heading {
  padding: 0 6px 14px;
}
.eyebrow {
  font-size: 12px;
  letter-spacing: 0;
  font-weight: 800;
  color: var(--violet);
  margin: 0 0 6px;
}
.panel-heading h2,
.chat-heading h1 {
  font: 700 20px var(--font-display);
  margin: 0;
}
.side-panel .eyebrow {
  color: #b8f0cc;
}
.side-panel .panel-heading h2 {
  color: #fff;
}
.topic-list {
  display: grid;
  gap: 3px;
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-color: #79a991 #07523b;
  scrollbar-width: thin;
}
.topic-list::-webkit-scrollbar {
  width: 8px;
}
.topic-list::-webkit-scrollbar-track {
  background: #07523b;
  border-radius: 0;
}
.topic-list::-webkit-scrollbar-thumb {
  background: #79a991;
  border: 0;
  border-radius: 0;
}
.topic-list::-webkit-scrollbar-thumb:hover {
  background: #a7c8b5;
}
.topic-button {
  width: 100%;
  border: 0;
  background: rgb(255 255 255 / 5%);
  text-align: left;
  min-height: 48px;
  border-radius: 8px;
  padding: 10px 9px;
  color: #edf7f0;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 15px;
  box-shadow: 0 2px 5px rgb(0 0 0 / 10%), inset 0 1px 0 rgb(255 255 255 / 8%);
  transition: background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}
.topic-button:hover {
  background: rgb(255 255 255 / 12%);
  color: #fff;
  box-shadow: 0 4px 10px rgb(0 0 0 / 16%), inset 0 1px 0 rgb(255 255 255 / 12%);
}
.topic-dot {
  flex: 0 0 7px;
  width: 7px;
  height: 7px;
  border-radius: 2px;
  background: #86efac;
}
.topic-arrow {
  margin-left: auto;
  color: #b8d8c4;
  font-size: 20px;
}
.muted {
  font-size: 15px;
  color: #d5e8dc;
}
.privacy-note {
  margin-top: 12px;
  background: rgb(255 255 255 / 9%);
  border: 1px solid rgb(255 255 255 / 15%);
  border-radius: 9px;
  padding: 14px;
  display: flex;
  gap: 9px;
  color: #e2f2e8;
  font-size: 14px;
}
.privacy-note p {
  margin: 0;
}
.student-feedback-box {
  flex: 0 0 auto;
  margin-top: 10px;
  border: 1px solid rgb(255 255 255 / 20%);
  border-radius: 9px;
  background: rgb(255 255 255 / 7%);
  color: #f1f8f3;
}
.student-feedback-box summary {
  padding: 11px 12px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 700;
}
.student-feedback-box[data-submitted="true"] summary {
  cursor: default;
  opacity: 0.65;
}
.student-feedback-box form {
  display: grid;
  gap: 8px;
  padding: 0 12px 12px;
}
.student-feedback-box label {
  font-size: 13px;
  font-weight: 700;
}
.student-feedback-box textarea {
  width: 100%;
  resize: vertical;
  min-height: 82px;
  padding: 9px;
  border: 1px solid rgb(255 255 255 / 35%);
  border-radius: 7px;
  color: #17251d;
  background: #fff;
  font: inherit;
}
.student-feedback-box small,
#student-feedback-status {
  margin: 0;
  color: #d5e8dc;
  font-size: 12px;
  line-height: 1.45;
}
.student-feedback-box .button {
  min-height: 38px;
}
.student-feedback-thank-you {
  margin: 9px 0 2px;
  padding: 10px 12px;
  border: 1px solid rgb(167 243 193 / 40%);
  border-radius: 8px;
  color: #d1fae5;
  background: rgb(255 255 255 / 8%);
  font-size: 13px;
  font-weight: 800;
}
.privacy-icon {
  color: #a7f3c1;
  font-size: 19px;
}
.admin-link {
  position: relative;
  z-index: 2;
  border-top: 1px solid rgb(255 255 255 / 20%);
  margin-top: 8px;
  padding: 15px 4px 8px;
  background: linear-gradient(180deg, rgb(6 67 47 / 92%), var(--sidebar-green-deep));
  text-decoration: none;
  color: #d5e8dc;
  font-size: 14px;
  display: flex;
  justify-content: space-between;
}
.admin-link:hover {
  color: #fff;
}
.chat-panel {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
  overflow: hidden;
}
.chat-heading {
  height: 82px;
  flex: 0 0 82px;
  padding: 0 32px;
  border-bottom: 1px solid #f0f2f1;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.chat-heading h1 {
  font-size: 22px;
}
.chat-heading-badges {
  display: flex;
  align-items: center;
  gap: 8px;
}
.ai-pill {
  display: flex;
  gap: 7px;
  align-items: center;
  padding: 6px 10px;
  border-radius: 20px;
  background: var(--violet-soft);
  color: #6333bd;
  font-size: 14px;
  font-weight: 700;
}
.conversation {
  flex: 1;
  padding: 30px clamp(22px, 3vw, 48px);
  overflow: auto;
  overscroll-behavior: contain;
  max-height: none;
  min-height: 0;
}
.welcome {
  max-width: 960px;
  margin: 24px auto;
  text-align: center;
}
.welcome h2 {
  font: 700 32px var(--font-display);
  letter-spacing: 0;
  margin: 2px 0 10px;
}
.welcome > p:not(.eyebrow) {
  max-width: 820px;
  color: #475467;
  margin: 0 auto 12px;
  font-size: 18px;
}
.welcome-notice {
  font-size: 15px;
  color: #667085 !important;
  border-top: 2px solid var(--green);
  padding: 10px 12px 0;
  width: fit-content;
  max-width: 100%;
  margin-left: auto !important;
  margin-right: auto !important;
}
.suggestions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  max-width: 820px;
  margin: 28px auto 0;
}
.suggestions button {
  min-height: 60px;
  text-align: left;
  border: 1px solid #e5e7eb;
  border-radius: 11px;
  padding: 12px 15px;
  background: #fff;
  color: #344054;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  box-shadow: 0 5px 14px rgb(16 24 40 / 8%), 0 1px 3px rgb(16 24 40 / 6%), inset 0 1px 0 #fff;
  transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}
.suggestions button:hover {
  border-color: #86efac;
  background: #fbfffc;
  box-shadow: 0 8px 18px rgb(16 24 40 / 12%), 0 2px 5px rgb(16 24 40 / 7%), inset 0 1px 0 #fff;
  transform: translateY(-1px);
}
.suggestions button span {
  color: var(--green-dark);
}
.suggestions button .announcement-notification-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-left: 8px;
  border-radius: 50%;
  background: #dc2626;
  box-shadow: 0 0 0 3px #fee2e2;
  vertical-align: middle;
}
.message {
  max-width: 960px;
  margin: 0 0 22px;
  animation: arrive 0.2s ease-out;
}
.message.student {
  width: fit-content;
  max-width: min(78%, 760px);
  margin-left: auto;
}
.message.assistant {
  max-width: min(88%, 960px);
  margin-right: auto;
}
.message-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  color: #667085;
  font-size: 14px;
  margin-bottom: 5px;
}
.message-meta time {
  margin-left: auto;
}
.message-mode {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 3px 8px;
  font-size: 11px;
  font-weight: 650;
  line-height: 1.35;
}
.message-mode.mode-general,
.message-mode.mode-unverified {
  background: #fff3db;
  color: #80530a;
}
.message-mode.mode-grounded {
  background: #e9e6fb;
  color: #5638a5;
}
.message-mode.mode-announcement {
  background: #e7f3ed;
  color: #245a40;
}
.message-badge {
  width: 23px;
  height: 23px;
  border-radius: 7px;
  background: var(--violet-soft);
  color: var(--violet);
  display: grid;
  place-items: center;
  font-weight: 800;
}
.message.student .message-badge {
  background: var(--green-soft);
  color: var(--green-dark);
}
.message.student .message-meta {
  justify-content: flex-end;
}
.message-body {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  padding: 15px 18px;
  border-radius: 4px 14px 14px 14px;
  background: var(--violet-soft);
  color: #344054;
  font-size: 17px;
  box-shadow: 0 4px 12px rgb(16 24 40 / 7%), inset 0 1px 0 rgb(255 255 255 / 85%);
}
.message.assistant .message-body {
  border-left: 2px solid var(--violet);
}
.message-body p {
  margin: 0 0 9px;
}
.message-body p:last-child {
  margin-bottom: 0;
}
.message-body h3 {
  margin: 14px 0 9px;
  color: #243447;
  font-size: 1em;
}
.message-body h3.source-title {
  margin: 18px 0 5px;
}
.message-body > h3:first-child {
  margin-top: 0;
}
.message-body ul,
.message-body ol {
  margin: 7px 0 12px;
  padding-left: 24px;
}
.message-body li + li {
  margin-top: 8px;
}
.message-body ol + p,
.message-body p + ol,
.message-body ol + ol,
.message-body ul + p,
.message-body p + ul {
  margin-top: 9px;
}
.message-body li p {
  margin: 5px 0 0;
  font-size: 0.94em;
}
.answer-link {
  color: #5d3ab2;
  text-decoration: underline;
  text-underline-offset: 2px;
  overflow-wrap: anywhere;
}
.message.student .message-body {
  background: var(--green-soft);
  border-right: 2px solid var(--green);
  border-left: 0;
  border-radius: 14px 4px 14px 14px;
}
.message.student .sources {
  justify-content: flex-end;
}
.message-followup {
  display: flex;
  flex-direction: column;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
  width: min(100%, 960px);
  margin: 0 auto 22px;
  color: #475467;
  font-size: 12px;
  text-align: center;
}
.message-followup p {
  margin: 0;
  line-height: 1.45;
}
.message-feedback-button {
  border: 0;
  border-radius: 999px;
  padding: 6px 10px;
  background: var(--violet-soft);
  color: var(--violet);
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}
.message-feedback-button:hover {
  filter: brightness(0.98);
}
.sources {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 9px;
}
.source-link,
.source-label {
  background: var(--violet-soft);
  color: #6333bd;
  border-radius: 4px;
  padding: 4px 8px;
  font-size: 14px;
  text-decoration: none;
  box-shadow: 0 2px 5px rgb(16 24 40 / 8%), inset 0 1px 0 rgb(255 255 255 / 75%);
}
.source-link:hover {
  text-decoration: underline;
}
.typing {
  color: #667085;
  font-size: 16px;
  padding: 14px 0;
}
.typing:after {
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--violet);
  margin-left: 7px;
  animation: pulse 0.85s infinite alternate;
}
.composer {
  margin: 0 auto;
  width: calc(100% - 56px);
  max-width: 1100px;
  border: 1px solid #dce3df;
  border-radius: 15px;
  padding: 11px 13px 9px;
  background: #fff;
  box-shadow: 0 8px 24px rgb(16 24 40 / 8%), 0 1px 3px rgb(16 24 40 / 4%);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.composer:focus-within {
  border-color: #86c99a;
  box-shadow: 0 0 0 3px rgb(22 163 74 / 12%), 0 8px 24px rgb(16 24 40 / 8%);
}
.composer textarea {
  display: block;
  width: 100%;
  resize: none;
  border: 0;
  outline: 0;
  padding: 4px 5px 8px;
  max-height: 140px;
  color: var(--ink);
  font-size: 18px;
}
.composer textarea:focus-visible {
  outline: none;
}
.composer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #667085;
  font-size: 14px;
}
.composer-bottom kbd {
  font: inherit;
  padding: 1px 4px;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: #f9fafb;
}
.composer-controls {
  display: flex;
  align-items: center;
  gap: 12px;
}
.send-button {
}
.char-count {
  font-variant-numeric: tabular-nums;
}
.chat-footnote {
  margin: 10px 20px 16px;
  text-align: center;
  color: #98a2b3;
  font-size: 13px;
}
.error-message {
  color: var(--danger);
  font-size: 15px;
  background: #fef3f2;
  border-radius: 10px;
  padding: 10px;
}
.quota-notice {
  color: #7a2e0e;
  font-size: 15px;
  background: #fffaeb;
  border: 1px solid #fedf89;
  border-radius: 10px;
  padding: 10px;
}
.maintenance-notice {
  margin: 18px;
  padding: 16px 18px;
  color: #7a2e0e;
  background: #fffaeb;
  border: 1px solid #fedf89;
  border-radius: 12px;
  line-height: 1.55;
}
.maintenance-notice strong {
  display: block;
  margin-bottom: 4px;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
@keyframes arrive {
  from {
    opacity: 0.3;
    transform: translateY(5px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
@keyframes pulse {
  to {
    opacity: 0.25;
    transform: scale(0.7);
  }
}
@media (max-width: 800px) {
  body {
    overflow: auto;
  }
  .app-shell {
    height: auto;
    min-height: 100vh;
    grid-template-columns: 1fr;
    padding: 14px;
    gap: 12px;
  }
  .side-panel {
    min-height: auto;
    overflow: visible;
    order: 1;
    padding: 15px;
  }
  .side-panel .brand {
    margin-bottom: 18px;
  }
  .new-chat-button {
    margin-bottom: 17px;
  }
  .topic-list {
    flex: initial;
    min-height: auto;
    overflow: visible;
  }
  .chat-panel {
    height: auto;
    order: 0;
  }
  .topic-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .privacy-note,
  .admin-link {
    display: none;
  }
  .chat-panel {
    min-height: calc(100vh - 110px);
  }
  .conversation {
    max-height: none;
    min-height: 320px;
  }
  .suggestions {
    grid-template-columns: 1fr 1fr;
  }
  .composer {
    width: calc(100% - 22px);
  }
}
@media (max-width: 480px) {
  .app-shell {
    padding: 8px;
  }
  .topic-list {
    grid-template-columns: 1fr;
  }
  .side-panel {
    padding: 12px;
  }
  .topic-button {
    min-height: 48px;
  }
  .chat-heading {
    height: auto;
    min-height: 62px;
    flex-basis: auto;
    padding: 0 16px;
    gap: 8px;
  }
  .chat-heading h1 {
    font-size: 18px;
  }
  .chat-heading-badges {
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
  }
  .chat-heading-badges .ai-pill,
  .chat-heading-badges .service {
    padding: 4px 8px;
    font-size: 12px;
    white-space: nowrap;
  }
  .conversation {
    padding: 18px 14px;
    min-height: 300px;
  }
  .welcome {
    margin: 8px auto;
  }
  .welcome h2 {
    font-size: 24px;
  }
  .suggestions {
    grid-template-columns: 1fr;
  }
  .suggestions button {
    min-height: 43px;
  }
  .composer-bottom > span:first-child {
    display: none;
  }
  .composer-controls {
    margin-left: auto;
  }
  .button {
    min-height: 38px;
  }
  .chat-footnote {
    font-size: 12px;
  }
}
