/* Approved compact OWEN conversation layout. Loaded after chat-cosmic.css.
 * Every rule is opt-in and student-scoped; native controls and response semantics remain intact. */

body.chat-slim-enabled[data-route="student"] {
  --slim-header-height: 40px;
  --slim-composer-height: 48px;
  --slim-tool-gap: 8px;
  --slim-reading-gutter: 16px;
}

/* One shared reading lane, with no second frame around the conversation. */
body.chat-slim-enabled[data-route="student"] .conversation-lane {
  gap: 0;
  min-height: 0;
  background: var(--owen-surface);
}
body.chat-slim-enabled[data-route="student"] .chat-column,
body.chat-slim-enabled[data-route="student"] .chat-pane {
  min-width: 0;
  min-height: 0;
  gap: 0;
}
body.chat-slim-enabled[data-route="student"] .chat-log {
  flex: 1 1 auto;
  min-height: 0;
  min-width: 0;
  padding: 14px var(--slim-reading-gutter) 16px;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  background: var(--owen-surface);
  scrollbar-gutter: auto;
  overflow-x: hidden;
  overflow-y: auto;
  scroll-padding-bottom: 16px;
}
body.chat-slim-enabled[data-route="student"] .chat-log[data-empty="true"] {
  padding: 0;
}
body.chat-slim-enabled[data-route="student"] .chat-log .bubble.assistant,
body.chat-slim-enabled[data-route="student"] .chat-log .bubble.assistant.has-response {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  padding: 0;
  margin: 0 0 18px;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}
body.chat-slim-enabled[data-route="student"] .chat-log .bubble.assistant .response-card,
body.chat-slim-enabled[data-route="student"] .chat-log .bubble.assistant.has-response .response-card {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}
body.chat-slim-enabled[data-route="student"] .chat-log .bubble.assistant .response-card::before {
  content: none;
}
body.chat-slim-enabled[data-route="student"] .chat-log .bubble.user {
  width: fit-content;
  max-width: min(88%, 72ch);
  padding: 8px 12px;
  margin-block: 0 16px;
  font-size: .875rem;
  line-height: 1.5;
}
body.chat-slim-enabled[data-route="student"] .chat-log .bubble.assistant :is(.bubble-text, .response-body, .response-content, .response-summary, .assistant-structured, .section-body) {
  min-width: 0;
  max-width: 100%;
  font-size: 1.125rem;
  line-height: 1.5;
  overflow-wrap: break-word;
}
body.chat-slim-enabled[data-route="student"] .chat-log .bubble.assistant :is(.response-content, .response-summary, .assistant-structured, .section-body, .streaming-plain, .typewriter-plain) > p {
  margin-block: 0 12px;
}
body.chat-slim-enabled[data-route="student"] .chat-log .bubble.assistant :is(.response-content, .response-summary, .assistant-structured, .section-body, .streaming-plain, .typewriter-plain) > :is(ul, ol) {
  margin-block: 0 12px;
}
body.chat-slim-enabled[data-route="student"] .chat-log .bubble.assistant :is(.response-content, .response-summary, .assistant-structured, .section-body, .streaming-plain, .typewriter-plain) li {
  margin-block: 5px;
}
body.chat-slim-enabled[data-route="student"] .response-header {
  margin-bottom: 8px;
  padding-bottom: 0;
  border-bottom: 0;
}
body.chat-slim-enabled[data-route="student"] .response-toolbar-row {
  gap: 4px;
  flex-wrap: wrap;
}
body.chat-slim-enabled[data-route="student"] .chat-log .bubble.assistant :is(.response-content, .response-summary, .assistant-structured, .section-body) pre {
  max-width: 100%;
  overflow-x: auto;
  white-space: pre;
}
body.chat-slim-enabled[data-route="student"] .chat-log .bubble.assistant :is(.response-content, .response-summary, .assistant-structured, .section-body) :is(.owen-table-scroll, .owen-pretty-table__wrap) {
  max-width: 100%;
  overflow-x: auto;
}
body.chat-slim-enabled[data-route="student"] .chat-log .bubble.assistant .section-body:has(> table) {
  overflow-x: auto;
}

/* Compact header: mode stays separate from the three equally spaced icon cells. */
body.chat-slim-enabled[data-route="student"] .workspace-header.slim-header {
  display: grid;
  grid-template-columns: minmax(88px, 1fr) max-content max-content;
  align-items: center;
  column-gap: 8px;
  flex: 0 0 var(--slim-header-height);
  height: var(--slim-header-height);
  min-height: var(--slim-header-height);
  max-height: none;
  padding: 0 8px;
  margin: 0;
  border: 0;
  border-bottom: 1px solid var(--owen-border);
  border-radius: 0;
  background: var(--owen-surface-soft);
  box-shadow: none;
  backdrop-filter: none;
  z-index: 12;
}
body.chat-slim-enabled[data-route="student"] .slim-header .workspace-header__left {
  display: flex;
  flex: none;
  width: auto;
  min-width: 0;
  gap: 2px;
}
body.chat-slim-enabled[data-route="student"] .slim-header :is(.workspace-header__context, .workspace-header__title-row, .workspace-header__title) {
  min-width: 0;
  margin: 0;
  padding: 0;
  gap: 0;
}
body.chat-slim-enabled[data-route="student"] .slim-header .workspace-header__brand {
  font-size: 18px;
  line-height: 24px;
  letter-spacing: -.5px;
  white-space: nowrap;
}
body.chat-slim-enabled[data-route="student"] .slim-native-focus {
  display: none !important;
}
body.chat-slim-enabled[data-route="student"] .slim-header .slim-header-tools {
  display: block;
  flex: none;
  margin: 0;
  width: auto;
  min-width: 0;
}
body.chat-slim-enabled[data-route="student"] .slim-header-tools .workspace-utility-group {
  display: grid;
  grid-template-columns: repeat(3, 44px);
  gap: var(--slim-tool-gap);
  align-items: center;
  width: auto;
  min-height: 0;
  padding: 0;
  margin: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}
