:root {
  --bg: #f6f7f9;
  --surface: #ffffff;
  --text: #1c2430;
  --muted: #5d6878;
  --border: #dde2e8;
  --accent: #1f6feb;
  --accent-text: #ffffff;
  --user-bubble: #e7f0ff;
  --bot-bubble: #f1f3f6;
  --error: #b42318;
  --ok: #1a7f37;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0d1117;
    --surface: #161b22;
    --text: #e6edf3;
    --muted: #9aa5b1;
    --border: #30363d;
    --accent: #4c8dff;
    --user-bubble: #1c2d4a;
    --bot-bubble: #21262d;
    --error: #ff7b72;
    --ok: #56d364;
      color-scheme: dark;
  }
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", sans-serif;
}
a { color: var(--accent); }
h1 { font-size: 1.75rem; margin: 0 0 .5rem; }
h2 { font-size: 1.1rem; margin: 0 0 .75rem; }
h3 { font-size: 1rem; margin: 1.25rem 0 .5rem; }

.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: .75rem 1rem; background: var(--surface); border-bottom: 1px solid var(--border);
}
.brand { font-weight: 600; text-decoration: none; color: var(--text); }
.cohort { font-weight: 400; color: var(--muted); margin-left: .5rem; }
.nav-form { display: flex; align-items: center; gap: 1rem; margin: 0; }

.page { max-width: 1100px; margin: 0 auto; padding: 1.5rem 1rem 4rem; }
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: 10px;
  padding: 1.25rem; margin-bottom: 1.25rem;
}
.narrow { max-width: 420px; margin: 3rem auto; }
.muted { color: var(--muted); }
.lead { font-size: 1.1rem; color: var(--muted); max-width: 70ch; }
.eyebrow { text-transform: uppercase; letter-spacing: .06em; font-size: .8rem; color: var(--muted); margin: 0; }
.error { color: var(--error); }
.ok { color: var(--ok); }

.stack { display: grid; gap: .9rem; }
label { display: grid; gap: .3rem; font-weight: 500; }
input, textarea {
  width: 100%; font: inherit; color: var(--text); background: var(--bg);
  border: 1px solid var(--border); border-radius: 8px; padding: .6rem .7rem;
}
textarea { resize: vertical; }
button {
  font: inherit; font-weight: 600; cursor: pointer; border: 0; border-radius: 8px;
  padding: .6rem 1.1rem; background: var(--accent); color: var(--accent-text);
}
button:disabled { opacity: .6; cursor: wait; }
button.link { background: none; color: var(--accent); padding: 0; font-weight: 400; }

.lesson-list { list-style: none; padding: 0; }
.lesson-list a { font-weight: 600; font-size: 1.1rem; text-decoration: none; }
.num {
  display: inline-grid; place-items: center; width: 1.8rem; height: 1.8rem; margin-right: .4rem;
  border-radius: 50%; background: var(--accent); color: var(--accent-text); font-size: .9rem;
}

.chat-head { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; justify-content: space-between; }
.chat-head h2 { margin: 0; margin-right: auto; }
.pill {
  font-size: .8rem; padding: .15rem .6rem; border-radius: 999px;
  border: 1px solid var(--border); color: var(--muted);
}
.transcript {
  display: flex; flex-direction: column; gap: .6rem; margin: 1rem 0;
  min-height: 220px; max-height: 480px; overflow-y: auto;
}
.bubble { padding: .6rem .85rem; border-radius: 12px; max-width: 85%; white-space: pre-wrap; overflow-wrap: anywhere; }
.bubble.user { align-self: flex-end; background: var(--user-bubble); }
.bubble.assistant { align-self: flex-start; background: var(--bot-bubble); }
.bubble.pending { color: var(--muted); font-style: italic; }
.chat-form { display: flex; gap: .6rem; align-items: flex-end; }

