:root {
  --ink:#183b32;
  --muted:#68726d;
  --paper:#f5f5ed;
  --lime:#e0ed9f;
  --line:#dce2d8;
  --white:#fff;
  --error:#a33a2c;
  font-family:Inter,"Segoe UI",Arial,sans-serif;
  color:var(--ink);
  background:var(--paper);
  font-synthesis:none;
}
* {
  box-sizing:border-box;
}
body {
  margin:0;
}
button,input,textarea {
  font:inherit;
}
button,a,input,textarea {
  -webkit-tap-highlight-color:transparent;
}
button {
  cursor:pointer;
}
button:disabled {
  cursor:wait;
  opacity:.6;
}
a {
  color:inherit;
}
button:focus-visible,a:focus-visible,input:focus-visible,textarea:focus-visible {
  outline:3px solid #98b048;
  outline-offset:3px;
}
.hidden {
  display:none!important;
}
.site-header {
  height:100px;
  max-width:1360px;
  margin:auto;
  padding:0 5%;
  display:flex;
  align-items:center;
  justify-content:space-between;
  border-bottom:1px solid var(--line);
}
.brand {
  display:flex;
  gap:12px;
  align-items:center;
  text-decoration:none;
  font-weight:800;
  font-size:14px;
  letter-spacing:1px;
}
.brand small {
  display:block;
  font-size:9px;
  letter-spacing:1.5px;
  font-weight:500;
  margin-top:6px;
}
.header-right {
  display:flex;
  align-items:center;
  gap:24px;
}
.course-tag,.connection {
  font-size:11px;
  letter-spacing:1px;
}
.course-tag {
  color:var(--muted);
}
.connection {
  background:#e5eddc;
  padding:8px 12px;
  border-radius:24px;
}
.connection.offline {
  background:#fff0d9;
  color:#795600;
}
main {
  max-width:1360px;
  margin:auto;
  padding:0 5%;
}
.welcome {
  display:grid;
  grid-template-columns:1.25fr 1fr;
  gap:12%;
  align-items:center;
  padding:70px 0 64px;
  min-height:660px;
}
.eyebrow {
  font-size:10px;
  font-weight:700;
  letter-spacing:1.8px;
  color:var(--muted);
}
h1 {
  font-family:Georgia,"Times New Roman",serif;
  font-size:clamp(56px,5.8vw,84px);
  line-height:1.04;
  letter-spacing:-3px;
  font-weight:400;
  margin:23px 0;
}
.lead {
  font-size:17px;
  line-height:1.65;
  color:var(--muted);
  max-width:440px;
}
.topic-list {
  display:flex;
  flex-direction:column;
  margin-top:30px;
  max-width:410px;
}
.topic-list span {
  padding:12px 0;
  border-top:1px solid var(--line);
  font-size:11px;
  color:var(--muted);
}
.topic-list b {
  font-size:14px;
  color:var(--ink);
  font-weight:500;
  margin-left:24px;
}
.source-note {
  display:flex;
  align-items:center;
  gap:12px;
  margin-top:28px;
  font-size:11px;
  line-height:1.7;
  color:var(--muted);
}
.source-note strong {
  font-weight:500;
}
.source-dot {
  width:9px;
  height:9px;
  background:#65833a;
  border-radius:50%;
}
.login-card {
  background:var(--white);
  border:1px solid var(--line);
  border-radius:20px;
  padding:38px;
  box-shadow:0 12px 40px #153e3505;
}
.login-card h2 {
  font-size:30px;
  margin:14px 0;
}
.login-card>p {
  color:var(--muted);
  font-size:14px;
  line-height:1.6;
  margin-bottom:28px;
}
label:not(.toggle) {
  display:block;
  font-size:12px;
  font-weight:600;
  margin:17px 0 9px;
}
input:not([type=checkbox]),textarea {
  border:1px solid var(--line);
  border-radius:8px;
  padding:13px;
  width:100%;
  background:#fafbf7;
  color:var(--ink);
  font-size:14px;
}
input::placeholder,textarea::placeholder {
  color:#89928b;
}
.primary,.secondary {
  padding:13px 18px;
  min-height:44px;
  border-radius:8px;
  font-size:13px;
  font-weight:600;
}
.primary {
  border:1px solid var(--ink);
  background:var(--ink);
  color:white;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:24px;
}
.primary:hover {
  background:#245644;
}
.secondary {
  border:1px solid var(--line);
  color:var(--ink);
  background:white;
}
.secondary:hover {
  background:var(--paper);
}
#authForm button {
  width:100%;
  margin-top:12px;
}
#authForm .primary {
  margin-top:24px;
}
.privacy-note {
  border-top:1px solid var(--line);
  margin-top:22px;
  padding-top:18px;
  color:var(--muted);
  font-size:11px;
  line-height:1.7;
}
.error {
  color:var(--error);
  font-size:12px;
  line-height:1.6;
}
.error:empty {
  display:none;
}
footer {
  border-top:1px solid var(--line);
  padding:22px 0 28px;
  display:flex;
  justify-content:space-between;
  gap:20px;
  font-size:10px;
  color:var(--muted);
  line-height:1.6;
}
.chat-layout {
  display:grid;
  grid-template-columns:235px minmax(0,1fr);
  gap:38px;
  padding:30px 0;
}
.sidebar {
  padding:20px 0;
}
.sidebar h2 {
  font-family:Georgia,serif;
  font-size:31px;
  line-height:1.2;
  font-weight:400;
  margin:18px 0;
}
.sidebar>p,.reading-tip p {
  font-size:12px;
  line-height:1.8;
  color:var(--muted);
}
.prompt-list {
  display:flex;
  flex-direction:column;
  gap:9px;
  margin-top:25px;
}
.prompt {
  display:flex;
  justify-content:space-between;
  border:1px solid var(--line);
  border-radius:8px;
  background:white;
  padding:15px;
  text-align:left;
  font-size:12px;
  color:var(--ink);
}
.prompt:hover {
  border-color:#93a88b;
  background:#eef2e5;
}
.reading-tip {
  margin-top:35px;
  padding:19px;
  background:#e9eedf;
  border-radius:10px;
}
.text-button {
  background:none;
  border:0;
  color:var(--ink);
  font-size:12px;
  text-decoration:underline;
  text-underline-offset:4px;
  padding:9px 0;
}
.sidebar>.text-button {
  margin-top:20px;
}
.small {
  font-size:10px!important;
  color:var(--muted);
  line-height:1.6;
}
.room {
  border:1px solid var(--line);
  border-radius:16px;
  background:white;
  overflow:hidden;
  display:flex;
  flex-direction:column;
  height:calc(100dvh - 225px);
  min-height:550px;
  max-height:900px;
}
.room-header {
  padding:22px 26px;
  border-bottom:1px solid var(--line);
  display:flex;
  justify-content:space-between;
  gap:16px;
  align-items:center;
}
.room-header h2 {
  font-size:17px;
  margin:7px 0 0;
}
.account {
  display:flex;
  align-items:center;
  gap:16px;
  font-size:12px;
}
.messages {
  flex:1;
  min-height:0;
  overflow-y:auto;
  padding:24px;
  scroll-behavior:smooth;
}
.empty-state {
  margin:45px auto;
  max-width:360px;
  text-align:center;
}
.empty-state h3 {
  font-size:18px;
  font-weight:500;
  margin:22px 0 12px;
}
.empty-state p {
  font-size:12px;
  color:var(--muted);
  line-height:1.8;
}
.message {
  padding:17px 18px;
  border:1px solid var(--line);
  border-radius:12px;
  max-width:90%;
  margin-bottom:15px;
  background:#fbfcf9;
  overflow-wrap:anywhere;
}
.message.mine {
  margin-left:auto;
  background:#edf3e2;
  border-color:#dce7cc;
}
.message.bot {
  max-width:100%;
  background:white;
  border-left:3px solid #55755d;
}
.message.failed {
  border-left-color:var(--error);
}
.meta {
  font-size:10px;
  display:flex;
  justify-content:space-between;
  gap:16px;
  color:var(--muted);
  margin-bottom:10px;
}
.meta strong {
  color:var(--ink);
  font-size:11px;
}
.message-body {
  font-size:13px;
  line-height:1.8;
  white-space:pre-wrap;
}
.reply-label {
  font-size:10px;
  color:var(--muted);
  margin-bottom:8px;
}
.source-list {
  margin-top:14px;
  border-top:1px solid var(--line);
  padding-top:12px;
}
.source-list>summary {
  font-size:11px;
  font-weight:600;
  cursor:pointer;
}
.source-item {
  margin-top:12px;
  font-size:11px;
  line-height:1.6;
}
.source-item>a {
  font-weight:600;
  text-decoration:none;
}
.source-item>a:hover {
  text-decoration:underline;
}
.source-item>p {
  margin:5px 0;
  color:var(--muted);
}
.source-item details {
  margin-top:5px;
}
.source-item summary {
  cursor:pointer;
  color:var(--muted);
}
.source-item blockquote {
  white-space:pre-wrap;
  margin:8px 0;
  padding:10px;
  background:var(--paper);
  font-size:11px;
  border-left:2px solid var(--line);
}
.citation-warning {
  color:#805a16;
  font-size:11px;
  margin-top:10px;
}
.bot-status {
  font-size:11px;
  color:var(--muted);
  padding:0 24px;
  min-height:22px;
}
.chat-error {
  padding:0 24px;
}
.composer {
  margin:0 20px 16px;
  padding-top:10px;
  border-top:1px solid var(--line);
}
.composer textarea {
  border:0;
  background:#f6f8f1;
  resize:vertical;
  min-height:58px;
  max-height:160px;
}
.composer-tools {
  display:flex;
  justify-content:space-between;
  align-items:center;
  margin-top:8px;
  gap:12px;
}
.toggle {
  display:flex;
  align-items:center;
  gap:7px;
  font-size:11px;
  color:var(--muted);
  cursor:pointer;
}
.toggle input {
  accent-color:var(--ink);
}
.composer .primary {
  padding:10px 19px;
  min-height:40px;
}
.composer .small {
  margin:7px 0 0;
}
.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;
}
@media(max-width:900px) {
  .welcome {
    gap:6%;
    padding:45px 0;
  }
  .login-card {
    padding:27px;
  }
  .chat-layout {
    grid-template-columns:190px minmax(0,1fr);
    gap:22px;
  }
  .room-header {
    padding:18px;
  }
  .account {
    gap:8px;
  }
}
@media(max-width:650px) {
  .site-header {
    height:76px;
    padding:0 6%;
  }
  .course-tag {
    display:none;
  }
  main {
    padding:0 5%;
  }
  .welcome {
    grid-template-columns:1fr;
    gap:30px;
    padding:32px 0;
  }
  .intro h1 {
    font-size:58px;
    letter-spacing:-2px;
  }
  .intro .lead {
    font-size:15px;
  }
  .topic-list,.source-note {
    display:none;
  }
  .login-card {
    padding:25px;
  }
  .chat-layout {
    display:flex;
    flex-direction:column;
    gap:12px;
    padding:16px 0;
  }
  .sidebar {
    padding:0;
  }
  .sidebar>.eyebrow,.sidebar h2,.sidebar>p,.reading-tip {
    display:none;
  }
  .prompt-list {
    margin:0;
    flex-direction:row;
    gap:7px;
  }
  .prompt {
    flex:1;
    padding:11px 9px;
    font-size:10px;
    gap:5px;
  }
  .sidebar>.text-button {
    margin:6px 0 0;
    font-size:10px;
  }
  .room {
    height:calc(100dvh - 225px);
    min-height:430px;
    max-height:none;
  }
  .room-header {
    padding:14px;
  }
  .room-header h2 {
    font-size:15px;
  }
  .account {
    flex-direction:column;
    align-items:flex-end;
    gap:0;
    font-size:10px;
    max-width:38%;
    overflow-wrap:anywhere;
  }
  .messages {
    padding:14px;
  }
  .message {
    max-width:94%;
    padding:13px;
  }
  .composer {
    margin:0 12px 12px;
  }
  .empty-state {
    margin:24px auto;
  }
  .empty-state h3 {
    font-size:16px;
  }
  footer {
    flex-direction:column;
    gap:6px;
    font-size:9px;
    padding:15px 0;
  }
  .header-right {
    gap:5px;
  }
  .connection {
    font-size:10px;
    padding:6px 9px;
  }
}
@media(prefers-reduced-motion:reduce) {
  .messages {
    scroll-behavior:auto;
  }
}
