:root {
  font-family:
    Inter,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  color: #233834;
  background: #f5f7f5;
  font-size: 14px;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  display: flex;
}
button,
input,
textarea,
select {
  font: inherit;
}
button {
  cursor: pointer;
  background: #245e50;
  color: white;
  border: 0;
  border-radius: 8px;
  padding: 11px 16px;
}
button:hover {
  filter: brightness(0.94);
}
button:disabled {
  opacity: 0.5;
  cursor: default;
}
input,
select,
textarea {
  border: 1px solid #dbe3df;
  border-radius: 8px;
  padding: 11px;
  background: white;
  color: #233834;
  width: 100%;
}
input:focus,
textarea:focus,
select:focus {
  outline: 2px solid #84b8a5;
  outline-offset: 1px;
}
h1,
h2,
p {
  margin: 0;
}
h1 {
  font-size: 30px;
  letter-spacing: -1px;
  margin: 10px 0;
}
h2 {
  font-size: 16px;
}
p {
  line-height: 1.6;
  color: #71817a;
}
.rail {
  width: 78px;
  background: #173d34;
  min-height: 100vh;
  display: flex;
  align-items: center;
  flex-direction: column;
  color: #e1eee8;
  position: fixed;
  inset: 0 auto 0 0;
}
.logo {
  font-family: Georgia, serif;
  font-size: 34px;
  margin: 28px 0 14px;
}
.logo span {
  font-size: 17px;
  vertical-align: top;
  color: #b7d5ac;
}
.rail-label {
  font-size: 7px;
  letter-spacing: 1px;
}
.rail-icon {
  margin-top: 65px;
  font-size: 25px;
  background: #396153;
  padding: 7px 14px;
  border-radius: 10px;
}
.rail-bottom {
  margin-top: auto;
  padding: 22px;
  font-size: 12px;
  color: #a7bfb4;
}
.workspace {
  margin-left: 78px;
  padding: 36px 36px 18px;
  width: calc(100% - 78px);
}
header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
}
.eyebrow {
  font-size: 10px;
  letter-spacing: 2px;
  color: #718a7f;
}
.mode {
  text-align: right;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.mode > span {
  align-self: flex-end;
  background: #e7eee1;
  padding: 9px 15px;
  border-radius: 20px;
  color: #42623b;
  font-size: 12px;
  font-weight: 600;
}
.mode small {
  color: #839189;
}
.stats {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr 1.6fr;
  margin: 30px 0 25px;
  border: 1px solid #dfe6e0;
  border-radius: 12px;
  background: white;
}
.stats > div {
  padding: 19px 24px;
  border-right: 1px solid #e5eae6;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.stats span {
  color: #809087;
  font-size: 12px;
}
.stats strong {
  font-size: 27px;
  font-weight: 500;
}
.stats .safe {
  border: 0;
  justify-content: center;
  background: #edf2eb;
  border-radius: 0 12px 12px 0;
}
.safe b {
  font-weight: 500;
  color: #4b6e58;
}
main {
  display: grid;
  grid-template-columns: 27% 39% 34%;
  min-height: 570px;
  border: 1px solid #dde5de;
  border-radius: 14px;
  overflow: hidden;
  background: white;
}
main > section {
  min-width: 0;
}
.section-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding: 21px 20px;
  border-bottom: 1px solid #e7ece7;
  min-height: 70px;
}
.section-head h2 > span {
  display: block;
  font-size: 11px;
  font-weight: 400;
  color: #809087;
  margin-top: 5px;
}
.list {
  border-right: 1px solid #e5eae6;
  display: flex;
  flex-direction: column;
}
.list > input,
.list > select {
  width: calc(100% - 32px);
  margin: 14px 16px 0;
  font-size: 12px;
}
.list > select {
  margin-bottom: 14px;
  background: #f8faf7;
}
.subtle {
  background: transparent;
  color: #71877b;
  padding: 5px 8px;
}
.chat {
  background: white;
  color: #233834;
  border: 0;
  border-radius: 0;
  text-align: left;
  width: 100%;
  padding: 19px 20px;
  border-top: 1px solid #eef1ed;
  display: block;
}
.chat.selected {
  background: #edf3ec;
  border-left: 3px solid #57805e;
  padding-left: 17px;
}
.chat b {
  font-size: 13px;
}
.chat p {
  font-size: 12px;
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
  margin: 7px 0;
}
.chat small {
  font-size: 10px;
  color: #829186;
}
.tag,
.pill {
  display: inline-block;
  border-radius: 5px;
  padding: 4px 7px;
  background: #eef3ed;
  color: #668162;
  font-size: 10px;
}
.tag.high {
  background: #fbebdf;
  color: #b26b36;
}
.list-foot {
  margin-top: auto;
  padding: 24px 20px;
  font-size: 9px;
  letter-spacing: 1px;
  color: #8a998d;
  border-top: 1px solid #e5eae6;
}
.list-foot span {
  display: block;
  letter-spacing: 0;
  font-size: 11px;
  margin-top: 7px;
}
.conversation {
  display: flex;
  flex-direction: column;
  background: #fbfcfa;
}
.messages {
  padding: 24px 20px;
  flex: 1;
  max-height: 540px;
  overflow: auto;
}
.bubble {
  background: white;
  border: 1px solid #e0e7dd;
  border-radius: 0 12px 12px 12px;
  padding: 15px;
  margin-bottom: 16px;
  max-width: 94%;
  cursor: pointer;
}
.bubble.active {
  border-color: #85a78a;
  box-shadow: 0 0 0 2px #e7eee1;
}
.bubble.outgoing {
  margin-left: auto;
  background: #eaf1e5;
}
.bubble p {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  color: #425347;
  font-size: 13px;
}
.bubble small {
  display: block;
  font-size: 10px;
  margin-top: 10px;
  color: #92a08f;
}
.conversation-foot {
  padding: 18px;
  text-align: center;
  border-top: 1px solid #e5eae6;
  font-size: 10px;
  color: #93a08f;
}
.assistant .section-head {
  background: #f5f7f1;
}
#analysis {
  padding: 22px;
}
.analysis-label {
  font-size: 10px;
  letter-spacing: 1px;
  color: #8b9987;
  margin: 20px 0 8px;
}
.analysis-label:first-child {
  margin-top: 0;
}
.facts {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.assistant textarea {
  resize: vertical;
  min-height: 140px;
  line-height: 1.7;
  background: #fafbf8;
  margin-bottom: 12px;
}
.actions {
  display: flex;
  gap: 8px;
}
.actions button {
  font-size: 12px;
}
.integration {
  margin: 15px 22px 22px;
  border-top: 1px solid #e4e9df;
  padding-top: 22px;
}
.integration span {
  display: block;
  font-size: 9px;
  letter-spacing: 1.8px;
  color: #9ca48f;
  margin-bottom: 10px;
}
.integration b {
  font-size: 12px;
  font-weight: 500;
}
.integration p {
  font-size: 11px;
  margin-top: 8px;
}
footer {
  display: flex;
  gap: 20px;
  align-items: center;
  padding: 18px 0;
  font-size: 10px;
  color: #9ba597;
}
footer #sync {
  margin-left: auto;
}
#error {
  color: #a35a30;
  padding: 0 0 12px;
}
#error:empty {
  display: none;
}
#login {
  padding: 30px;
  background: white;
  border: 1px solid #ddd;
  border-radius: 12px;
  margin-bottom: 20px;
}
#login form {
  display: flex;
  gap: 12px;
  margin-top: 15px;
  max-width: 600px;
}
button:focus-visible {
  outline: 2px solid #779b73;
  outline-offset: 2px;
}
.empty {
  padding: 25px;
  color: #82917e;
  font-size: 13px;
}
[hidden] {
  display: none !important;
}
@media (max-width: 1100px) {
  .workspace {
    padding: 25px 18px;
  }
  main {
    grid-template-columns: 32% 68%;
  }
  .assistant {
    grid-column: 1/-1;
    border-top: 1px solid #ddd;
  }
  .stats > div {
    padding: 16px;
  }
  .stats {
    grid-template-columns: 1fr 1fr 1fr;
  }
  .stats .safe {
    display: none;
  }
}
@media (max-width: 650px) {
  .rail {
    display: none;
  }
  .workspace {
    margin: 0;
    width: 100%;
    padding: 20px 12px;
  }
  header {
    display: block;
  }
  h1 {
    font-size: 25px;
  }
  .mode {
    text-align: left;
    margin-top: 15px;
  }
  .mode > span {
    align-self: flex-start;
  }
  .stats {
    margin: 20px 0;
  }
  .stats > div {
    padding: 12px;
  }
  .stats span {
    font-size: 10px;
  }
  main {
    display: block;
  }
  .list {
    max-height: 400px;
    overflow: auto;
  }
  .messages {
    max-height: 400px;
  }
  footer {
    flex-wrap: wrap;
  }
  .section-head {
    padding: 17px;
  }
}