body.chat-slim-enabled[data-route="student"] .slim-header :is(#sidebarDrawerToggle, #sourcesDockToggle, #slimReadingToggle, #theme-toggle) {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: relative;
  flex: 0 0 44px;
  width: 44px;
  min-width: 44px;
  height: var(--slim-header-height);
  min-height: 0;
  padding: 0;
  margin: 0;
  border: 0;
  border-radius: 10px;
  background: transparent;
  box-shadow: none;
  color: var(--owen-text);
}
body.chat-slim-enabled[data-route="student"] .slim-header :is(#sidebarDrawerToggle, #sourcesDockToggle, #theme-toggle) > svg,
body.chat-slim-enabled[data-route="student"] .slim-header #sourcesDockToggle > span:not(.slim-source-count) {
  display: none;
}
body.chat-slim-enabled[data-route="student"] .slim-header :is(#sidebarDrawerToggle, #sourcesDockToggle, #theme-toggle)::before {
  content: "";
  display: block;
  width: 24px;
  height: 24px;
  background-position: center;
  background-repeat: no-repeat;
  background-size: contain;
  flex: none;
}
body.chat-slim-enabled[data-route="student"] .slim-header #sidebarDrawerToggle::before {
  background-image: url('/ui/illustrations/chat-menu.svg');
}
body.chat-slim-enabled[data-route="student"] .slim-header #sourcesDockToggle::before {
  background-image: url('/ui/illustrations/chat-sources.svg');
}
body.chat-slim-enabled[data-route="student"] .slim-header #theme-toggle::before {
  background-image: url('/ui/illustrations/chat-bulb.svg');
}
body.chat-slim-enabled[data-route="student"].theme-dark .slim-header #theme-toggle::before {
  background-image: url('/ui/illustrations/chat-moon.svg');
}
body.chat-slim-enabled[data-route="student"] .slim-source-count {
  position: absolute;
  top: 1px;
  right: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 13px;
  height: 13px;
  padding: 0 2px;
  border-radius: 5px;
  background: var(--owen-surface-soft);
  color: var(--owen-accent);
  font-size: 11px;
  line-height: 13px;
  font-weight: 600;
  pointer-events: none;
}
body.chat-slim-enabled[data-route="student"] .slim-header #slimReadingToggle img {
  display: block;
  width: 24px;
  height: 24px;
  object-fit: contain;
}
body.chat-slim-enabled[data-route="student"] .slim-header-mode {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  grid-column: auto;
  grid-row: auto;
  align-self: center;
  justify-self: end;
  align-items: center;
  flex: none;
  min-width: 0;
  width: auto;
  height: var(--slim-header-height);
  margin: 0;
  padding: 0;
  gap: 2px;
}
body.chat-slim-enabled[data-route="student"] .slim-mode-symbol {
  display: block;
  flex: none;
  width: 17px;
  height: 17px;
  object-fit: contain;
}
body.chat-slim-enabled[data-route="student"] .slim-header-mode .faculty-custom-select[data-select-id="response-mode"] {
  width: auto;
  min-width: 0;
  margin: 0;
}
body.chat-slim-enabled[data-route="student"] .slim-header-mode :is(.composer-mode-select, .faculty-custom-select__trigger) {
  display: inline-flex;
  align-items: center;
  width: auto;
  min-width: 0;
  min-height: 0;
  height: var(--slim-header-height);
  padding: 0 18px 0 3px;
  border: 0;
  border-radius: 8px;
  background-color: transparent;
  box-shadow: none;
  color: var(--owen-muted);
  font-size: 12px;
  font-weight: 500;
  line-height: 18px;
}
body.chat-slim-enabled[data-route="student"] .slim-header-mode .faculty-custom-select__value {
  padding: 0;
  color: inherit;
  font-size: 12px;
  font-weight: 500;
  line-height: 18px;
  white-space: nowrap;
}
body.chat-slim-enabled[data-route="student"] .slim-header-mode .faculty-custom-select__icon {
  right: 4px;
  width: 7px;
  height: 7px;
  border-width: 1.5px;
}
body.chat-slim-enabled[data-route="student"] .slim-header-mode .faculty-custom-select__meta {
  display: none;
}

/* The header uses the native mode list; its viewport-sized portal stays unclipped. */
body.chat-slim-enabled[data-route="student"] #facultyFloatingSurfacePortal .faculty-custom-select__panel[data-select-id="response-mode"] {
  display: flex;
  flex-direction: column;
  gap: 0;
  min-width: 0;
  min-height: 0;
  max-height: var(--faculty-surface-max-height);
  padding: 8px;
  border: 1px solid var(--owen-border);
  border-radius: 16px;
  background: var(--owen-surface);
  color: var(--owen-text);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  box-sizing: border-box;
}
body.chat-slim-enabled[data-route="student"] .faculty-custom-select__panel[data-select-id="response-mode"] .faculty-custom-select__options {
  display: block;
  flex: 1 1 auto;
  min-height: 0;
  max-height: none;
  padding: 0;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  scrollbar-gutter: auto;
}
body.chat-slim-enabled[data-route="student"] .faculty-custom-select__panel[data-select-id="response-mode"] .faculty-custom-select__group {
  margin: 0;
  padding: 0;
}
body.chat-slim-enabled[data-route="student"] .faculty-custom-select__panel[data-select-id="response-mode"] .faculty-custom-select__group-options {
  display: grid;
  gap: 4px;
}
body.chat-slim-enabled[data-route="student"] .faculty-custom-select__panel[data-select-id="response-mode"] .faculty-custom-select__option {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr) 18px;
  align-items: center;
  column-gap: 10px;
  width: 100%;
  min-height: 44px;
  margin: 0;
  padding: 8px 10px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  color: var(--owen-text);
  text-align: left;
  font-size: .875rem;
  line-height: 1.4;
  transform: none;
}
body.chat-slim-enabled[data-route="student"] .faculty-custom-select__panel[data-select-id="response-mode"] .faculty-custom-select__option::before {
  content: "";
  display: block;
  width: 24px;
  height: 24px;
  background: var(--slim-option-icon) center / contain no-repeat;
}
body.chat-slim-enabled[data-route="student"] .faculty-custom-select__panel[data-select-id="response-mode"] .faculty-custom-select__option[data-select-value="balanced"] {
  --slim-option-icon: url('/ui/illustrations/chat-balanced.svg?v=20261109-slim1');
}
body.chat-slim-enabled[data-route="student"] .faculty-custom-select__panel[data-select-id="response-mode"] .faculty-custom-select__option[data-select-value="fast"] {
  --slim-option-icon: url('/ui/illustrations/chat-fast.svg?v=20261109-slim1');
}
body.chat-slim-enabled[data-route="student"] .faculty-custom-select__panel[data-select-id="response-mode"] .faculty-custom-select__option[data-select-value="thinking"] {
  --slim-option-icon: url('/ui/illustrations/chat-thinking.svg?v=20261109-slim1');
}
body.chat-slim-enabled[data-route="student"] .faculty-custom-select__panel[data-select-id="response-mode"] .faculty-custom-select__option[data-select-value="research"] {
  --slim-option-icon: url('/ui/illustrations/chat-research.svg?v=20261109-slim1');
}
body.chat-slim-enabled[data-route="student"] .faculty-custom-select__panel[data-select-id="response-mode"] .faculty-custom-select__option::after {
  content: "";
  color: var(--owen-accent);
  font-size: 16px;
  font-weight: 700;
  text-align: center;
}
body.chat-slim-enabled[data-route="student"] .faculty-custom-select__panel[data-select-id="response-mode"] .faculty-custom-select__option.is-selected::after {
  content: "✓";
}
body.chat-slim-enabled[data-route="student"] .faculty-custom-select__panel[data-select-id="response-mode"] .faculty-custom-select__option:is(:hover, .is-selected, :focus-visible) {
  border-color: var(--owen-border);
  background: var(--owen-tint);
  transform: none;
}
body.chat-slim-enabled[data-route="student"] .faculty-custom-select__panel[data-select-id="response-mode"] .faculty-custom-select__option:focus-visible {
  outline: 2px solid var(--owen-accent);
  outline-offset: -2px;
}
body.chat-slim-enabled[data-route="student"] .faculty-custom-select__panel[data-select-id="response-mode"] .faculty-custom-select__option-label {
  min-width: 0;
  color: inherit;
  font-size: .875rem;
  font-weight: 600;
  line-height: 1.4;
  white-space: normal;
  overflow-wrap: break-word;
}

