:root {
  color-scheme: light;
  --bg: #f5f7f9;
  --panel: #fff;
  --sidebar: #f9fafb;
  --ink: #202e36;
  --muted: #62727d;
  --line: #e1e7eb;
  --accent: #176f6b;
  --accent-dark: #115551;
  --soft: #e6f2ef;
  --warn: #906313;
  --shadow: 0 18px 60px #1b344318;
  --radius: 14px;
  font-family:
    Inter,
    ui-sans-serif,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
}
:root[data-theme="midnight"] {
  color-scheme: dark;
  --bg: #0e131c;
  --panel: #161e2b;
  --sidebar: #111823;
  --ink: #e9edf4;
  --muted: #a8b5c5;
  --line: #2e394b;
  --accent: #dfbc78;
  --accent-dark: #edcc91;
  --soft: #302b23;
  --warn: #edc582;
  --shadow: 0 18px 60px #0005;
}
@media (prefers-color-scheme: dark) {
  :root[data-theme="system"] {
    color-scheme: dark;
    --bg: #0e131c;
    --panel: #161e2b;
    --sidebar: #111823;
    --ink: #e9edf4;
    --muted: #a8b5c5;
    --line: #2e394b;
    --accent: #dfbc78;
    --accent-dark: #edcc91;
    --soft: #302b23;
    --warn: #edc582;
    --shadow: 0 18px 60px #0005;
  }
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  display: grid;
  grid-template-columns: 248px minmax(0, 1fr);
  grid-template-rows: 76px 1fr;
  min-height: 100vh;
  font-size: 15px;
  line-height: 1.65;
}
button,
input,
select,
textarea {
  font: inherit;
}
button,
a,
summary,
input,
select,
textarea {
  -webkit-tap-highlight-color: transparent;
}
button {
  cursor: pointer;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--ink);
  border-radius: 8px;
  padding: 8px 14px;
  font-size: 13px;
  line-height: 1.5;
  transition:
    background 0.15s,
    border-color 0.15s;
}
button:hover {
  background: var(--soft);
  border-color: var(--accent);
}
button:disabled {
  opacity: 0.45;
  cursor: default;
}
button[aria-pressed="true"] {
  background: var(--soft);
  color: var(--accent);
  border-color: var(--accent);
}
:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
}
a {
  color: var(--accent-dark);
}
input,
select,
textarea {
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--ink);
  border-radius: 8px;
  padding: 10px 12px;
  max-width: 100%;
  width: 100%;
}
textarea {
  resize: vertical;
}
input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
  padding: 0;
}
h1,
h2,
h3,
h4 {
  line-height: 1.3;
  letter-spacing: -0.025em;
}
h1 {
  font-size: 30px;
  font-weight: 650;
  margin: 8px 0 14px;
}
h2 {
  font-size: 23px;
}
h3 {
  font-size: 18px;
}
p {
  margin: 8px 0 18px;
}
[hidden] {
  display: none !important;
}
.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;
}
.skip-link {
  position: fixed;
  top: -100px;
  left: 16px;
  z-index: 100;
  background: var(--panel);
  padding: 10px;
}
.skip-link:focus {
  top: 10px;
}
.icon-button {
  min-width: 40px;
  min-height: 40px;
  padding: 5px;
  font-size: 23px;
}
.eyebrow,
.nav-label {
  font-size: 11px;
  line-height: 1.5;
  letter-spacing: 0.1em;
  color: var(--muted);
  font-weight: 600;
  text-transform: uppercase;
}
.eyebrow {
  color: var(--accent);
}
.app-header {
  grid-column: 1/-1;
  display: flex;
  gap: 24px;
  align-items: center;
  padding: 0 26px;
  border-bottom: 1px solid var(--line);
  background: var(--panel);
  position: sticky;
  top: 0;
  height: 76px;
  z-index: 30;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--ink);
  min-width: 198px;
}
.brand-avatar {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  object-fit: cover;
}
.brand strong {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.04em;
}
.brand p {
  font-size: 10px;
  letter-spacing: 0.025em;
  color: var(--muted);
  margin: -3px 0 0;
}
.global-search {
  display: flex;
  align-items: center;
  gap: 6px;
  max-width: 700px;
  flex: 1;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 4px;
}
.global-search input {
  background: transparent;
  border: 0;
  min-width: 100px;
}
.global-search select {
  width: 162px;
  background: transparent;
  border: 0;
  font-size: 11px;
  padding: 8px 4px;
}
.global-search button,
#askButton {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--panel);
  font-weight: 600;
}
.account-menu {
  margin-left: auto;
  position: relative;
  font-size: 12px;
  white-space: nowrap;
}
.account-menu > summary {
  cursor: pointer;
  list-style: none;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
}
.account-menu > summary::-webkit-details-marker {
  display: none;
}
.account-content {
  position: absolute;
  right: 0;
  top: 45px;
  width: 315px;
  max-width: calc(100vw - 30px);
  white-space: normal;
  padding: 20px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  z-index: 50;
}
.language-picker {
  display: flex;
  gap: 8px;
  margin: 14px 0;
}
.glossary-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 12px;
}
.plan-connection {
  border-top: 1px solid var(--line);
  margin-top: 18px;
  padding-top: 10px;
}
.plan-connection p {
  font-size: 11px;
  overflow-wrap: anywhere;
  color: var(--muted);
}
.plan-connection a {
  display: block;
  margin-top: 10px;
}
#mobileMenu {
  display: none;
}
.sidebar {
  grid-row: 2;
  grid-column: 1;
  align-self: start;
  background: var(--sidebar);
  border-right: 1px solid var(--line);
  padding: 24px 16px 16px;
  position: sticky;
  top: 76px;
  height: calc(100vh - 76px);
  overflow: auto;
  display: flex;
  flex-direction: column;
}
.sidebar > .nav-label {
  padding: 0 12px;
}
.main-nav {
  display: grid;
  gap: 5px;
}
.main-nav button {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  text-align: left;
  border: 1px solid transparent;
  background: transparent;
  padding: 11px 12px;
  font-size: 13px;
}
.main-nav button > span:first-child {
  width: 22px;
  text-align: center;
  font-size: 17px;
}
.main-nav button[aria-current="page"] {
  background: var(--soft);
  color: var(--accent);
  font-weight: 600;
}
.sidebar-divider {
  height: 1px;
  background: var(--line);
  margin: 22px 0;
}
.field {
  display: grid;
  gap: 6px;
  font-size: 11px;
  color: var(--muted);
  margin: 14px 0;
}
.field select {
  font-size: 12px;
}
.sort-row {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 6px;
  margin: 10px 0 12px;
}
.sort-row label {
  font-size: 11px;
  color: var(--muted);
}
.sort-row select {
  font-size: 12px;
  width: 100%;
  min-width: 0;
}
.session-list {
  display: grid;
  gap: 4px;
}
.session-item {
  display: block;
  text-align: left;
  width: 100%;
  padding: 11px 10px;
  background: transparent;
  border: 1px solid transparent;
}
.session-item strong {
  display: block;
  font-size: 12px;
  font-weight: 550;
  line-height: 1.5;
}
.session-item > span {
  display: block;
  color: var(--muted);
  font-size: 10px;
  margin-top: 5px;
}
.session-item.active {
  background: var(--panel);
  border-color: var(--line);
  box-shadow: inset 3px 0 var(--accent);
}
.session-item .session-status {
  font-size: 10px;
  color: var(--accent);
}
.sidebar-footer {
  margin-top: auto;
  padding: 24px 12px 6px;
  display: flex;
  gap: 8px;
  align-items: center;
  font-size: 10px;
  color: var(--muted);
}
.status-dot {
  height: 6px;
  width: 6px;
  border-radius: 50%;
  background: var(--accent);
}
#sessionFilter {
  font-size: 12px;
  padding: 8px;
}
#sessionCount {
  margin-top: 18px;
}
.workspace {
  grid-column: 2;
  grid-row: 2;
  min-width: 0;
  padding: 36px clamp(24px, 4vw, 64px) 60px;
}
.content-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 174px;
  gap: 38px;
}
.content-layout:has(.reading-outline[hidden]) {
  grid-template-columns: 1fr;
}
.content-column {
  min-width: 0;
}
.panel {
  max-width: 1020px;
  margin: auto;
  scroll-margin-top: 100px;
}
.panel.active {
  display: block;
}
.panel:not(.active) {
  display: none;
}
.welcome {
  max-width: 800px;
  margin: 40px auto;
  padding: 32px;
  background: var(--panel);
  border-radius: var(--radius);
  border: 1px solid var(--line);
}
.session-heading {
  display: flex;
  gap: 24px;
  align-items: start;
  justify-content: space-between;
}
.session-heading h1 {
  font-size: 26px;
  max-width: 700px;
}
.session-heading .eyebrow {
  margin: 0 0 8px;
}
.session-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: end;
  flex: 0 0 194px;
}
.session-actions button {
  font-size: 11px;
}
#sessionMeta {
  font-size: 12px;
  color: var(--muted);
}
.session-navigation {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  align-items: center;
  margin: 8px 0 14px;
}
.session-navigation button {
  font-size: 16px;
  padding: 3px 10px;
}
.session-navigation span {
  font-size: 11px;
  color: var(--muted);
}
.tabs {
  display: flex;
  gap: 22px;
  border-bottom: 1px solid var(--line);
  margin: 0 0 30px;
  flex-wrap: wrap;
}
.tab {
  background: transparent;
  border: 0;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  color: var(--muted);
  padding: 12px 0;
  font-size: 13px;
}
.tab.active {
  border-bottom-color: var(--accent);
  color: var(--accent);
  font-weight: 600;
}
.tab:hover {
  background: transparent;
}
.markdown {
  line-height: 1.85;
  max-width: 78ch;
  overflow-wrap: anywhere;
}
.markdown h1 {
  font-size: 24px;
  margin: 0 0 16px;
}
.markdown h2 {
  font-size: 19px;
  margin: 32px 0 12px;
}
.markdown h3 {
  font-size: 16px;
  margin: 24px 0 10px;
}
.markdown p {
  margin: 10px 0 18px;
}
.markdown li {
  margin: 6px 0;
}
.markdown > p:first-of-type:has(strong) {
  font-size: 12px;
  color: var(--muted);
}
.markdown code {
  background: var(--soft);
  padding: 2px 5px;
  border-radius: 4px;
}
.table-scroll {
  overflow: auto;
  margin: 20px 0;
}
.markdown table {
  border-collapse: collapse;
  width: 100%;
  font-size: 12px;
}
.markdown td,
.markdown th {
  padding: 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}