.knowledge {
  margin-top: 24px;
  padding: 24px;
  background: white;
  border: 1px solid #dde5de;
  border-radius: 12px;
}
.knowledge p {
  margin: 12px 0;
}
.knowledge label {
  display: block;
  margin: 15px 0 8px;
}
.knowledge textarea {
  display: block;
  margin-bottom: 12px;
  line-height: 1.65;
}
.knowledge details {
  margin-top: 24px;
}
.knowledge summary {
  cursor: pointer;
  font-weight: 600;
}
.example {
  border-top: 1px solid #ddd;
  padding: 14px 0;
}
.example p {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.actions {
  flex-wrap: wrap;
}
#knowledge-status {
  display: inline-block;
  padding: 12px;
  color: #42623b;
}

.feedback {
  margin-top: 24px;
  border-top: 1px solid #dde5de;
  padding-top: 16px;
}
.feedback h3 {
  margin-bottom: 8px;
}
.feedback p {
  margin: 10px 0;
}
.feedback button {
  margin: 4px 8px 4px 0;
}
.chat small {
  display: block;
  margin-top: 8px;
  color: #986626;
}
#student-search,
#schedule-refresh {
  margin: 12px 0;
}
#student-results button {
  display: block;
}
#schedule-result p {
  overflow-wrap: anywhere;
}

/* Persistent navigation: views stay mounted to preserve unsaved edits. */
.rail { width: 196px; padding: 0 12px; }
.workspace { margin-left: 196px; width: calc(100% - 196px); }
#navigation { width: 100%; margin-top: 42px; display: grid; gap: 8px; }
#navigation button { display: flex; gap: 10px; align-items: center; width: 100%; text-align: left; background: transparent; color: #d2e2da; line-height: 1.45; padding: 12px; }
#navigation button[aria-current="page"] { background: #396153; color: white; }
#navigation button span { font-size: 13px; }
@media (max-width: 650px) {
  body { display: block; }
  .rail { display: flex; position: static; width: 100%; min-height: 0; padding: 12px; align-items: stretch; }
  .rail .logo, .rail-label, .rail-bottom { display: none; }
  #navigation { margin: 0; grid-template-columns: repeat(3, 1fr); gap: 4px; }
  #navigation button { padding: 9px 6px; gap: 5px; }
  #navigation button span { font-size: 11px; }
  .workspace { margin: 0; width: 100%; }
}