/* Idle composer is one 44px control row with four pixels of surrounding space.
 * Attachments, lecture context and multiline writing can grow the form naturally. */
body.chat-slim-enabled[data-route="student"] .chat-composer.composer-card {
  position: sticky;
  bottom: 0;
  flex: 0 0 auto;
  width: 100%;
  min-width: 0;
  min-height: var(--slim-composer-height);
  max-height: none;
  margin: 0;
  padding: 0;
  padding-bottom: var(--safe-bottom, env(safe-area-inset-bottom, 0px));
  display: flex;
  flex-direction: column;
  gap: 0;
  border: 0;
  border-radius: 0;
  background: var(--owen-surface-soft);
  box-shadow: none;
  backdrop-filter: none;
  z-index: 14;
}
body.chat-slim-enabled[data-route="student"] .chat-composer.composer-card:is(:focus-within, :hover) {
  border: 0;
  box-shadow: none;
}
body.chat-slim-enabled[data-route="student"] .chat-composer .composer-attachments:empty {
  display: none;
}
body.chat-slim-enabled[data-route="student"] .chat-composer .composer-attachments:not(:empty) {
  padding: 6px 10px;
  margin: 0;
  gap: 6px;
}
body.chat-slim-enabled[data-route="student"] .chat-composer .active-lecture-banner:not([hidden]) {
  margin: 4px 8px;
  padding: 5px 8px;
  border-radius: 9px;
  box-shadow: none;
  font-size: .75rem;
}
body.chat-slim-enabled[data-route="student"] .chat-composer .composer-row.slim-compose-row {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  flex: none;
  align-items: center;
  grid-template-columns: none;
  grid-template-rows: none;
  width: 100%;
  min-width: 0;
  min-height: var(--slim-composer-height);
  margin: 0;
  padding: 1px 6px 2px;
  gap: 4px;
  border-top: 1px solid var(--owen-border);
}
body.chat-slim-enabled[data-route="student"] .chat-composer .slim-compose-row .composer-field {
  position: relative;
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  flex: 1 1 auto;
  grid-row: auto;
  order: 0;
  align-items: center;
  grid-column: auto;
  width: auto;
  min-width: 0;
  margin: 0;
  padding: 0;
  gap: 4px;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}
body.chat-slim-enabled[data-route="student"] .chat-composer .slim-compose-row .composer-field::after {
  content: none;
}
body.chat-slim-enabled[data-route="student"] .chat-composer .slim-compose-row .chat-input,
body.chat-slim-enabled[data-route="student"] .chat-composer:not(.attachments-enabled) .slim-compose-row .chat-input {
  display: block;
  flex: 1 1 auto;
  grid-column: auto;
  grid-row: auto;
  width: 100%;
  min-width: 0;
  height: 44px;
  min-height: 44px;
  max-height: 144px;
  margin: 0;
  padding: 11px 6px 11px 10px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  box-shadow: none;
  color: var(--owen-text);
  font-family: var(--font-body);
  font-size: max(16px, 1rem);
  line-height: 22px;
  resize: none;
  overflow-y: auto;
}
body.chat-slim-enabled[data-route="student"] .chat-composer .slim-compose-row .chat-input:focus-visible {
  outline: 2px solid var(--owen-accent);
  outline-offset: -2px;
  box-shadow: none;
}
body.chat-slim-enabled[data-route="student"] .chat-composer .slim-compose-row :is(.composer-attach-btn, .composer-send) {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 44px;
  grid-row: auto;
  grid-column: auto;
  align-self: center;
  width: 44px;
  min-width: 44px;
  height: 44px;
  min-height: 44px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 10px;
  background: transparent;
  box-shadow: none;
  transform: none;
  filter: none;
}
body.chat-slim-enabled[data-route="student"] .chat-composer .slim-compose-row .composer-send:is(:hover, :focus-visible):not(:disabled) {
  background: transparent;
  box-shadow: none;
  transform: none;
  filter: none;
}
body.chat-slim-enabled[data-route="student"] .slim-send-medallion {
  display: grid;
  place-items: center;
  flex: none;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--owen-accent);
}
body.chat-slim-enabled[data-route="student"] .slim-send-medallion img {
  display: block;
  width: 24px;
  height: 24px;
  object-fit: contain;
}
body.chat-slim-enabled[data-route="student"] .composer-send:disabled .slim-send-medallion {
  background: color-mix(in srgb, var(--owen-accent) 48%, var(--owen-surface-soft));
}
body.chat-slim-enabled[data-route="student"] .composer-send > :is(.composer-send-icon, .composer-send-label) {
  display: none;
}
body.chat-slim-enabled[data-route="student"] .slim-reading-dock {
  display: none;
}