.tool-activity { align-self: flex-start; max-width: 85%; display: grid; gap: .2rem; margin-top: -.3rem; }
.tool-note { margin: 0; font-size: .85rem; color: var(--muted); }
.tool-note summary { cursor: pointer; }
.tool-note ul { margin: .3rem 0 .2rem; padding-left: 1.2rem; }
.tool-note li { overflow-wrap: anywhere; }

.panel { border: 1px solid var(--border); border-radius: 8px; padding: .6rem .85rem; margin-top: 1rem; }
.panel summary { cursor: pointer; font-weight: 600; }
.panel[open] summary { margin-bottom: .5rem; }
.panel p { margin: 0 0 .6rem; font-size: .9rem; }
.panel .link { margin-top: .4rem; }
.history {
  list-style: none; padding: 0; margin: 0; display: grid; gap: .5rem;
  max-height: 320px; overflow-y: auto;
}
.history li { border-left: 3px solid var(--border); padding-left: .6rem; }
.history .role {
  font-size: .75rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted);
}
.history-text { white-space: pre-wrap; overflow-wrap: anywhere; font-size: .9rem; }


.findings { padding-left: 1.2rem; }
.findings li { margin-bottom: .6rem; white-space: pre-wrap; }
.table { width: 100%; border-collapse: collapse; background: var(--surface); }
.table th, .table td { text-align: left; padding: .6rem .8rem; border-bottom: 1px solid var(--border); }

/* Instructor class summary: a newspaper page on a dark desk, the same in light and dark mode. */
.feedback-link { font-size: 1.05rem; font-weight: 600; margin: 0 0 1.25rem; }
.newsdesk {
  background: #15171c; color: #e8e6e1; border-radius: 10px;
  padding: 1.5rem; margin-bottom: 1.25rem;
}
.newsdesk-bar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1.25rem; }
.newsdesk-bar h2 { margin: 0; color: #e8e6e1; }
.newsdesk .error { color: #ff8a80; }
.newsdesk-meta { color: #a5a29a; text-align: center; font-size: .85rem; margin: 1rem 0 0; }
.newspaper {
  background: #f4f0e6; color: #1b1b1b; max-width: 860px; margin: 0 auto;
  padding: 2rem 2.25rem 2.25rem; box-shadow: 0 12px 32px rgba(0, 0, 0, .55);
  font-family: "Libre Caslon Text", Georgia, "Times New Roman", serif;
}
.masthead { text-align: center; border-bottom: 3px double #1b1b1b; padding-bottom: .4rem; margin-bottom: 1.25rem; }
.masthead-name {
  font-family: "UnifrakturMaguntia", "Old English Text MT", Georgia, serif;
  font-size: clamp(2.2rem, 6vw, 3.6rem); line-height: 1.1; margin: 0;
}
.masthead-meta {
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: .25rem 1rem;
  border-top: 1px solid #1b1b1b; margin-top: .5rem; padding-top: .35rem;
  font-size: .72rem; text-transform: uppercase; letter-spacing: .08em;
}
.headline {
  font-family: "Playfair Display", Georgia, serif; font-weight: 900; color: #111;
  font-size: clamp(1.8rem, 4.5vw, 2.8rem); line-height: 1.1; text-align: center; margin: .5rem 0 1.4rem;
}
.article-body {
  column-count: 2; column-gap: 2rem; column-rule: 1px solid #c9c2b2;
  font-size: 1.02rem; line-height: 1.6; text-align: justify; hyphens: auto;
}
.article-body p { margin: 0 0 .9rem; }
.article-body p:first-child::first-letter {
  float: left; font-family: "Playfair Display", Georgia, serif; font-weight: 900;
  font-size: 3.4rem; line-height: .8; padding: .35rem .4rem 0 0;
}
@media (max-width: 700px) {
  .newspaper { padding: 1.25rem; }
  .article-body { column-count: 1; text-align: left; hyphens: manual; }
}