.markdown th {
  background: var(--soft);
  font-weight: 600;
}
.note-image {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 10px;
  margin: 24px 0;
}
.reading-outline {
  align-self: start;
  position: sticky;
  top: 106px;
  border-left: 1px solid var(--line);
  padding-left: 18px;
  max-height: calc(100vh - 135px);
  overflow: auto;
}
.reading-outline a {
  display: block;
  padding: 6px 0;
  text-decoration: none;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.6;
}
.reading-outline a:hover {
  color: var(--accent);
}
.focus-mode .reading-outline {
  display: none;
}
.focus-mode .content-layout {
  grid-template-columns: 1fr;
}
.focus-mode .markdown {
  margin: auto;
  max-width: 72ch;
}
.focus-mode .workspace {
  max-width: 1100px;
  margin: auto;
  width: 100%;
}
.assistant-identity {
  max-width: 680px;
  margin: 30px auto 26px;
  text-align: center;
}
.assistant-mark {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  background: var(--soft);
  color: var(--accent);
  border: 1px solid var(--line);
  border-radius: 14px;
  margin: 0 auto 20px;
  font-size: 28px;
}
.assistant-identity h1 {
  font-size: 34px;
}
.assistant-identity p:last-child {
  font-size: 13px;
  color: var(--muted);
}
.question-card {
  max-width: 780px;
  margin: auto;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 18px;
  box-shadow: 0 4px 24px #1e344305;
}
.question-card > label {
  font-size: 11px;
  color: var(--muted);
}
.question-card select {
  font-size: 12px;
  padding: 6px 8px;
  width: auto;
  max-width: 100%;
  border: 0;
  background: var(--bg);
  margin: 5px 0 12px;
}
.question-card textarea {
  border: 0;
  padding: 10px 0;
  font-size: 16px;
  min-height: 110px;
  resize: vertical;
}
.question-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.question-footer span {
  font-size: 11px;
  color: var(--muted);
}
.prompt-suggestions {
  max-width: 780px;
  margin: 14px auto;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.prompt-suggestions button {
  font-size: 11px;
  background: transparent;
}
.answer-prose {
  line-height: 1.8;
  max-width: 78ch;
  margin: 30px auto;
}
.claim-category {
  font-size: 10px;
  letter-spacing: 0.04em;
  color: var(--muted);
  text-transform: uppercase;
}
.answer-notice,
.source-note {
  padding: 12px 16px;
  border-left: 3px solid var(--accent);
  background: var(--soft);
  font-size: 12px;
}
.answer-source {
  border: 1px solid var(--line);
  background: var(--panel);
  border-radius: 10px;
  padding: 15px;
  margin: 10px 0;
  font-size: 13px;
}
.answer-source summary {
  cursor: pointer;
}
.source-passage {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.results {
  max-width: 900px;
  margin-top: 24px;
}
.result {
  padding: 20px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  margin: 10px 0;
}
.result-title {
  font-size: 15px;
  font-weight: 600;
  display: block;
  margin: 5px 0;
}
.result-meta {
  color: var(--muted);
  font-size: 11px;
}
.result-text {
  font-size: 13px;
  line-height: 1.75;
  margin: 12px 0;
}
.result button {
  font-size: 11px;
}
.result mark {
  background: var(--soft);
  color: var(--accent-dark);
  border-radius: 2px;
  padding: 0 2px;
}
#searchContext {
  font-size: 12px;
  color: var(--muted);
}
.empty-state {
  padding: 28px;
  background: var(--panel);
  border: 1px dashed var(--line);
  border-radius: 12px;
  color: var(--muted);
}
.empty-state p {
  margin: 8px 0;
}
.toolbar {
  display: flex;
  gap: 8px;
  align-items: center;
}
.toolbar input {
  flex: 1;
  min-width: 0;
}
.transcript-tools {
  position: sticky;
  top: 76px;
  background: var(--bg);
  z-index: 15;
  padding: 12px 0;
  font-size: 12px;
}
.transcript-tools > input {
  margin: 6px 0;
}
.follow-toggle {
  display: flex;
  gap: 8px;
  align-items: center;
  font-size: 11px;
}
.segment {
  display: grid;
  grid-template-columns: 64px 1fr;
  gap: 16px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
  line-height: 1.8;
}
.segment button {
  font-size: 11px;
  align-self: start;
  padding: 4px 6px;
}
.segment.current {
  background: var(--soft);
  border-radius: 6px;
  padding: 14px 8px;
}
.transcript-tools > span {
  font-size: 11px;
  color: var(--muted);
}
.study-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
  margin: 12px 0 20px;
}
.study-controls span {
  font-size: 12px;
  color: var(--muted);
}
.study-card label {
  display: block;
  font-size: 12px;
  color: var(--muted);
  margin: 12px 0;
}
.study-card summary {
  cursor: pointer;
  color: var(--accent);
  font-size: 13px;
}
.study-card details {
  margin: 20px 0;
}
.study-saved {
  font-size: 11px;
  color: var(--muted);
}
.study-card h2 {
  margin-top: 18px;
}
.glossary-term {
  display: inline;
  background: transparent;
  border: 0;
  border-bottom: 1px dotted var(--accent);
  border-radius: 0;
  padding: 0;
  color: inherit;
  font: inherit;
  cursor: help;
}
.glossary-term:hover {
  background: var(--soft);
}
#glossaryList section {
  padding: 18px 0;
  border-bottom: 1px solid var(--line);
}
#glossaryList h2 {
  margin: 0 0 4px;
}
#glossaryList {
  margin-top: 24px;
}
.glossary-sources summary {
  color: var(--accent);
  cursor: pointer;
  font-size: 12px;
}
.glossary-sources li {
  font-size: 12px;
}
.term-deep summary {
  font-size: 12px;
  color: var(--accent);
  cursor: pointer;
}
.resource-page-controls {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin: 20px 0;
}
.resource-page-controls label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
}
.resource-viewer {
  width: 100%;
  height: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}