/* Reading uses one dock. Do not hide attachment or active-lecture context nodes. */
body.chat-slim-enabled[data-route="student"].slim-reading .slim-header {
  display: none;
}
body.chat-slim-enabled[data-route="student"].slim-reading:not(.slim-composing) .chat-composer .slim-compose-row {
  display: none;
}
body.chat-slim-enabled[data-route="student"].slim-reading:not(.slim-composing) .chat-composer {
  min-height: 44px;
}
body.chat-slim-enabled[data-route="student"].slim-reading:not(.slim-composing) .slim-reading-dock {
  display: flex;
  align-items: center;
  flex: none;
  gap: 4px;
  min-height: 44px;
  padding: 0 8px;
  border-top: 1px solid var(--owen-border);
}
body.chat-slim-enabled[data-route="student"] .slim-reading-dock > button ,
body.chat-slim-enabled[data-route="student"] .slim-ask-group > .slim-ask {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 44px;
  width: 44px;
  min-width: 44px;
  height: 44px;
  min-height: 44px;
  padding: 0;
  margin: 0;
  border: 0;
  border-radius: 10px;
  background: transparent;
  box-shadow: none;
  color: var(--owen-text);
}
body.chat-slim-enabled[data-route="student"] .slim-reading-dock img {
  display: block;
  width: 24px;
  height: 24px;
  object-fit: contain;
}
body.chat-slim-enabled[data-route="student"] .slim-reading-dock .slim-ask {
  flex: 1 1 auto;
  justify-content: flex-start;
  width: auto;
  min-width: 0;
  padding-inline: 8px;
  gap: 8px;
  text-align: left;
  font-size: .8125rem;
  line-height: 1.3;
}
body.chat-slim-enabled[data-route="student"] .slim-ask small {
  display: block;
  color: var(--owen-muted);
  font-size: .6875rem;
}
body.chat-slim-enabled[data-route="student"] .slim-response-footer {
  display: flex;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 0 8px;
  min-width: 0;
  margin-top: 8px;
  padding-top: 2px;
  border-top: 1px solid var(--owen-border);
  color: var(--owen-muted);
  font-size: .75rem;
}
body.chat-slim-enabled[data-route="student"] .chat-log .response-mode-badge {
  margin: 0;
  min-height: 32px;
  padding: 0 4px;
  border: 0;
  background: transparent;
  box-shadow: none;
  color: var(--owen-muted);
  font-size: .6875rem;
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
}
body.chat-slim-enabled[data-route="student"] .response-model-details {
  margin-top: 0;
  padding: 0;
  min-width: 0;
  color: var(--owen-muted);
  font-size: .75rem;
}
body.chat-slim-enabled[data-route="student"] .response-model-details > summary {
  display: flex;
  align-items: center;
  width: fit-content;
  min-height: 40px;
  padding: 0 4px;
  cursor: pointer;
}
body.chat-slim-enabled[data-route="student"] .response-model-details > div {
  margin: 0;
  padding: 0 4px 10px;
  overflow-wrap: anywhere;
}
/* Preserve the direct-child panel and its lifecycle/Stop lookup. */
body.chat-slim-enabled[data-route="student"] .bubble > .thinking-panel:not(.is-thinking) {
  margin-block: 6px;
  font-size: .75rem;
}
body.chat-slim-enabled[data-route="student"] .thinking-panel:not(.is-thinking) .thinking-panel__capsule {
  min-height: 32px;
  padding: 2px 4px 2px 2px;
  box-shadow: none;
}
body.chat-slim-enabled[data-route="student"] .thinking-panel:not(.is-thinking) .thinking-panel__summary {
  min-height: 32px;
}

/* Native sources keep their original data, links, evidence and verification status. */
body.chat-slim-enabled[data-route="student"] .sources-drawer {
  padding: 0 16px;
  gap: 0;
  background: var(--owen-surface);
  color: var(--owen-text);
}
body.chat-slim-enabled[data-route="student"] .sources-drawer__header {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: none;
  min-height: 48px;
  padding: 0;
  margin: 0;
  border-bottom: 1px solid var(--owen-border);
  background: var(--owen-surface);
}
body.chat-slim-enabled[data-route="student"] .sources-drawer__title {
  flex: 1;
  min-width: 0;
  font-size: 1.125rem;
  line-height: 1.35;
}
body.chat-slim-enabled[data-route="student"] .sources-drawer__header :is(button, .slim-dialog-back) {
  min-height: 44px;
  min-width: 44px;
}
body.chat-slim-enabled[data-route="student"] .sources-drawer__search {
  margin: 10px 0;
}
body.chat-slim-enabled[data-route="student"] .sources-drawer__search input {
  min-height: 44px;
  padding: 9px 12px;
  border: 1px solid var(--owen-control-border);
  border-radius: 12px;
  background: var(--owen-surface-soft);
  color: var(--owen-text);
  font-size: max(16px, 1rem);
}
body.chat-slim-enabled[data-route="student"] .sources-drawer__list {
  display: flex;
  flex-direction: column;
  gap: 0;
  min-width: 0;
  min-height: 0;
  padding-bottom: var(--safe-bottom, 0px);
  overflow: auto;
}
body.chat-slim-enabled[data-route="student"] .source-row {
  display: flex;
  align-items: flex-start;
  flex: none;
  position: relative;
  gap: 8px;
  padding: 10px 0;
  border: 0;
  border-bottom: 1px solid var(--owen-border);
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}
body.chat-slim-enabled[data-route="student"] .source-row:is(:hover, .is-active) {
  background: var(--owen-surface-soft);
  box-shadow: none;
}
body.chat-slim-enabled[data-route="student"] .source-index {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 24px;
  min-width: 24px;
  height: 26px;
  margin-top: 3px;
  border-radius: 7px;
  background: var(--owen-tint);
  color: var(--owen-accent);
  font-size: .6875rem;
}
body.chat-slim-enabled[data-route="student"] .source-body {
  position: relative;
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
  padding-right: 0;
  gap: 4px;
}
body.chat-slim-enabled[data-route="student"] .source-title {
  padding-right: 44px;
  color: var(--owen-text);
  font-size: .9375rem;
  line-height: 1.5;
  font-weight: 600;
  overflow-wrap: anywhere;
}
body.chat-slim-enabled[data-route="student"] .source-meta {
  padding-right: 44px;
  gap: 5px;
  color: var(--owen-muted);
  font-size: .75rem;
  overflow-wrap: anywhere;
}
body.chat-slim-enabled[data-route="student"] .citation-source-verification {
  margin-block: 3px;
  color: var(--owen-muted);
  font-size: .6875rem;
  line-height: 1.5;
  overflow-wrap: anywhere;
}
body.chat-slim-enabled[data-route="student"] .slim-source-details > summary {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 2px 0;
  color: var(--owen-accent);
  cursor: pointer;
  font-size: .75rem;
}
body.chat-slim-enabled[data-route="student"] .slim-source-details :is(.source-url, .source-snippet, .citation-source-verification-note, .citation-source-attribution, .citation-source-access, .citation-source-doi, .citation-source-evidence) {
  margin: 6px 0;
  color: var(--owen-muted);
  font-size: .8125rem;
  line-height: 1.6;
  overflow-wrap: anywhere;
}
body.chat-slim-enabled[data-route="student"] .slim-source-details .citation-source-evidence > summary {
  display: flex;
  align-items: center;
  min-height: 44px;
  cursor: pointer;
}
body.chat-slim-enabled[data-route="student"] .slim-source-details .source-actions {
  margin-top: 4px;
}
body.chat-slim-enabled[data-route="student"] .sources-link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--owen-accent);
}
body.chat-slim-enabled[data-route="student"] .slim-source-open {
  position: absolute;
  top: 0;
  right: 0;
  display: grid;
  place-items: center;
  align-items: center;
  justify-content: center;
  flex: 0 0 44px;
  width: 44px;
  min-width: 44px;
  height: 44px;
  min-height: 44px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 10px;
  color: var(--owen-accent);
  background: transparent;
  font-size: 20px;
  line-height: 1;
  text-decoration: none;
}
body.chat-slim-enabled[data-route="student"] .slim-reading-sources {
  z-index: 3020 !important;
}

