/* Student AI workspace: global navigation + conversation directory + working canvas. */
.main-content:has(.ai-page-root) .app-topbar {
  display: none !important;
}

.main-content:has(.ai-page-root) .app-topbar-title {
  display: none;
}

.main-content:has(.ai-page-root) .app-topbar-toggle {
  display: none;
}

.page-content:has(.ai-page-root),
.ai-page-root {
  height: 100%;
  min-height: 0;
  overflow: hidden;
}

.ai-page-root {
  position: relative;
  background: var(--ocean-ui-bg, #F7F8FC);
  color: var(--ocean-ui-text, #171C2B);
  font-family: var(--ocean-ui-font, 'Inter', 'PingFang SC', 'Microsoft YaHei', sans-serif);
}

.ai-page-root > .ai-home-page {
  height: 100%;
  min-height: 0;
}

.ai-home-page {
  position: relative;
  height: 100%;
  overflow: hidden;
  background: var(--ocean-ui-bg, #F7F8FC);
  color: var(--ocean-ui-text, #171C2B);
}

.ai-home-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  height: 100%;
  min-height: 0;
  margin-left: 0;
  transition: margin-left .2s ease;
}

.ai-home-page.history-open .ai-home-layout {
  margin-left: 288px;
}

.ai-home-page .ai-panel-main {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  background: var(--ocean-ui-bg, #F7F8FC);
}

/* Conversation directory */
.ai-history-drawer {
  position: absolute;
  inset: 0 auto 0 0;
  z-index: 6;
  display: flex;
  flex-direction: column;
  width: 288px;
  min-width: 0;
  overflow: hidden;
  border-right: 1px solid var(--ocean-ui-border, #E5E9F2);
  background: var(--ocean-ui-surface, #FFFFFF);
  box-shadow: none;
  transform: translateX(-105%);
  transition: transform .2s ease;
}

.ai-home-page.history-open .ai-history-drawer {
  transform: translateX(0);
}

.ai-history-backdrop {
  position: absolute;
  inset: 0;
  z-index: 4;
  border: 0;
  background: rgba(25, 28, 38, .24);
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease;
}

.ai-home-page.history-open .ai-history-backdrop {
  opacity: 0;
  pointer-events: none;
}

.ai-directory-head {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
  min-height: 66px;
  padding: 11px 14px 10px 18px;
  border-bottom: 0;
  background: var(--ocean-ui-surface, #FFFFFF);
}

.ai-directory-eyebrow {
  display: block;
  margin-bottom: 3px;
  color: #777C8B;
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0;
}

.ai-sidebar-title {
  color: #252733;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.35;
}

.ai-directory-tools {
  padding: 12px 12px 10px;
}

.ai-page .ai-new-chat-btn,
.ai-mobile-new-chat {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-height: 38px;
  padding: 0 12px;
  border: 1px solid #DDDEE6;
  border-radius: 7px;
  background: #FFFFFF;
  color: #343743;
  font: inherit;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(20, 24, 35, .03);
}

.ai-page .ai-new-chat-btn:hover,
.ai-mobile-new-chat:hover {
  border-color: #C9CBD5;
  background: #F3F3F7;
  color: #252733;
  box-shadow: none;
}

.ai-page .ai-new-chat-btn svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
}

.ai-history-search {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 36px;
  margin-top: 9px;
  padding: 0 10px;
  border: 1px solid #E0E1E8;
  border-radius: 7px;
  background: #F4F4F7;
  color: #848997;
}

.ai-history-search:focus-within {
  border-color: #AEB7F7;
  background: #FFFFFF;
  box-shadow: 0 0 0 3px rgba(72, 82, 210, .08);
}

.ai-history-search svg {
  width: 15px;
  height: 15px;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
}

.ai-history-search input {
  width: 100%;
  min-width: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: #343743;
  font: inherit;
  font-size: 12px;
  outline: 0;
}

.ai-history-search input::placeholder {
  color: #9A9EAA;
}

.ai-history-drawer .ai-conv-list {
  flex: 1;
  overflow-y: auto;
  padding: 2px 9px 18px;
}

.ai-conv-group {
  margin-top: 8px;
}

.ai-conv-group-label {
  padding: 7px 9px 5px;
  color: #9296A3;
  font-size: 10px;
  font-weight: 600;
}

.ai-page .ai-conv-item {
  position: relative;
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr) 24px;
  gap: 8px;
  align-items: start;
  min-height: 52px;
  margin: 2px 0;
  padding: 9px 7px 8px 9px;
  border: 1px solid transparent;
  border-radius: 7px;
  color: #535866;
  cursor: pointer;
  transition: background .15s ease, color .15s ease;
}

.ai-page .ai-conv-item:hover {
  border-color: transparent;
  background: #F0F0F4;
  color: #252733;
}

.ai-page .ai-conv-item.active {
  border-color: transparent;
  background: #E9EAF1;
  color: #252733;
}

.ai-conv-item-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  margin-top: 1px;
  color: #858A98;
}

.ai-conv-item.active .ai-conv-item-icon {
  color: #5360DA;
}

.ai-conv-item-icon svg,
.ai-conv-delete svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.ai-conv-copy {
  min-width: 0;
}

.ai-page .ai-conv-title {
  overflow: hidden;
  padding: 0;
  color: inherit;
  font-size: 12.5px;
  font-weight: 500;
  line-height: 1.4;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ai-page .ai-conv-item.active .ai-conv-title {
  color: #252733;
  font-weight: 600;
}

.ai-page .ai-conv-time {
  margin-top: 3px;
  color: #9A9EAA;
  font-size: 10px;
}

.ai-page .ai-conv-delete {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  padding: 0;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: #9296A3;
  cursor: pointer;
  opacity: 0;
}

.ai-page .ai-conv-item:hover .ai-conv-delete,
.ai-page .ai-conv-item.active .ai-conv-delete,
.ai-page .ai-conv-delete:focus-visible {
  opacity: 1;
}

.ai-page .ai-conv-delete:hover {
  background: #FDEBEC;
  color: #C33842;
}

.ai-conv-empty {
  padding: 40px 18px;
  color: #979BA8;
  font-size: 12px;
  line-height: 1.6;
  text-align: center;
}

/* Main conversation canvas */
.ai-chat-header {
  display: flex;
  align-items: center;
  min-height: 56px;
  padding: 8px 18px;
  border-bottom: 1px solid #E7EAF2;
  background: #FFFFFF;
}

.ai-chat-top-actions {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.ai-chat-tool-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #252A36;
  cursor: pointer;
}

.ai-chat-tool-btn:hover,
.ai-chat-tool-btn:focus-visible,
.ai-chat-tool-btn[aria-expanded="true"] {
  background: #EFF1F7;
  color: #263CCF;
  outline: 0;
}

.ai-chat-tool-btn svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.ai-page .ai-panel-messages {
  flex: 1;
  gap: 22px;
  overflow-y: auto;
  padding: 18px 24px 28px;
  background: var(--ocean-ui-bg, #F7F8FC);
}

.ai-page .ai-panel-messages:has(> .ai-welcome) {
  justify-content: flex-start;
}

/* New-conversation visual */
.ai-page .ai-welcome {
  width: min(1030px, 100%);
  margin: 0 auto;
  padding: 0;
  color: #6D7280;
  text-align: left;
  transform: none;
}

.ai-home-breadcrumb {
  display: flex;
  align-items: center;
  gap: 5px;
  min-height: 28px;
  margin-bottom: 10px;
  color: #707789;
  font-size: 12px;
  font-weight: 500;
}

.ai-home-breadcrumb i {
  color: #A4A9B6;
  font-size: 16px;
  font-style: normal;
  line-height: 1;
}

.ai-welcome-hero {
  display: flex;
  align-items: center;
  min-height: 136px;
  padding: 22px 28px;
  overflow: hidden;
  border: 1px solid #D6E0FF;
  border-radius: var(--ocean-ui-card-radius, 8px);
  background: #F1F4FF;
  box-shadow: none;
}

.ai-welcome-copy {
  width: min(560px, 68%);
}

.ai-welcome-eyebrow {
  display: block;
  margin: 0 0 7px;
  color: #4660F4;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0;
}

.ai-page .ai-welcome h1 {
  margin: 0;
  color: #1E2430;
  font-size: 30px;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: 0;
}

.ai-page .ai-welcome p {
  max-width: 540px;
  margin: 10px 0 0;
  color: #667087;
  font-size: 13.5px;
  line-height: 1.65;
}

.ai-welcome-support-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-top: 16px;
}

.ai-start-section {
  min-width: 0;
}

.ai-start-guide {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 14px;
  align-items: start;
  min-height: 154px;
  height: 100%;
  padding: 22px 24px 20px;
  border: 1px solid #E1E5EF;
  border-radius: var(--ocean-ui-card-radius, 8px);
  background: #FFFFFF;
  box-shadow: none;
}

.ai-start-guide-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: var(--ocean-ui-card-radius, 8px);
  background: var(--ocean-ui-primary-soft, #EEF2FF);
  color: var(--ocean-ui-primary, #1F3CFF);
}

.ai-start-guide-icon svg {
  width: 20px;
  height: 20px;
}

.ai-start-guide-copy {
  min-width: 0;
}

.ai-start-guide-copy > span {
  display: block;
  margin-bottom: 5px;
  color: #858CA0;
  font-size: 11px;
  font-weight: 600;
}

.ai-start-guide-copy h2 {
  margin: 0;
  color: #292C36;
  font-size: 17px;
  font-weight: 600;
  line-height: 1.45;
}

.ai-start-guide-copy p {
  margin: 7px 0 0;
  color: #82899A;
  font-size: 11.5px;
  line-height: 1.55;
}

.ai-start-guide-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  grid-column: 2;
  justify-self: start;
  min-height: 34px;
  padding: 0 13px;
  border: 1px solid #D3D9F5;
  border-radius: 8px;
  background: #F8F9FF;
  color: #3F54D9;
  font: inherit;
  font-size: 11.5px;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
}

.ai-start-guide-action:hover {
  border-color: #BBC1E4;
  background: #F7F8FF;
}

.ai-workspace-section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
}

.ai-workspace-section-head > div > span {
  display: block;
  margin-bottom: 4px;
  color: #8A8F9C;
  font-size: 9.5px;
  font-weight: 600;
}

.ai-workspace-section-head h2 {
  margin: 0;
  color: #252733;
  font-size: 20px;
  font-weight: 600;
  line-height: 1.35;
}

.ai-workspace-section-head p {
  margin: 0 0 2px;
  color: #858A98;
  font-size: 11px;
}

.ai-workspace-panel {
  min-width: 0;
  min-height: 154px;
  padding: 22px 24px 20px;
  border: 1px solid #E1E5EF;
  border-radius: var(--ocean-ui-card-radius, 8px);
  background: #FFFFFF;
  box-shadow: none;
}

.ai-progress-panel {
  margin-top: 0;
}

.ai-workspace-section-head.compact {
  align-items: center;
  padding-bottom: 13px;
  border-bottom: 1px solid #EEEFF3;
}

.ai-workspace-section-head.compact h2 {
  font-size: 17px;
}

.ai-workspace-section-head.compact button {
  padding: 0;
  border: 0;
  background: transparent;
  color: #4C5BD8;
  font: inherit;
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
}

.ai-progress-empty {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 13px;
  width: 100%;
  min-height: 62px;
  padding: 14px 0 0;
  border: 0;
  background: transparent;
  color: #747988;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.ai-progress-empty:hover strong,
.ai-progress-empty:focus-visible strong {
  color: var(--ocean-ui-primary, #1F3CFF);
}

.ai-progress-empty:focus-visible {
  outline: 2px solid rgba(31, 60, 255, .24);
  outline-offset: 4px;
}

.ai-progress-empty-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  border-radius: 8px;
  background: #F0F1F7;
  color: #737CCB;
}

.ai-progress-empty-icon svg {
  width: 20px;
  height: 20px;
}

.ai-progress-empty-copy,
.ai-progress-empty strong,
.ai-progress-empty small {
  display: block;
}

.ai-progress-empty-copy {
  min-width: 0;
  flex: 1;
}

.ai-progress-empty strong {
  color: #454954;
  font-size: 12.5px;
}

.ai-progress-empty small {
  display: block;
  margin: 3px 0 0;
  color: #8B909D;
  font-size: 10.5px;
  line-height: 1.55;
}

.ai-progress-empty-arrow {
  flex: 0 0 auto;
  color: #777F99;
  font-size: 15px;
}

.ai-progress-panel .ai-home-signal {
  min-height: 44px;
  margin-top: 8px;
  border: 0;
  background: #F7F7FA;
}

.ai-home-signal {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  width: 100%;
  min-height: 54px;
  margin: 14px auto 0;
  padding: 9px 13px;
  border: 1px solid #E0E2EA;
  border-radius: 8px;
  background: #FAFAFC;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.ai-home-signal:hover {
  border-color: #C7CAD7;
  background: #F5F5F8;
}

.ai-home-signal-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 7px;
  background: #ECEEFF;
  color: #4C5BD8;
}

.ai-home-signal-icon svg {
  width: 18px;
  height: 18px;
}

.ai-home-signal strong,
.ai-home-signal small {
  display: block;
}

.ai-home-signal strong {
  color: #30333E;
  font-size: 12px;
}

.ai-home-signal small {
  margin-top: 3px;
  color: #858A98;
  font-size: 10px;
}

.ai-home-signal > b {
  color: #4C5BD8;
  font-size: 11px;
  white-space: nowrap;
}

/* Conversation content is treated like a working document, not a stack of cards. */
.ai-page .ai-panel-messages .chat-bubble {
  max-width: min(840px, 88%);
  font-size: 14px;
  line-height: 1.72;
}

.ai-page .ai-panel-messages .chat-bubble.sent {
  width: fit-content;
  padding: 11px 15px;
  border: 0;
  border-radius: 8px;
  background: var(--ocean-ui-primary, #1F3CFF);
  color: #FFFFFF;
  box-shadow: none;
}

.ai-page .ai-panel-messages .chat-bubble.sent .chat-sender {
  color: rgba(255, 255, 255, .72);
}

.ai-page .ai-panel-messages .chat-bubble.received {
  width: min(840px, 100%);
  padding: 14px 16px;
  border: 1px solid #E1E5EF !important;
  border-radius: 8px;
  background: #FFFFFF !important;
  color: #2B2E38;
  box-shadow: none;
}

.ai-page .ai-panel-messages .chat-sender {
  margin-bottom: 6px;
  color: #7C8190;
  font-size: 10px;
  font-weight: 600;
}

.ai-page .ai-panel-messages .chat-time {
  margin-top: 7px;
  color: #A0A4AF;
  font-size: 9px;
}

.ai-page .ai-md-content {
  color: #2B2E38;
}

.ai-page .ai-md-content h1,
.ai-page .ai-md-content h2,
.ai-page .ai-md-content h3 {
  color: #252733;
  letter-spacing: 0;
}

.ai-page .ai-md-content table {
  display: block;
  max-width: 100%;
  overflow-x: auto;
  border-color: #E1E3EA;
  border-radius: 6px;
}

.ai-typing-status {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: #747A89;
  font-size: 12px;
}

.ai-message-error {
  color: #4B4F5B;
}

.ai-message-error strong,
.ai-message-error p {
  display: block;
}

.ai-message-error strong {
  color: #30333E;
  font-size: 13px;
}

.ai-message-error p {
  margin: 4px 0 11px;
  color: #777D8B;
  font-size: 12px;
  line-height: 1.6;
}

.ai-retry-button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 32px;
  padding: 0 11px;
  border: 1px solid #D9DEEA;
  border-radius: 7px;
  background: #FFFFFF;
  color: var(--ocean-ui-primary, #1F3CFF);
  font: inherit;
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
}

.ai-retry-button:hover {
  border-color: #AEB8F8;
  background: #F7F8FF;
}

.ai-retry-button svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

/* Composer */
.ai-page .ai-panel-input {
  flex: 0 0 auto;
  padding: 12px max(20px, calc((100% - 866px) / 2)) 16px;
  border-top: 0;
  background: var(--ocean-ui-bg, #F7F8FC);
}

.ai-composer-shell {
  width: min(866px, 100%);
  margin: 0 auto;
}

.ai-response-status {
  min-height: 16px;
  padding: 4px 3px 0;
  color: #858A98;
  font-size: 10px;
  line-height: 1.4;
}

.ai-response-status.failed {
  color: #B45309;
}

.ai-composer-box {
  overflow: hidden;
  border: 1px solid #D9DDEA;
  border-radius: var(--ocean-ui-card-radius, 8px);
  background: #FFFFFF;
  box-shadow: 0 2px 10px rgba(35, 44, 82, .06);
  transition: border-color .16s ease, box-shadow .16s ease;
}

.ai-composer-box:focus-within {
  border-color: #8791E8;
  box-shadow: 0 0 0 3px rgba(76, 91, 216, .09), 0 3px 10px rgba(20, 24, 35, .05);
}

.ai-task-tabs {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 9px 12px 7px;
  border-bottom: 1px solid #ECEEF5;
  background: #F8F9FC;
}

.ai-task-tabs button {
  min-width: 64px;
  height: 29px;
  padding: 0 14px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #696E7C;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.ai-task-tabs button:hover {
  background: #F3F4F8;
  color: #30333E;
}

.ai-task-tabs button.active {
  background: var(--ocean-ui-primary-soft, #EEF2FF);
  color: var(--ocean-ui-primary, #1F3CFF);
}

.ai-page .ai-panel-input textarea {
  display: block;
  width: 100%;
  min-height: 58px;
  max-height: 150px;
  padding: 14px 16px 9px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #30333E;
  font: inherit;
  font-size: 13.5px;
  line-height: 1.55;
  resize: none;
}

.ai-page .ai-panel-input textarea:focus {
  border-color: transparent;
  box-shadow: none;
  outline: none;
}

.ai-page .ai-panel-input textarea::placeholder {
  color: #9A9EAA;
}

.ai-skill-toolbar {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
  padding: 5px 10px 7px;
  border-top: 1px solid #F0F1F5;
}

.ai-skill-toolbar > span {
  flex: 0 0 auto;
  color: #9A9EAA;
  font-size: 11px;
}

.ai-skill-list {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: none;
}

.ai-skill-list::-webkit-scrollbar {
  display: none;
}

.ai-skill-list button {
  flex: 0 0 auto;
  height: 26px;
  padding: 0 10px;
  border: 1px solid #E2E4EB;
  border-radius: 13px;
  background: #FFFFFF;
  color: #5F6472;
  font-size: 11px;
  cursor: pointer;
}

.ai-skill-list button:hover {
  border-color: #BFC5F4;
  color: #3147D9;
}

.ai-skill-list button.active {
  border-color: #AEB6F4;
  background: #F0F2FF;
  color: #3147D9;
  font-weight: 600;
}

.ai-composer-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 39px;
  padding: 0 8px 7px 10px;
  border-top: 1px solid #F0F1F5;
}

.ai-page .ai-mode-toolbar {
  min-width: 0;
  min-height: 30px;
  margin: 0;
}

.ai-page .ai-mode-switch {
  flex: 0 0 auto;
  border: 0;
  background: #F0F1F5;
}

.ai-page .ai-mode-toolbar > span {
  overflow: hidden;
  color: #858A98;
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ai-page .ai-panel-input .btn-primary {
  width: 36px;
  height: 36px;
  border-radius: 7px;
  background: var(--ocean-ui-primary, #1F3CFF);
  box-shadow: none;
}

.ai-page .ai-panel-input .btn-primary:hover {
  background: var(--ocean-ui-primary-hover, #1732D9);
}

.ai-mobile-new-chat {
  display: none;
  width: auto;
  margin-left: auto;
}

@media (max-width: 980px) {
  .ai-home-page.history-open .ai-home-layout {
    margin-left: 260px;
  }

  .ai-history-drawer {
    width: 264px;
  }

  .ai-welcome-hero {
    min-height: 122px;
    padding: 20px 24px;
  }

  .ai-welcome-support-grid {
    grid-template-columns: 1fr;
  }

  .ai-page .ai-panel-messages {
    padding-right: 24px;
    padding-left: 24px;
  }

  .ai-page .ai-panel-input {
    padding-right: 18px;
    padding-left: 18px;
  }
}

@media (max-width: 760px) {
  .ai-home-page.history-open .ai-home-layout {
    margin-left: 0;
  }

  .ai-home-layout {
    margin-left: 0;
  }

  .ai-history-drawer {
    width: min(288px, calc(100% - 38px));
    box-shadow: 14px 0 34px rgba(20, 24, 35, .16);
  }

  .ai-home-page.history-open .ai-history-backdrop {
    opacity: 1;
    pointer-events: auto;
  }

  .ai-home-page .ai-panel-main {
    height: 100%;
    min-height: 0;
  }

  .ai-chat-header {
    min-height: 52px;
    padding: 7px 12px;
  }

  .ai-page .ai-panel-messages {
    padding-top: 14px;
  }
}

@media (max-width: 560px) {
  .ai-chat-heading span {
    display: none;
  }

  .ai-chat-heading strong {
    font-size: 13.5px;
  }

  .ai-chat-product img {
    width: 24px;
    height: 24px;
  }

  .ai-page .ai-panel-messages {
    gap: 18px;
    padding: 14px 12px 20px;
  }

  .ai-welcome-hero {
    min-height: 116px;
    padding: 16px;
    background-position: 62% center;
  }

.ai-welcome-copy {
    width: 68%;
  }

  .ai-page .ai-welcome h1 {
    font-size: 19px;
  }

  .ai-page .ai-welcome p {
    display: -webkit-box;
    overflow: hidden;
    font-size: 11px;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
  }

  .ai-start-guide {
    grid-template-columns: 34px minmax(0, 1fr);
    gap: 11px;
    min-height: 0;
    padding: 12px;
  }

  .ai-start-guide-icon {
    width: 34px;
    height: 34px;
  }

  .ai-start-guide-copy h2 {
    font-size: 14px;
  }

  .ai-start-guide-action {
    grid-column: 2;
    justify-self: start;
  }

  .ai-workspace-section-head.compact {
    align-items: center;
    flex-direction: row;
  }

  .ai-workspace-panel {
    min-height: 0;
    padding: 12px;
  }

  .ai-home-signal {
    grid-template-columns: 32px minmax(0, 1fr);
    margin-top: 10px;
  }

  .ai-home-signal > b {
    display: none;
  }

  .ai-page .ai-panel-messages .chat-bubble {
    max-width: 94%;
  }

  .ai-page .ai-panel-messages .chat-bubble.received {
    max-width: 100%;
    padding: 12px;
  }

  .ai-page .ai-panel-input {
    padding: 9px 10px 11px;
  }

  .ai-page .ai-panel-input textarea {
    min-height: 46px;
    padding: 11px 11px 5px;
    font-size: 13px;
  }

  .ai-task-tabs {
    padding: 7px 8px 0;
  }

  .ai-task-tabs button {
    min-width: 58px;
    height: 28px;
    padding: 0 11px;
  }

  .ai-skill-toolbar {
    gap: 0;
    padding: 6px 8px;
  }

  .ai-skill-toolbar > span {
    display: none;
  }

  .ai-skill-list {
    gap: 5px;
  }

  .ai-skill-list button {
    height: 25px;
    padding: 0 9px;
    font-size: 10.5px;
  }

  .ai-composer-footer {
    min-height: 39px;
    padding: 0 6px 6px 8px;
  }

  .ai-page .ai-panel-input .btn-primary {
    width: 34px;
    height: 34px;
  }

  .ai-page .ai-mode-toolbar > span {
    display: none;
  }
}

@media (max-width: 360px) {
  .ai-welcome-copy {
    width: 68%;
  }
}

/* Compact the business rail only while the conversation directory is open. */
body:has(.ai-page-root) .notice-bell,
body:has(.ai-page-root) .notice-panel {
  display: none !important;
}

.layout:has(.ai-home-page.history-open) .sidebar:has(.student-sidebar-menu) {
  position: relative !important;
  inset: auto !important;
  z-index: 12;
  display: flex !important;
  width: 84px !important;
  min-width: 84px !important;
  overflow: hidden !important;
  border-right: 1px solid #E6E8EF !important;
  background: #F8F9FC !important;
  box-shadow: none !important;
}

.layout:has(.ai-home-page.history-open) .sidebar-mobile-backdrop {
  display: none !important;
}

.layout:has(.ai-home-page.history-open) .sidebar:has(.student-sidebar-menu) .sidebar-header {
  justify-content: center;
  height: 62px;
  min-height: 62px;
  padding: 0;
  border-bottom: 1px solid #E8EAF1 !important;
  background: transparent;
}

.layout:has(.ai-home-page.history-open) .sidebar:has(.student-sidebar-menu) .sidebar-header .logo-mark {
  width: 34px;
  height: 34px;
}

.layout:has(.ai-home-page.history-open) .sidebar:has(.student-sidebar-menu) .sidebar-header .logo-title,
.layout:has(.ai-home-page.history-open) .sidebar:has(.student-sidebar-menu) .sidebar-mobile-close {
  display: none !important;
}

.layout:has(.ai-home-page.history-open) .sidebar:has(.student-sidebar-menu) .sidebar-nav {
  flex: 1;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
}

.layout:has(.ai-home-page.history-open) .sidebar .student-sidebar-menu {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 10px 7px 14px;
}

.layout:has(.ai-home-page.history-open) .student-sidebar-menu .student-primary-nav,
.layout:has(.ai-home-page.history-open) .student-sidebar-menu .student-utility-nav,
.layout:has(.ai-home-page.history-open) .student-sidebar-menu .student-nav-group-title {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  width: 100%;
  height: 58px;
  min-height: 58px;
  margin: 0;
  padding: 5px 2px;
  border: 0;
  border-radius: 9px;
  color: #525968 !important;
  font-size: 10px !important;
  font-weight: 500 !important;
  line-height: 1.15;
  text-align: center;
  white-space: normal;
}

.layout:has(.ai-home-page.history-open) .student-sidebar-menu .student-primary-nav:hover,
.layout:has(.ai-home-page.history-open) .student-sidebar-menu .student-utility-nav:hover,
.layout:has(.ai-home-page.history-open) .student-sidebar-menu .student-nav-group-title:hover {
  background: #EEF0F6;
  color: #202630 !important;
}

.layout:has(.ai-home-page.history-open) .student-sidebar-menu .student-primary-nav.active,
.layout:has(.ai-home-page.history-open) .student-sidebar-menu .student-utility-nav.active,
.layout:has(.ai-home-page.history-open) .student-sidebar-menu .student-nav-group:has(.student-sub-nav.active) > .student-nav-group-title {
  background: #E9EDFF;
  color: #263CCF !important;
}

.layout:has(.ai-home-page.history-open) .student-sidebar-menu .student-primary-nav .nav-icon,
.layout:has(.ai-home-page.history-open) .student-sidebar-menu .student-utility-nav .nav-icon,
.layout:has(.ai-home-page.history-open) .student-sidebar-menu .student-nav-group-title .nav-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 21px;
  height: 21px;
  color: #3E4655 !important;
}

.layout:has(.ai-home-page.history-open) .student-sidebar-menu .student-primary-nav.active .nav-icon,
.layout:has(.ai-home-page.history-open) .student-sidebar-menu .student-utility-nav.active .nav-icon,
.layout:has(.ai-home-page.history-open) .student-sidebar-menu .student-nav-group:has(.student-sub-nav.active) > .student-nav-group-title .nav-icon {
  color: #263CCF !important;
}

.layout:has(.ai-home-page.history-open) .student-sidebar-menu .student-primary-nav .nav-icon svg,
.layout:has(.ai-home-page.history-open) .student-sidebar-menu .student-utility-nav .nav-icon svg,
.layout:has(.ai-home-page.history-open) .student-sidebar-menu .student-nav-group-title .nav-icon svg {
  width: 21px;
  height: 21px;
  stroke-width: 1.7;
}

.layout:has(.ai-home-page.history-open) .student-sidebar-menu .student-nav-group {
  margin: 0;
}

.layout:has(.ai-home-page.history-open) .student-sidebar-menu .student-nav-group::before,
.layout:has(.ai-home-page.history-open) .student-sidebar-menu .student-nav-group .nav-grp-chevron,
.layout:has(.ai-home-page.history-open) .student-sidebar-menu .student-nav-group > .student-sub-nav,
.layout:has(.ai-home-page.history-open) .student-sidebar-menu .student-plan-shortcuts {
  display: none !important;
}

.layout:has(.ai-home-page.history-open) .student-sidebar-menu .student-sidebar-utilities {
  margin-top: 5px;
  padding-top: 8px;
  border-top: 1px solid #E5E7EF;
}

.layout:has(.ai-home-page.history-open) .sidebar:has(.student-sidebar-menu) .sidebar-bottom {
  padding: 8px 7px 10px;
  border-top: 1px solid #E5E7EF;
  background: transparent;
}

.layout:has(.ai-home-page.history-open) .sidebar:has(.student-sidebar-menu) .sidebar-chat-btn {
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  width: 100%;
  height: 52px;
  margin: 0 0 7px !important;
  padding: 4px 2px !important;
  border: 0 !important;
  border-radius: 9px;
  font-size: 10px;
  line-height: 1.1;
}

.layout:has(.ai-home-page.history-open) .sidebar:has(.student-sidebar-menu) .sidebar-chat-btn > span:not(.nav-icon):not(.im-navbadge) {
  flex: 0 0 auto !important;
}

.layout:has(.ai-home-page.history-open) .sidebar:has(.student-sidebar-menu) .sidebar-chat-btn .im-navbadge {
  position: absolute;
  top: 2px;
  right: 8px;
}

.layout:has(.ai-home-page.history-open) .sidebar:has(.student-sidebar-menu) .sidebar-user-entry {
  justify-content: center;
  min-height: 42px;
  margin: 0 !important;
  padding: 3px 0 !important;
}

.layout:has(.ai-home-page.history-open) .sidebar:has(.student-sidebar-menu) .sidebar-user-avatar {
  width: 34px;
  height: 34px;
}

.layout:has(.ai-home-page.history-open) .sidebar:has(.student-sidebar-menu) .sidebar-user-info {
  display: none !important;
}

@media (max-width: 760px) {
  .layout:has(.ai-home-page.history-open) .sidebar:has(.student-sidebar-menu) {
    width: 68px !important;
    min-width: 68px !important;
  }

  .layout:has(.ai-home-page.history-open) .sidebar .student-sidebar-menu {
    padding-right: 5px;
    padding-left: 5px;
  }

  .layout:has(.ai-home-page.history-open) .student-sidebar-menu .student-primary-nav,
  .layout:has(.ai-home-page.history-open) .student-sidebar-menu .student-utility-nav,
  .layout:has(.ai-home-page.history-open) .student-sidebar-menu .student-nav-group-title {
    height: 54px;
    min-height: 54px;
    font-size: 9px !important;
  }

  .ai-chat-header {
    min-height: 52px;
    padding: 7px 12px;
  }

  .ai-chat-tool-btn {
    width: 34px;
    height: 34px;
  }
}
/* AI mode controls are kept with the AI workspace to avoid a separate render-blocking request. */
.ai-mode-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.ai-mode-toolbar > span {
  color: var(--text-muted);
  font-size: 11px;
}

.ai-mode-switch {
  display: inline-flex;
  padding: 2px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #F5F7FA;
}

.ai-mode-switch button {
  min-width: 58px;
  height: 28px;
  padding: 0 12px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--text-secondary);
  font: inherit;
  font-size: 12px;
  cursor: pointer;
}

.ai-mode-switch button.active {
  background: #FFFFFF;
  color: var(--primary);
  font-weight: 600;
  box-shadow: 0 1px 3px rgba(16, 24, 40, .12);
}

.ai-mode-switch button:disabled {
  cursor: wait;
  opacity: .55;
}

.ai-input-row {
  display: flex;
  align-items: flex-end;
  gap: 12px;
}

.ai-page .ai-mode-toolbar {
  justify-content: flex-start;
  gap: 10px;
  min-height: 32px;
  margin-bottom: 8px;
}

.ai-page .ai-mode-toolbar > span { line-height: 1.5; }
.ai-page .ai-input-row { gap: 8px; }

.ai-reasoning-panel {
  margin: 0 0 10px;
  border: 1px solid #DCE4F7;
  border-radius: 6px;
  background: #F8FAFF;
  color: #4D5E87;
}

.ai-reasoning-panel summary {
  padding: 8px 11px;
  color: #29469B;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  user-select: none;
}

.ai-reasoning-panel pre {
  max-height: 260px;
  margin: 0;
  padding: 0 11px 11px;
  overflow: auto;
  color: #596780;
  font-family: inherit;
  font-size: 12px;
  line-height: 1.65;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.ai-message-status.failed {
  margin: 0 0 8px;
  padding: 8px 10px;
  border-left: 3px solid #D92D20;
  background: #FFF4F2;
  color: #912018;
  font-size: 12px;
  line-height: 1.55;
}

@media (max-width: 640px) {
  .ai-composer-shell {
    padding-bottom: max(0px, env(safe-area-inset-bottom));
  }

  .ai-mode-toolbar > span {
    display: none;
  }
}