#resourceMeta {
  font-size: 12px;
  color: var(--muted);
}
#resourceActions {
  font-size: 12px;
}
#resourceText {
  margin-top: 20px;
}
#resourceText summary {
  cursor: pointer;
}
#resourcePages pre {
  font: inherit;
  font-size: 13px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.source-dock {
  position: fixed;
  right: 16px;
  top: 92px;
  bottom: 16px;
  width: min(530px, calc(100vw - 32px));
  background: var(--panel);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  border-radius: 16px;
  padding: 22px;
  overflow: auto;
  z-index: 45;
}
.source-dock > header {
  display: flex;
  align-items: start;
  gap: 16px;
  justify-content: space-between;
}
.source-dock h2 {
  font-size: 17px;
  line-height: 1.5;
  margin: 0;
}
.source-dock .eyebrow {
  font-size: 10px;
  margin: 0 0 6px;
}
.source-dock #sourceMeta {
  font-size: 11px;
  color: var(--muted);
}
.source-dock .markdown {
  font-size: 13px;
}
.source-dock .markdown h1 {
  font-size: 19px;
}
.source-dock .markdown h2 {
  font-size: 16px;
}
.source-dock #sourceFallback {
  font-size: 12px;
  color: var(--muted);
}
.player-shell {
  width: 100%;
  aspect-ratio: 16/9;
  background: #080c12;
  border-radius: 10px;
  overflow: hidden;
  margin: 16px 0;
}
video,
#youtubePlayer,
#youtubePlayer iframe {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}
#youtubePlayer {
  display: none;
}
.source-open .workspace {
  padding-right: clamp(24px, 4vw, 64px);
}
dialog {
  background: var(--panel);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow);
  width: min(530px, calc(100vw - 32px));
  max-height: 80vh;
  overflow: auto;
  padding: 24px;
}
dialog::backdrop {
  background: #07142166;
}
dialog > header {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 16px;
}
dialog h2 {
  margin: 0 0 20px;
}
dialog #termBody {
  font-size: 14px;
}
#feedback {
  background: var(--soft);
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 12px;
  margin-bottom: 15px;
}
#drawerBackdrop {
  display: none;
}
@media (min-width: 1500px) {
  body.source-open {
    grid-template-columns: 248px minmax(0, 1fr) 560px;
  }
  .source-open .workspace {
    grid-column: 2;
  }
  .source-open .source-dock {
    width: 530px;
  }
  .source-open .content-layout {
    grid-template-columns: 1fr;
  }
  .source-open .reading-outline {
    display: none;
  }
}
@media (max-width: 1100px) {
  body {
    grid-template-columns: 220px minmax(0, 1fr);
  }
  .app-header {
    gap: 16px;
    padding: 0 18px;
  }
  .brand {
    min-width: 180px;
  }
  .global-search select {
    width: 110px;
  }
  .account-menu > summary {
    font-size: 11px;
  }
  .content-layout {
    grid-template-columns: 1fr;
  }
  .reading-outline {
    position: static;
    border: 0;
    padding: 0;
    grid-row: 1;
    max-height: none;
  }
  .reading-outline nav {
    display: flex;
    flex-wrap: wrap;
    gap: 0 18px;
  }
  .reading-outline a {
    font-size: 11px;
  }
  .session-heading {
    display: block;
  }
  .session-actions {
    justify-content: start;
    margin: 14px 0;
  }
  .workspace {
    padding: 28px;
  }
  .assistant-identity h1 {
    font-size: 29px;
  }
}
@media (max-width: 800px) {
  body {
    display: block;
    padding-top: 116px;
  }
  .app-header {
    height: 116px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    padding: 12px 16px;
    position: fixed;
    left: 0;
    right: 0;
    top: 0;
    align-content: center;
  }
  .brand {
    min-width: 0;
    flex: 1;
  }
  .brand p {
    display: none;
  }
  .brand-avatar {
    width: 29px;
    height: 29px;
  }
  .brand strong {
    font-size: 18px;
  }
  .account-menu {
    margin-left: 0;
  }
  .account-menu > summary {
    font-size: 10px;
    padding: 8px;
  }
  .global-search {
    flex: 0 0 100%;
    max-width: none;
    order: 4;
    padding: 2px;
    gap: 2px;
  }
  .global-search input {
    font-size: 16px;
    padding: 6px;
    min-width: 70px;
  }
  .global-search select {
    width: 110px;
    font-size: 10px;
  }
  .global-search button {
    font-size: 11px;
    padding: 7px 9px;
  }
  #mobileMenu {
    display: block;
    font-size: 18px;
    min-width: 32px;
    min-height: 32px;
  }
  .sidebar {
    display: none;
    position: fixed;
    left: 0;
    top: 116px;
    bottom: 0;
    height: calc(100dvh - 116px);
    width: min(320px, 86vw);
    z-index: 40;
    padding: 16px;
  }
  .drawer-open .sidebar {
    display: flex;
  }
  .drawer-open #drawerBackdrop {
    display: block;
    position: fixed;
    inset: 116px 0 0;
    background: #07142166;
    z-index: 35;
    border: 0;
    border-radius: 0;
  }
  .workspace {
    padding: 24px 18px 50px;
  }
  .session-heading h1 {
    font-size: 23px;
  }
  .tabs {
    gap: 18px;
    margin-bottom: 22px;
  }
  .tab {
    font-size: 12px;
  }
  .assistant-identity {
    margin-top: 14px;
    text-align: left;
  }
  .assistant-mark {
    margin: 0 0 18px;
  }
  .assistant-identity h1 {
    font-size: 27px;
  }
  .question-card {
    padding: 14px;
  }
  .question-card textarea {
    font-size: 16px;
  }
  .content-layout {
    gap: 22px;
  }
  .reading-outline {
    display: none;
  }
  .markdown {
    font-size: 14px;
  }
  .markdown table {
    min-width: 440px;
  }
  .source-dock {
    top: 128px;
    bottom: 12px;
    right: 12px;
    width: calc(100vw - 24px);
    padding: 16px;
  }
  .transcript-tools {
    top: 116px;
  }
  input,
  textarea {
    font-size: 16px;
  }
  .segment {
    gap: 10px;
    grid-template-columns: 58px 1fr;
  }
  .question-footer {
    align-items: flex-end;
  }
  .question-footer span {
    max-width: 65%;
  }
  .resource-page-controls select {
    width: auto;
  }
  .study-controls {
    flex-wrap: wrap;
  }
  .welcome {
    margin: 10px 0;
    padding: 20px;
  }
  .sidebar .session-item > span {
    font-size: 11px;
  }
  .sidebar-footer {
    font-size: 11px;
  }
}
@media (pointer: coarse) {
  #mobileMenu {
    min-width: 44px;
    min-height: 44px;
  }
  button,
  summary {
    min-height: 44px;
  }
  .glossary-term {
    min-height: 0;
  }
  .tab {
    min-height: 44px;
  }
}
.markdown h2,
.markdown h3 {
  scroll-margin-top: 100px;
}
@media (prefers-reduced-motion: reduce) {
  * {
    scroll-behavior: auto !important;
    transition: none !important;
  }
}