/* Denser navigation retains the native routes and saved-chat menus. */
body.chat-slim-enabled[data-route="student"] .student-sidebar .sidebar-header {
  padding: 8px 12px;
  gap: 6px;
}
body.chat-slim-enabled[data-route="student"] .student-sidebar .sidebar-tabs {
  min-height: 0;
}
body.chat-slim-enabled[data-route="student"] .student-sidebar .sidebar-tabs .sidebar-section-tabs {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-template-rows: repeat(2, minmax(44px, auto));
  gap: 2px 8px;
}
body.chat-slim-enabled[data-route="student"] .student-sidebar .sidebar-tabs .sidebar-section-tab {
  min-height: 44px;
  height: auto;
  justify-content: flex-start;
  padding: 5px 8px;
  gap: 8px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  box-shadow: none;
  font-size: .8125rem;
  line-height: 1.3;
}
body.chat-slim-enabled[data-route="student"] .student-sidebar .sidebar-section-tab .nav-orbit {
  flex: 0 0 26px;
  width: 26px;
  height: 26px;
}
body.chat-slim-enabled[data-route="student"] .student-sidebar .sidebar-content {
  padding: 0 12px 12px;
  padding-bottom: calc(12px + var(--safe-bottom, 0px));
}
body.chat-slim-enabled[data-route="student"] #historyPanel {
  padding: 0;
  border-radius: 0;
}
body.chat-slim-enabled[data-route="student"] #historyPanel .card-header {
  padding: 6px 4px;
  min-height: 44px;
  gap: 6px;
}
body.chat-slim-enabled[data-route="student"] #historyPanel .card-title {
  color: var(--owen-text);
  font-size: .8125rem;
  letter-spacing: 0;
  text-transform: none;
  opacity: 1;
}
body.chat-slim-enabled[data-route="student"] #historyPanel .sidebar-panel-body {
  gap: 6px;
}
body.chat-slim-enabled[data-route="student"] #historyPanel :is(.sidebar-input, input[type="search"]) {
  min-height: 44px;
  margin-bottom: 4px;
  padding: 9px 12px;
  border-radius: 12px;
  font-size: max(16px, 1rem);
}
body.chat-slim-enabled[data-route="student"] #historyPanel .saved-item {
  min-height: 68px;
  height: auto;
  padding: 5px 0 5px 8px;
  gap: 4px;
  border: 0;
  border-bottom: 1px solid var(--owen-control-border);
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  overflow: visible;
}
body.chat-slim-enabled[data-route="student"] #historyPanel .saved-item.active {
  border-color: transparent;
  border-radius: 12px;
  background: var(--owen-tint);
}
body.chat-slim-enabled[data-route="student"] #historyPanel .saved-item-main {
  min-height: 56px;
  gap: 3px;
}
body.chat-slim-enabled[data-route="student"] #historyPanel .saved-item-title {
  min-height: 0;
  max-height: calc(2 * 1.4em);
  font-size: .875rem;
  line-height: 1.4;
  font-weight: 500;
}
body.chat-slim-enabled[data-route="student"] #historyPanel .saved-item-meta {
  font-size: .6875rem;
  line-height: 1.3;
}
body.chat-slim-enabled[data-route="student"] #historyPanel :is(.menu-trigger, #new-convo, #historyToggle) {
  flex: 0 0 44px;
  width: 44px;
  min-width: 44px;
  height: 44px;
  min-height: 44px;
}
body.chat-slim-enabled[data-route="student"] #historyPanel .saved-item.menu-open {
  z-index: 32;
}

/* Reading-tools dialog uses one mounted surface for every nested page. */
body.chat-slim-enabled[data-route="student"] .slim-reading-backdrop {
  position: fixed;
  inset: 0;
  z-index: 3000;
  background: color-mix(in srgb, #111936 42%, transparent);
  backdrop-filter: none;
}
body.chat-slim-enabled[data-route="student"] .slim-reading-dialog {
  position: fixed;
  inset: auto 12px max(12px, var(--safe-bottom, 0px));
  z-index: 3010;
  display: flex;
  flex-direction: column;
  width: auto;
  max-width: 440px;
  min-width: 0;
  max-height: min(72dvh, 620px);
  margin-inline: auto;
  padding: 8px 12px 12px;
  overflow: auto;
  border: 1px solid var(--owen-border);
  border-radius: 20px;
  background: var(--owen-surface);
  color: var(--owen-text);
  box-shadow: var(--shadow-lg);
  font-family: var(--font-body);
}
body.chat-slim-enabled[data-route="student"] .slim-dialog-header {
  display: flex;
  align-items: center;
  flex: none;
  min-height: 44px;
  gap: 8px;
}
body.chat-slim-enabled[data-route="student"] .slim-dialog-header h2 {
  flex: 1;
  min-width: 0;
  margin: 0;
  color: var(--owen-text);
  font-family: var(--font-display);
  font-size: 1.0625rem;
  line-height: 1.4;
  font-weight: 600;
}
body.chat-slim-enabled[data-route="student"] .slim-dialog-header button,
body.chat-slim-enabled[data-route="student"] .slim-dialog-back {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  min-width: 44px;
  min-height: 44px;
  margin: 0;
  padding: 0 4px;
  gap: 5px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--owen-accent);
  font: inherit;
  font-size: .75rem;
  line-height: 1.3;
  cursor: pointer;
}
body.chat-slim-enabled[data-route="student"] .slim-dialog-header :is(svg, img) {
  width: 18px;
  height: 18px;
  flex: none;
}
body.chat-slim-enabled[data-route="student"] .slim-dialog-body {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
}
body.chat-slim-enabled[data-route="student"] .slim-menu-option {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-width: 0;
  min-height: 48px;
  padding: 8px;
  border: 0;
  border-top: 1px solid var(--owen-border);
  border-radius: 0;
  background: transparent;
  color: var(--owen-text);
  font: inherit;
  font-size: .875rem;
  line-height: 1.4;
  text-align: left;
  cursor: pointer;
}
body.chat-slim-enabled[data-route="student"] .slim-menu-option img {
  display: block;
  flex: 0 0 24px;
  width: 24px;
  height: 24px;
  object-fit: contain;
}
body.chat-slim-enabled[data-route="student"] .slim-menu-option:is(:hover, [aria-pressed="true"], [aria-selected="true"]) {
  border-radius: 10px;
  background: var(--owen-tint);
  color: var(--owen-accent);
}
body.chat-slim-enabled[data-route="student"] .slim-menu-note {
  margin: 0;
  padding: 12px 4px;
  color: var(--owen-muted);
  font-size: .875rem;
  line-height: 1.6;
  overflow-wrap: anywhere;
}
body.chat-slim-enabled[data-route="student"] :is(.slim-reading-dock button, .slim-header button):hover:not(:disabled) {
  background-color: var(--owen-tint);
}
body.chat-slim-enabled[data-route="student"] :is(.slim-reading-dialog button, .slim-reading-dock button, .slim-header button, .slim-source-open):focus-visible {
  outline: 3px solid var(--owen-accent);
  outline-offset: -3px;
  box-shadow: none;
}
body.chat-slim-enabled[data-route="student"] :is(.slim-reading-dialog, .slim-reading-backdrop, .slim-reading-dock, .slim-dialog-back)[hidden] {
  display: none !important;
}

@media (max-width: 400px) {
  body.chat-slim-enabled[data-route="student"] { --slim-tool-gap: 4px; }
  body.chat-slim-enabled[data-route="student"] .workspace-header.slim-header { column-gap: 4px; }
}
@media (max-width: 350px) {
  body.chat-slim-enabled[data-route="student"] { --slim-tool-gap: 0px; }
  body.chat-slim-enabled[data-route="student"] .workspace-header.slim-header {
    grid-template-columns: minmax(86px, 1fr) max-content max-content;
    column-gap: 2px;
    padding-inline: 4px;
  }
  body.chat-slim-enabled[data-route="student"] .slim-header .workspace-header__brand { font-size: 17px; }
  body.chat-slim-enabled[data-route="student"] .slim-mode-symbol { display: none; }
  body.chat-slim-enabled[data-route="student"] .slim-header-mode :is(.composer-mode-select, .faculty-custom-select__trigger, .faculty-custom-select__value) {
    font-size: 11px;
  }
  body.chat-slim-enabled[data-route="student"] .slim-header-mode :is(.composer-mode-select, .faculty-custom-select__trigger) {
    padding-left: 0;
    padding-right: 15px;
  }
}
/* Sources can narrow a laptop conversation independently of the viewport. */
@media (min-width: 769px) {
  @container student-conversation (max-width: 400px) {
    body.chat-slim-enabled[data-route="student"] .workspace-header.slim-header {
      --slim-tool-gap: 0px;
      grid-template-columns: minmax(80px, 1fr) max-content max-content;
      column-gap: 4px;
      padding-inline: 4px;
    }
    body.chat-slim-enabled[data-route="student"] .slim-header .workspace-header__brand {
      font-size: 17px;
    }
    body.chat-slim-enabled[data-route="student"] .slim-header .slim-mode-symbol {
      display: none;
    }
  }
}
@media (max-width: 1099px) {
  body.chat-slim-enabled[data-route="student"] .student-workspace-grid {
    padding: 0;
  }
  body.chat-slim-enabled[data-route="student"] .student-shell {
    min-height: 0;
    height: 100%;
    gap: 0;
  }
  body.chat-slim-enabled[data-route="student"] .student-sidebar {
    border-radius: 0 20px 20px 0;
  }
  body.chat-slim-enabled[data-route="student"] .student-workspace-grid > .sources-drawer {
    padding-top: var(--safe-top, 0px);
    padding-bottom: var(--safe-bottom, 0px);
  }
}
/* Keep the native preferred Sources width without squeezing chat below 320px. */
@media (min-width: 1100px) {
  body.chat-slim-enabled[data-route="student"] .student-workspace-grid {
    --slim-sidebar-space: var(--sidebar-width, 320px);
    --slim-sidebar-gap: var(--student-shell-gutter, 16px);
  }
  body.chat-slim-enabled[data-route="student"].focus-mode .student-workspace-grid {
    --slim-sidebar-space: 0px;
  }
  body.chat-slim-enabled[data-route="student"].slim-reading .student-workspace-grid {
    --slim-sidebar-space: 0px;
    --slim-sidebar-gap: 0px;
  }
  body.chat-slim-enabled[data-route="student"].sources-open .student-workspace-grid {
    grid-template-columns: minmax(0, 1fr) clamp(320px, var(--sources-width, 380px), calc(100% - var(--slim-sidebar-space) - var(--slim-sidebar-gap) - var(--student-shell-gutter, 16px) - 320px));
  }
  body.chat-slim-enabled[data-route="student"] .student-workspace-grid > .sources-drawer {
    width: 100%;
    min-width: 0;
    max-width: none;
    box-sizing: border-box;
  }
  body.chat-slim-enabled[data-route="student"].slim-reading .student-workspace-grid > .sources-drawer {
    height: 100dvh;
    border-radius: 0;
  }
}
/* Reading reclaims the inline sidebar on tablets as well as laptops. */
@media (min-width: 769px) {
  body.chat-slim-enabled[data-route="student"].slim-reading .student-workspace-grid {
    height: 100dvh;
    min-height: 0;
    padding: 0;
  }
  body.chat-slim-enabled[data-route="student"].slim-reading .student-shell {
    grid-template-columns: minmax(0, 1fr);
    min-height: 0;
    height: 100%;
    gap: 0;
  }
  body.chat-slim-enabled[data-route="student"].slim-reading .main-content {
    flex: 1 1 0;
    width: 100%;
    min-width: 0;
  }
  body.chat-slim-enabled[data-route="student"].slim-reading .student-sidebar {
    /* Native drawer restoration sets an inline display value. */
    display: none !important;
  }
  body.chat-slim-enabled[data-route="student"].slim-reading.tools-open .student-sidebar {
    display: flex !important;
    position: fixed !important;
    inset: 0 auto 0 0;
    z-index: 60;
    width: min(360px, 94vw) !important;
    min-width: 0 !important;
    max-width: min(360px, 94vw) !important;
    height: 100dvh;
    margin: 0 !important;
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: auto !important;
    transform: none !important;
    overflow: hidden !important;
    border: 1px solid var(--owen-border) !important;
    border-radius: 0 20px 20px 0;
    background: var(--owen-surface);
  }
}
@media (prefers-reduced-motion: reduce) {
  body.chat-slim-enabled[data-route="student"] :is(.slim-header, .slim-reading-dialog, .slim-reading-dock, .slim-send-medallion) {
    transition: none;
    animation: none;
  }
}