/* Full-window image viewer retains the document reading position. */
img.note-image,
img.resource-viewer {
  cursor: zoom-in;
}
#imageDialog {
  width: 100vw;
  height: 100dvh;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 16px;
  border: 0;
  border-radius: 0;
  box-sizing: border-box;
  background: var(--panel);
  color: var(--ink);
}
#imageDialog[open] {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
#imageDialog header,
#imageDialog footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-shrink: 0;
}
#imageDialog h2 {
  margin: 0;
  font-size: 16px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
#imageDialog .image-stage {
  flex: 1;
  min-height: 0;
  overflow: auto;
  display: grid;
  place-items: center;
}
#fullImage {
  display: block;
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
}
#imageDialog.image-zoomed .image-stage {
  display: block;
}
#imageDialog.image-zoomed #fullImage {
  max-width: none;
  max-height: none;
  margin: auto;
}

.assistant-hero {
  display: block;
  width: clamp(144px, 20vw, 224px);
  height: auto;
  margin: 0 auto 20px;
  border-radius: 24px;
  border: 1px solid var(--line);
}

.assistant-identity {
  max-width: 780px;
  display: flex;
  align-items: stretch;
  gap: 28px;
  text-align: left;
}
.assistant-hero {
  flex-shrink: 0;
  width: 184px;
  height: 184px;
  margin: 0;
}
.assistant-copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
}
.assistant-copy h1 {
  margin: 10px 0;
}
.assistant-copy p {
  margin: 0;
}
.answer-progress {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px 0;
  color: var(--muted);
}
.progress-spinner {
  width: 28px;
  height: 28px;
  flex-shrink: 0;
  border: 3px dotted var(--accent);
  border-radius: 50%;
  animation: answer-spin 1.6s linear infinite;
}
@keyframes answer-spin {
  to {
    transform: rotate(360deg);
  }
}
@media (max-width: 600px) {
  .assistant-identity {
    gap: 16px;
  }
  .assistant-hero {
    width: 100px;
    height: 100px;
    border-radius: 16px;
  }
  .assistant-copy h1 {
    font-size: 23px;
  }
}
@media (max-width: 380px) {
  .assistant-hero {
    width: 80px;
    height: 80px;
  }
  .assistant-identity {
    gap: 12px;
  }
  .assistant-copy h1 {
    font-size: 21px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .progress-spinner {
    animation: none;
  }
}

.search-actions {
  display: flex;
  align-items: end;
  gap: 16px;
  flex-wrap: wrap;
  margin: 16px 0;
}
.search-actions label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
}