/* Native action groups stay inside their response card for delegated handlers. */
body.chat-slim-enabled[data-route="student"] .slim-response-footer .response-header {
  order: 3;
  flex: 1 1 auto;
  width: auto;
  min-width: 0;
  margin: 0;
  padding: 0;
  gap: 4px;
  border: 0;
}
body.chat-slim-enabled[data-route="student"] .slim-response-footer .response-toolbar-row {
  width: auto;
  gap: 4px;
  align-items: center;
}
body.chat-slim-enabled[data-route="student"] .slim-response-footer .response-mode-badge {
  order: 1;
  align-self: flex-start;
  min-height: 28px;
}
body.chat-slim-enabled[data-route="student"] .slim-response-footer .response-model-details {
  order: 2;
  flex: 0 1 auto;
}
body.chat-slim-enabled[data-route="student"] .slim-response-footer .response-model-details > summary {
  min-height: 28px;
  font-size: .6875rem;
}
body.chat-slim-enabled[data-route="student"] .slim-response-footer :is(.response-action, .response-summary-toggle) {
  min-height: 28px;
  padding: 0 7px;
  font-size: .75rem;
}
body.chat-slim-enabled[data-route="student"] .slim-response-footer .response-sources {
  display: none;
}
body.chat-slim-enabled[data-route="student"] .slim-response-footer button:focus-visible {
  outline: 3px solid var(--owen-accent);
  outline-offset: 1px;
}
body.chat-slim-enabled[data-route="student"] .slim-reading-dock > .slim-stop {
  color: var(--owen-coral, #ff7c87);
  background: color-mix(in srgb, var(--owen-coral, #ff7c87) 12%, var(--owen-surface-soft));
}
body.chat-slim-enabled[data-route="student"] .slim-stop :is(img, svg) {
  width: 20px;
  height: 20px;
}
body.chat-slim-enabled[data-route="student"] .slim-sources-back {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  gap: 5px;
  min-width: 44px;
  min-height: 44px;
  margin: 0;
  padding: 0 4px;
  border: 0;
  border-radius: 8px;
  color: var(--owen-accent);
  background: transparent;
  font: inherit;
  font-size: .75rem;
  cursor: pointer;
}
body.chat-slim-enabled[data-route="student"] .slim-sources-back :is(svg, img) {
  width: 16px;
  height: 16px;
  flex: none;
}
body.chat-slim-enabled[data-route="student"].slim-reading-sources .sources-drawer {
  z-index: 3020 !important;
}
/* Honor visibility state after all compact control display rules. */
body.chat-slim-enabled[data-route="student"] [hidden] {
  display: none !important;
}
@media (pointer: coarse) {
  body.chat-slim-enabled[data-route="student"] .slim-response-footer :is(.response-action, .response-summary-toggle, .response-model-details > summary) {
    min-height: 44px;
  }
}

/* The writing-return control belongs only to an expanded immersive composer. */
body.chat-slim-enabled[data-route="student"] .chat-composer .slim-compose-close {
  display: none;
}
body.chat-slim-enabled[data-route="student"].slim-reading.slim-composing .chat-composer .slim-compose-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 44px;
  grid-column: auto;
  grid-row: auto;
  width: 44px;
  min-width: 44px;
  height: 44px;
  min-height: 44px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--owen-text);
  font: inherit;
  font-size: 24px;
  line-height: 1;
}

/* Approved desktop/tablet bottom banner and nonmodal native typing overlay. */
body.chat-slim-enabled[data-route="student"] :is(.slim-dock-brand, .slim-dock-tools, .slim-compose-stop) { display: none; }
@media (min-width: 769px) {
  body.chat-slim-enabled[data-route="student"].slim-desktop-dock .workspace-header.slim-header { display: none; }
  body.chat-slim-enabled[data-route="student"].slim-desktop-dock .conversation-lane { grid-template-rows: minmax(0, 1fr); }
  body.chat-slim-enabled[data-route="student"].slim-desktop-dock .chat-composer.composer-card {
    position: relative; flex: 0 0 52px; height: 52px; min-height: 52px; padding: 0;
    overflow: visible; container-type: inline-size;
  }
  body.chat-slim-enabled[data-route="student"].slim-desktop-dock .chat-composer #activeLectureBanner { display: none !important; }
  body.chat-slim-enabled[data-route="student"].slim-desktop-dock .chat-composer #chat-attach { display: none !important; }
  body.chat-slim-enabled[data-route="student"].slim-desktop-dock .chat-composer .composer-attachments:not(:empty) {
    position: absolute; inset: auto 0 100%; background: var(--owen-surface-soft); max-height: 100px; overflow: auto;
  }
  body.chat-slim-enabled[data-route="student"].slim-desktop-dock:not(.slim-composing) .chat-composer .composer-attachments { display: none; }
  body.chat-slim-enabled[data-route="student"].slim-desktop-dock .slim-reading-dock {
    display: flex; align-items: center; gap: 4px; flex: 0 0 52px; height: 52px; min-height: 52px;
    padding: 3px 6px 4px; border-top: 1px solid var(--owen-border); background: var(--owen-surface-soft);
  }
  body.chat-slim-enabled[data-route="student"].slim-desktop-dock.slim-composing .slim-reading-dock { visibility: hidden; pointer-events: none; }
  body.chat-slim-enabled[data-route="student"].slim-desktop-dock .slim-dock-brand {
    display: block; flex: none; margin-right: 8px; font-family: var(--font-display); font-size: 15px; font-weight: 700; letter-spacing: -.5px;
  }
  body.chat-slim-enabled[data-route="student"].slim-desktop-dock .slim-ask-copy { min-width: 0; }
  body.chat-slim-enabled[data-route="student"].slim-desktop-dock .slim-ask-copy > :is(span, small) {
    display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  }
  body.chat-slim-enabled[data-route="student"].slim-desktop-dock .slim-dock-tools { display: flex; align-items: center; flex: none; gap: 4px; }
  body.chat-slim-enabled[data-route="student"].slim-desktop-dock .slim-dock-tools :is(#sourcesDockToggle, #slimReadingToggle, #theme-toggle) {
    display: inline-flex; position: relative; align-items: center; justify-content: center; flex: 0 0 44px;
    width: 44px; min-width: 44px; height: 44px; min-height: 44px; margin: 0; padding: 0;
    border: 0; border-radius: 10px; background: transparent; box-shadow: none; color: var(--owen-text);
  }
  body.chat-slim-enabled[data-route="student"].slim-desktop-dock .slim-dock-tools :is(#sourcesDockToggle, #theme-toggle) > :is(svg, span:not(.slim-source-count)) { display: none; }
  body.chat-slim-enabled[data-route="student"].slim-desktop-dock .slim-dock-tools :is(#sourcesDockToggle, #theme-toggle)::before {
    content: ""; display: block; width: 24px; height: 24px; flex: none; background: center / contain no-repeat;
  }
  body.chat-slim-enabled[data-route="student"].slim-desktop-dock .slim-dock-tools #sourcesDockToggle::before { background-image: url('/ui/illustrations/chat-sources.svg'); }
  body.chat-slim-enabled[data-route="student"].slim-desktop-dock .slim-dock-tools #theme-toggle::before { background-image: url('/ui/illustrations/chat-bulb.svg'); }
  body.chat-slim-enabled[data-route="student"].slim-desktop-dock.theme-dark .slim-dock-tools #theme-toggle::before { background-image: url('/ui/illustrations/chat-moon.svg'); }
  body.chat-slim-enabled[data-route="student"].slim-desktop-dock .slim-dock-tools .slim-header-mode { height: 44px; }
  body.chat-slim-enabled[data-route="student"].slim-desktop-dock .slim-dock-tools .slim-header-mode :is(.composer-mode-select, .faculty-custom-select__trigger) { height: 44px; }
  body.chat-slim-enabled[data-route="student"].slim-desktop-dock .slim-dock-tools button:hover:not(:disabled) { background-color: var(--owen-tint); }
  body.chat-slim-enabled[data-route="student"].slim-desktop-dock .chat-composer .slim-compose-row { display: none; }
  body.chat-slim-enabled[data-route="student"].slim-desktop-dock.slim-composing .chat-composer .slim-compose-row {
    display: flex; position: absolute; inset: auto 0 0; z-index: 2; align-items: flex-end;
    min-height: 52px; padding: 3px 6px 4px; background: var(--owen-surface-soft);
  }
  body.chat-slim-enabled[data-route="student"].slim-desktop-dock .chat-composer .slim-compose-row .chat-input { max-height: 100px; }
  body.chat-slim-enabled[data-route="student"].slim-desktop-dock.slim-composing .chat-composer :is(.slim-compose-close, .slim-compose-stop) {
    display: inline-flex; align-items: center; justify-content: center; flex: 0 0 44px;
    width: 44px; min-width: 44px; height: 44px; min-height: 44px; padding: 0; margin: 0;
    border: 0; border-radius: 10px; background: transparent; color: var(--owen-text); font: inherit; font-size: 24px;
  }
  body.chat-slim-enabled[data-route="student"].slim-desktop-dock.slim-composing .chat-composer .slim-compose-stop { font-size: 16px; color: var(--owen-coral, #ff7c87); }
  @container (max-width: 650px) {
    body.chat-slim-enabled[data-route="student"].slim-desktop-dock .slim-dock-brand { display: none; }
    body.chat-slim-enabled[data-route="student"].slim-desktop-dock .slim-dock-tools { gap: 0; }
    body.chat-slim-enabled[data-route="student"].slim-desktop-dock .slim-dock-tools .slim-header-mode { width: 44px; flex: 0 0 44px; justify-content: center; }
    body.chat-slim-enabled[data-route="student"].slim-desktop-dock .slim-dock-tools .slim-mode-symbol { display: block; width: 24px; height: 24px; position: relative; z-index: 1; pointer-events: none; }
    body.chat-slim-enabled[data-route="student"].slim-desktop-dock .slim-dock-tools .slim-header-mode .faculty-custom-select { width: 24px; margin-left: -24px; }
    body.chat-slim-enabled[data-route="student"].slim-desktop-dock .slim-dock-tools .faculty-custom-select__trigger { width: 44px; margin-left: -10px; padding: 0; }
    body.chat-slim-enabled[data-route="student"].slim-desktop-dock .slim-dock-tools :is(.faculty-custom-select__value, .faculty-custom-select__icon) { visibility: hidden; }
  }
  @container (max-width: 400px) {
    body.chat-slim-enabled[data-route="student"].slim-desktop-dock .slim-dock-tools { display: none; }
  }
}

/* Direct unpriming keeps the lecture state on its native clear action. */
body.chat-slim-enabled[data-route="student"] .slim-ask-group {
  display: flex; align-items: center; flex: 1 1 auto; min-width: 0;
}
body.chat-slim-enabled[data-route="student"] .slim-clear-lecture { display: none; }
@media (min-width: 769px) {
  body.chat-slim-enabled[data-route="student"].slim-desktop-dock .slim-ask-group.has-lecture .slim-ask {
    flex: 0 1 auto; max-width: calc(100% - 44px);
  }
  body.chat-slim-enabled[data-route="student"].slim-desktop-dock .slim-clear-lecture {
    display: inline-flex; align-items: center; justify-content: center; flex: 0 0 44px;
    width: 44px; min-width: 44px; height: 44px; padding: 0; margin: 0;
    border: 0; border-radius: 10px; background: transparent; color: var(--owen-muted);
  }
  body.chat-slim-enabled[data-route="student"].slim-desktop-dock .slim-clear-lecture > span {
    display: grid; place-items: center; width: 18px; height: 18px; border-radius: 50%;
    background: var(--owen-tint); color: var(--owen-accent); font-size: 14px; line-height: 1;
  }
}

/* Requested space cleanup: keep the library open and remove unused chrome. */
body.chat-slim-enabled[data-route="student"] #libraryPanel > .library-card-header,
body.chat-slim-enabled[data-route="student"] #libraryPanelBody .student-library__action-secondary,
body.chat-slim-enabled[data-route="student"] #libraryAdvancedBody {
  display: none !important;
}
body.chat-slim-enabled[data-route="student"] #libraryPanel.is-collapsed > #libraryPanelBody {
  max-height: none; opacity: 1; pointer-events: auto;
}
body.chat-slim-enabled[data-route="student"] #libraryPanelBody :is(#practiceTestBuilderBtn, #libraryGeminiBtn),
body.chat-slim-enabled[data-route="student"] #libraryPanelBody :is(#practiceTestBuilderBtn, #libraryGeminiBtn):is(:hover, :active, :focus-visible) {
  background: var(--owen-surface); color: var(--owen-text);
  border: 1px solid var(--owen-border); box-shadow: none;
}
