.nova-panel {
  position: absolute;
  right: 8px;
  top: 8px;
  bottom: 8px;
  width: 330px;
  border: 1px solid #ddd;
  box-shadow: 0 8px 30px #0000000c;
  background: var(--color-surface);
  border-radius: 19px;
  z-index: 5;
  display: flex;
  flex-direction: column;
}

.nova-panel .dialog-header {
  padding: 14px 17px;
}

.nova-panel .mini-sprite {
  width: 90px;
  height: 90px;
  object-fit: contain;
  image-rendering: pixelated;
  margin: 14px auto;
}

.chat-messages {
  flex: 1;
  overflow: auto;
  padding: 4px 18px;
}

.message {
  font-size: 12px;
  line-height: 1.7;
  background: var(--color-surface-soft);
  border-radius: 14px;
  padding: 11px 14px;
  margin-bottom: 12px;
}

.message.user {
  margin-left: 35px;
  background: #eaf4ff;
}

.chat-form {
  padding: 14px;
  display: flex;
  gap: 7px;
  border-top: 1px solid var(--line);
}

.chat-form input {
  min-width: 0;
  flex: 1;
  border: 1px solid #ddd;
  border-radius: 10px;
  padding: 9px;
  font-size: 12px;
}

@media (max-width: 640px) {
  .nova-panel {
    position: fixed;
    inset: 7px;
    width: auto;
    z-index: 30;
  }
}

/* ------------------------------------------------------------------------- */
/* Nova belongs to the lesson workspace only. */
#lesson #lesson #lesson .nova-panel {
  top: 53px;
  right: 8px;
  bottom: 8px;
  width: 310px;
}

#lesson.lesson-nova-open .dialog-body {
  margin-right: 318px;
}

@media (max-width: 760px) {
  #lesson.lesson-nova-open .dialog-body {
    margin-right: 0;
  }
  #lesson .nova-panel {
    position: absolute;
    inset: 53px 8px 8px;
    width: auto;
  }
}

#lesson.lesson-nova-open > .dialog-header {
  grid-column: 1;
  padding: 12px 32px;
}

#lesson.lesson-nova-open .dialog-body {
  grid-column: 1;
  margin: 0 auto;
  padding: 25px 32px 50px;
  width: 100%;
}

#lesson .nova-panel {
  position: sticky;
  grid-column: 2;
  grid-row: 1 / span 3;
  align-self: start;
  top: 12px;
  right: auto;
  bottom: auto;
  width: auto;
  height: calc(100dvh - 76px);
  min-height: 520px;
  max-height: 900px;
  margin: 8px 12px 12px 0;
  border-radius: 20px;
  box-shadow: 0 2px 6px #00000004;
}

#lesson .nova-panel .mini-sprite {
  display: none;
}

.nova-panel .message:not(.user) {
  background: transparent;
  padding: 10px 0;
}

.nova-panel .message.user {
  background: var(--color-surface-soft);
}

.nova-bar {
  position: fixed;
  bottom: 72px;
  left: calc(50% + var(--sidebar-width-collapsed, 54px) / 2);
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 7px;
  width: min(340px, calc(100vw - 40px));
  height: 43px;
  padding: 5px 10px;
  border: 1px solid #333;
  border-radius: 999px;
  background: #171717;
  backdrop-filter: blur(12px);
  box-shadow: 0 4px 16px #0005;
  z-index: 6;
}

.nova-bar > img {
  width: 28px;
  height: 28px;
  object-fit: contain;
  image-rendering: pixelated;
}

.nova-bar input {
  flex: 1;
  min-width: 0;
  border: 0;
  background: none;
  outline: 0;
  color: #fff;
  font-size: 12px;
}

.nova-bar input::placeholder {
  color: #aaa;
  opacity: 1;
}

.nova-bar .icon-button {
  color: #eee;
  width: 28px;
  height: 28px;
  flex-shrink: 0;
  border-radius: 50%;
  background: #2b2b2b;
}

.nova-bar button[type="submit"] {
  background: #fff;
  color: #171717;
}

.lesson-nova-open .nova-bar {
  display: none;
}

@media (max-width: 900px) {
  #lesson.lesson-nova-open {
    grid-template-columns: minmax(0, 1fr) 285px;
  }
}

@media (max-width: 760px) {
  #lesson.lesson-nova-open {
    display: block;
  }
  #lesson.lesson-nova-open .dialog-body {
    margin: 0;
    padding: 25px;
  }
  #lesson .nova-panel {
    position: fixed;
    inset: 12px;
    top: 12px;
    width: auto;
    height: auto;
    min-height: 0;
    max-height: none;
    margin: 0;
    z-index: 40;
    border-radius: 22px;
    box-shadow: 0 0 0 20px #0004;
  }
  #lesson .nova-panel .dialog-header {
    padding: 15px 18px;
  }
}

@media (max-width: 640px) {
  .nova-bar {
    left: 50%;
    bottom: calc(94px + env(safe-area-inset-bottom, 0px));
    width: calc(100% - 40px);
    max-width: 360px;
  }
  .nova-bar input {
    font-size: 16px;
  }
  #lesson .nova-panel {
    inset: calc(10px + env(safe-area-inset-top, 0px)) 10px
    calc(10px + env(safe-area-inset-bottom, 0px));
    height: auto;
  }
}

.chat-form > img {
  width: 25px;
  height: 25px;
  object-fit: contain;
  image-rendering: pixelated;
  align-self: center;
}

.chat-form {
  align-items: center;
}

#lesson.lesson-nova-open {
  padding-right: 0;
}

#lesson.lesson-nova-open #lesson-context {
  display: none;
}

.app:not(.collapsed) .nova-bar {
  left: calc(50% + var(--sidebar-width, 218px) / 2);
}

@media (max-width: 760px) {
  .nova-bar {
    left: 50%;
  }
  #lesson.lesson-nova-open {
    padding-right: 0;
  }
}

#lesson .nova-panel {
  border-color: #dedede;
  border-radius: 22px;
}

#lesson .nova-panel .dialog-header {
  padding: 13px 14px;
  gap: 4px;
  border: 0;
  color: #333;
  justify-content: flex-start;
}

#nova-conversation-title {
  font-size: 12px;
  font-weight: 500;
  flex: 1;
}

.nova-panel .dialog-header .icon-button {
  width: 26px;
  height: 26px;
  font-size: 19px;
  color: var(--color-muted);
  padding: 0;
}

.nova-magma {
  flex-shrink: 0;
  margin: 0 10px 13px;
  padding: 4px;
  border-radius: 17px;
  background:
  radial-gradient(ellipse at 20% 0%, #f54de7 0%, transparent 53%),
  radial-gradient(ellipse at 44% 85%, #ff484b 0%, transparent 55%),
  linear-gradient(120deg, #fb65d8, #ff7810 72%, #fa9308);
  box-shadow: 0 2px 4px #f268301f;
}

.nova-magma > header {
  display: flex;
  justify-content: space-between;
  color: white;
  font-size: 11px;
  padding: 10px 11px 12px;
}

.nova-task-list {
  background: var(--color-surface);
  border-radius: 13px;
  padding: 4px 6px;
}

.nova-task {
  border: 0;
  background: white;
  display: flex;
  align-items: center;
  gap: 8px;
  text-align: left;
  width: 100%;
  font-size: 11px;
  padding: 8px 5px;
  color: #555;
  border-radius: 8px;
}

.nova-task:hover {
  background: #fafafa;
}

.nova-task > span:nth-child(2) {
  flex: 1;
}

.nova-task small {
  color: #bbb;
  font-size: 11px;
}

.task-circle {
  width: 13px;
  height: 13px;
  border: 1px solid #b6a0e4;
  border-radius: 50%;
  flex-shrink: 0;
  color: #7c58b9;
  display: grid;
  place-items: center;
  font-size: 9px;
}

.nova-task.finished .task-circle {
  background: #eee7ff;
  border-color: #cbbce9;
}

.nova-panel .chat-messages {
  padding: 0 17px;
}

.nova-panel .message {
  font-size: 12px;
  line-height: 1.8;
  margin-bottom: 15px;
}

.nova-panel .message.user {
  margin-left: 32px;
  border-radius: 999px;
  padding: 8px 12px;
}

.nova-suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 12px;
}

.nova-suggestions button {
  border: 1px solid #e8e8e8;
  background: white;
  border-radius: 999px;
  padding: 7px 10px;
  font-size: 10px;
  color: var(--color-muted);
}

.nova-suggestions button:hover {
  background: var(--color-surface-soft);
}

#lesson .nova-panel .chat-form {
  margin: 0 17px;
  padding: 11px 0;
  border-top: 1px solid var(--color-line);
  gap: 7px;
}

.nova-panel .chat-form input {
  border: 0;
  background: transparent;
  border-radius: 0;
  padding: 7px 0;
  outline-offset: 0;
  font-size: 12px;
  min-height: 30px;
}

.nova-panel .chat-form input:focus-visible {
  outline: none;
}

.nova-panel .chat-form .nova-send {
  width: 26px;
  height: 26px;
  color: var(--color-muted);
  font-size: 20px;
  flex-shrink: 0;
}

.nova-panel .chat-form > img {
  width: 24px;
  height: 24px;
}

@media (max-width: 640px) {
  .nova-panel .chat-form input {
    font-size: 16px;
  }
  .nova-task {
    min-height: 36px;
  }
  .nova-magma {
    margin-bottom: 15px;
  }
}

@media print {
  .lesson-path,
  .read-action,
  .nova-magma {
    display: none;
  }
}

.study-rest-nova {
  flex: 0 0 64px;
  width: 64px;
  height: 64px;
  object-fit: contain;
}

.study-main--rest .study-rest-nova {
  flex: 0 0 auto;
  width: 80px;
  height: 80px;
}

@media (max-width: 640px) {
  .study-rest-nova {
    flex-basis: 52px;
    width: 52px;
    height: 52px;
  }
}

/* Drag the left edge of the Nova panel to resize it. */
.nova-resize {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 12px;
  cursor: col-resize;
  z-index: 8;
  touch-action: none;
}

.nova-resize::after {
  content: "";
  position: absolute;
  left: 4px;
  top: 50%;
  width: 3px;
  height: 44px;
  margin-top: -22px;
  border-radius: 3px;
  background: transparent;
  transition: background var(--motion-ui);
}

.nova-resize:hover::after,
.nova-resize.dragging::after {
  background: #d6d6d6;
}

body.nova-resizing,
body.nova-resizing * {
  cursor: col-resize !important;
  user-select: none !important;
}

@media (max-width: 760px) {
  .nova-resize {
    display: none;
  }
}

.app.nova-expanded .nova-resize {
  display: none;
}

/* Nova occupies its own surface beside the workspace. */
.app > #nova-panel {
  display: flex;
  position: relative;
  inset: auto;
  width: auto;
  margin: 0;
  border: 0;
  border-radius: 22px;
  box-shadow: none;
  background: var(--color-surface);
  min-width: 0;
  overflow: hidden;
  z-index: 5;
  min-height: 0;
  max-height: none;
  height: 100%;
}

.app > #nova-panel[hidden] {
  display: none;
}

#nova-panel > .dialog-header {
  padding: 16px 15px 13px;
  display: flex;
  align-items: center;
  gap: 5px;
  border: 0;
  flex-shrink: 0;
}

#nova-conversation-title {
  font-size: 12px;
  min-width: 0;
  flex: 1;
  color: #333;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

#nova-panel .dialog-header .icon-button {
  display: grid;
  place-items: center;
  width: 27px;
  height: 27px;
  background: var(--color-surface);
  border: 1px solid var(--color-line);
  border-radius: 50%;
  box-shadow: 0 1px 3px #00000005;
  font-size: 19px;
  color: #555;
  padding: 0;
  flex-shrink: 0;
}

#nova-panel .dialog-header .icon-button:hover {
  background: var(--color-surface-soft);
}

#nova-panel .mini-sprite {
  display: none;
}

#nova-panel .nova-magma {
  flex-shrink: 0;
  margin: 0 14px 17px;
}

#nova-panel .chat-messages {
  padding: 0 18px;
  overflow-y: auto;
  flex: 1;
  min-height: 0;
  overscroll-behavior: contain;
}

#nova-panel .chat-form {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 17px;
  padding: 13px 0;
  border: 0;
  border-top: 1px solid var(--color-line);
  flex-shrink: 0;
  background: white;
}

#nova-panel .chat-form input {
  border: 0;
  background: transparent;
  padding: 7px 0;
  border-radius: 0;
  min-width: 0;
  flex: 1;
  font-size: 12px;
  outline: none;
}

#nova-panel .chat-form > img {
  width: 24px;
  height: 24px;
  object-fit: contain;
  image-rendering: pixelated;
}

#nova-panel .chat-form .nova-send {
  width: 26px;
  height: 26px;
  padding: 0;
  background: none;
  flex-shrink: 0;
  color: var(--color-muted);
  font-size: 20px;
}

#nova-panel .chat-form:focus-within {
  border-top-color: #8db5e8;
}

.nova-mode {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--color-muted);
  display: grid;
  place-items: center;
  padding: 0;
  cursor: pointer;
}

.nova-mode:hover {
  background: #f2f2f2;
}

.nova-mode svg {
  width: 17px;
  height: 17px;
}

.nova-mode[aria-pressed="true"] {
  background: var(--color-text);
  color: var(--color-surface);
}

#nova-panel .chat-form .nova-send svg {
  width: 18px;
  height: 18px;
}

@media (min-width: 761px) {
  .app.nova-split {
    grid-template-columns: var(--sidebar-width) minmax(0, 1fr) var(
    --nova-w,
    var(--nova-width)
    );
    gap: 0 4px;
    overflow: hidden;
    padding: 0;
  }
  .app.nova-split.collapsed {
    grid-template-columns: var(--sidebar-width-collapsed) minmax(0, 1fr) var(
    --nova-w,
    var(--nova-width)
    );
  }
  .app.nova-split > .main {
    padding-bottom: 0;
    border-radius: 22px;
  }
  .app.nova-split #lesson.lesson-nova-open {
    width: 100%;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    padding-right: 0;
    gap: 0;
  }
  .app.nova-split #lesson.lesson-nova-open > .dialog-header {
    grid-column: 1;
    padding: 12px 28px;
  }
  .app.nova-split #lesson.lesson-nova-open .dialog-body {
    grid-column: 1;
    width: 100%;
    padding: 25px 28px 40px;
    margin: 0;
    max-width: none;
  }
  .app.nova-split .topbar {
    z-index: 7;
  }
  .app.nova-split.nova-expanded {
    grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
  }
  .app.nova-split.nova-expanded.collapsed {
    grid-template-columns: var(--sidebar-width-collapsed) minmax(0, 1fr);
  }
  .app.nova-expanded > .main {
    display: none;
  }
  .app.nova-expanded > #nova-panel {
    grid-column: 2;
  }
  .app.nova-expanded #nova-panel .chat-messages {
    padding-inline: max(22px, calc((100% - 650px) / 2));
  }
  .app.nova-expanded #nova-panel .nova-magma,
  .app.nova-expanded #nova-panel .chat-form {
    width: calc(100% - 40px);
    max-width: 650px;
    margin-left: auto;
    margin-right: auto;
  }
}

@media (min-width: 761px) and (max-width: 1100px) {
  .app.nova-split {
    grid-template-columns: 190px minmax(0, 1fr) var(--nova-w, 305px);
  }
  .app.nova-split.collapsed {
    grid-template-columns: var(--sidebar-width-collapsed) minmax(0, 1fr) var(
    --nova-w,
    305px
    );
  }
  .app.nova-split.nova-expanded {
    grid-template-columns: 190px minmax(0, 1fr);
  }
}

@media (max-width: 760px) {
  .app > #nova-panel {
    position: fixed;
    inset: calc(8px + env(safe-area-inset-top, 0px)) 8px
    calc(8px + env(safe-area-inset-bottom, 0px));
    width: auto;
    height: auto;
    border: 4px solid var(--color-sidebar);
    border-radius: 24px;
    z-index: 40;
    box-shadow: 0 0 0 100vmax #0005;
  }
  .app #expand-nova {
    display: none;
  }
  #nova-panel .chat-form input {
    font-size: 16px;
  }
}

@media print {
  .app > #nova-panel {
    display: none !important;
  }
}

#messages:has(.nova-output-frame) {
  padding: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-height: 0;
}

.nova-output-frame {
  flex: 1;
  min-height: 0;
  width: 100%;
  height: 100%;
  border: 0;
  background: #fff;
}

@scope (body[data-design]) {
  .nova-frame {
    display: flex;
    flex: 1;
    flex-direction: column;
    min-height: 0;
  }
  .nova-request-form {
    padding: 14px 18px;
    border-top: 1px solid var(--color-line);
    font-size: 12px;
  }
  .nova-request-form label {
    display: block;
    margin: 6px 0;
  }
  .nova-request-form > .btn {
    margin-top: 10px;
  }
  .nova-request-form details {
    margin-top: 12px;
  }
  .nova-request-form textarea {
    width: 100%;
    font: inherit;
  }
  .nova-magma > img {
    width: 70px;
    height: 70px;
    image-rendering: pixelated;
    object-fit: contain;
  }
  .nova-selected-passage {
    margin: 12px 0;
    padding: 10px;
    border-left: 2px solid var(--color-line);
    color: var(--color-muted);
    font-size: 11px;
  }
  .app.nova-split #lesson-context {
    display: none;
  }
  .nova-panel article {
    margin-bottom: 16px;
  }
  .nova-panel .message p {
    margin-top: 8px;
  }
  @media (max-width: 640px) {
    .field input,
    .field select,
    .field textarea,
    .nova-request-form textarea {
      font-size: 16px;
    }
  }
  @media print {
    .lesson-tools,
    .lesson-practice form,
    .lesson-completion,
    .nova-panel,
    .lesson-modes,
    .design-site-header,
    .design-site-footer {
      display: none !important;
    }
  }
  .nova-magma {
    display: flex;
    align-items: center;
    gap: 10px;
    color: white;
    padding: 14px !important;
  }
  .nova-magma h2 {
    font-size: 13px;
  }
  .nova-magma p {
    font-size: 11px;
    margin-top: 8px;
    line-height: 1.6;
  }
  .mobile-nova-action {
    display: none;
  }
  @media (max-width: 760px) {
    .mobile-nova-action {
      display: inline-flex;
    }
  }
  .sample-lesson-sidebar.nova-panel {
    position: static;
    inset: auto;
    width: auto;
    height: auto;
    max-height: none;
    min-height: 0;
    padding: 20px;
    border: 1px solid var(--color-line);
    border-radius: 16px;
    align-self: start;
    line-height: 1.7;
  }
  @media (max-width: 760px) {
    .sample-lesson-sidebar.nova-panel {
      position: static;
      inset: auto;
    }
    .app #nova-panel #expand-nova {
      display: none;
    }
  }
}

.app #lesson > .lesson-frame > .dialog-body,
.app #lesson.lesson-nova-open > .lesson-frame > .dialog-body {
  grid-row: 1;
  padding-top: 12px;
}

/* Nova */
/* One lesson conversation, presented beside the reader or above the quick-reply bar. */
.app:has(> #nova-panel) {
  --nova-width: 380px;
}

.app:has(> #nova-panel) > .main {
  overflow-anchor: none;
}

.nova-bar {
  bottom: calc(var(--app-inset, 20px) + 26px);
  width: min(390px, calc(100% - 48px));
  height: 48px;
}

.app.nova-split .nova-bar,
.app.nova-quick .nova-bar {
  display: none;
}

.app > #nova-panel {
  border-radius: 28px;
}

#nova-panel > .dialog-header {
  padding: 18px 20px 16px;
  gap: 6px;
}

#nova-conversation-title {
  font-size: 14px;
  font-weight: 550;
  letter-spacing: -0.15px;
}

#nova-panel .dialog-header .icon-button {
  width: 30px;
  height: 30px;
  border: 0;
  box-shadow: none;
  background: transparent;
  color: #292929;
}

#nova-panel .dialog-header .icon-button:hover {
  background: #f5f5f5;
}

#nova-panel .nova-frame {
  overflow: hidden;
}

#nova-panel .nova-magma {
  display: block;
  max-height: 32%;
  overflow: auto;
  margin: 0 15px 24px;
  padding: 4px;
  border-radius: 23px;
  background:
  radial-gradient(ellipse at 8% 0%, #f88eea 0%, transparent 48%),
  radial-gradient(ellipse at 37% 0%, #f43cd4 0%, transparent 52%),
  linear-gradient(116deg, #ff648b 14%, #ff7900 66%, #ff9400);
  box-shadow: 0 3px 5px #00000010;
}

#nova-panel .nova-magma > header {
  padding: 10px 13px 12px;
  font-size: 13px;
  align-items: center;
}

#nova-panel .nova-magma > header strong {
  font-weight: 550;
}

#nova-panel .nova-magma > header > span {
  font-size: 11px;
  color: white;
}

#nova-panel .nova-task-list {
  padding: 4px 8px;
  border-radius: 19px;
  background: white;
}

#nova-panel .nova-task {
  gap: 10px;
  padding: 9px 5px;
  min-height: 40px;
  font-size: 13px;
  line-height: 1.5;
  color: #292929;
}

#nova-panel .task-circle {
  width: 15px;
  height: 15px;
  border-color: #9873e7;
}

#nova-panel .nova-task > svg {
  color: #999;
  flex-shrink: 0;
}

#nova-panel .chat-messages {
  padding: 0 20px 24px;
}

#nova-panel .nova-welcome {
  font-size: 14px;
  line-height: 1.7;
  margin: 0 0 22px;
  color: #292929;
}

#nova-panel .chat-messages article {
  display: flow-root;
  margin: 0 0 22px;
}

#nova-panel .message {
  font-size: 14px;
  line-height: 1.65;
  margin-bottom: 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

#nova-panel .message.user {
  width: fit-content;
  max-width: 88%;
  margin: 0 0 20px auto;
  padding: 10px 14px;
  border-radius: 22px;
  background: #f6f6f6;
  color: #262626;
}

#nova-panel .message:not(.user) {
  padding: 0;
  background: transparent;
}

#nova-panel .message p {
  margin-top: 0;
}

#nova-panel .nova-working {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #888;
  font-size: 13px;
}

#nova-panel .nova-suggestions {
  gap: 6px;
  margin-top: 20px;
}

#nova-panel .nova-suggestions button {
  padding: 7px 11px;
  font-size: 11px;
  min-height: 32px;
}

#nova-panel .nova-request-form {
  position: relative;
  margin: 0 20px;
  padding: 14px 0 16px;
  flex-shrink: 0;
  background: white;
  border-top: 1px solid #e6e6e6;
}

#nova-panel .nova-composer {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 32px;
}

#nova-panel .nova-composer > img {
  width: 26px;
  height: 26px;
  object-fit: contain;
  image-rendering: pixelated;
  flex-shrink: 0;
}

#nova-panel .nova-composer textarea {
  border: 0;
  background: transparent;
  resize: none;
  height: 38px;
  max-height: 140px;
  padding: 8px 0;
  line-height: 1.5;
  font-size: 14px;
  flex: 1;
  min-width: 0;
  border-radius: 0;
}

#nova-panel .nova-composer textarea:focus-visible {
  outline: 0;
}

#nova-panel .nova-request-form:focus-within {
  border-top-color: #b8a4dc;
}

#nova-panel .nova-composer > .icon-button {
  padding: 5px;
  width: 29px;
  height: 32px;
  flex-shrink: 0;
  color: #6e6e6e;
}

.nova-sr-only {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.app.nova-expanded #nova-panel .nova-request-form {
  width: calc(100% - 40px);
  max-width: 650px;
  margin-inline: auto;
}

@media (min-width: 761px) {
  /* Expose the black shell between the two rounded white panels. */
  .app-page > .app.nova-split {
    column-gap: 4px;
  }
  .app.nova-quick > #nova-panel {
    position: fixed;
    left: calc(50% + var(--sidebar-width) / 2 - 125px);
    transform: translateX(-50%);
    top: auto;
    right: auto;
    bottom: calc(var(--app-inset, 20px) + 26px);
    width: min(460px, calc(100vw - var(--sidebar-width) - 64px));
    height: min(500px, calc(100dvh - 130px));
    border: 1px solid var(--color-line);
    box-shadow: 0 8px 40px #00000014;
    z-index: 10;
  }
  .app.nova-quick.collapsed > #nova-panel {
    left: calc(50% + var(--sidebar-width-collapsed) / 2 - 125px);
  }
  .app.nova-quick #nova-panel .nova-magma,
  .app.nova-quick .nova-resize {
    display: none;
  }
  .app.nova-quick #lesson-context {
    display: block;
  }
}

@media (max-width: 760px) {
  .nova-bar,
  .app.collapsed .nova-bar {
    left: 50%;
    bottom: calc(94px + env(safe-area-inset-bottom, 0px));
    width: calc(100% - 40px);
    max-width: 390px;
  }
  #nova-panel .nova-composer textarea {
    font-size: 16px;
  }
  #nova-panel .nova-task {
    min-height: 44px;
  }
  #nova-panel .dialog-header .icon-button {
    width: 36px;
    height: 36px;
  }
  #nova-panel .nova-expand {
    display: none;
  }
  .app.nova-split,
  .app.nova-split.collapsed {
    grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
  }
}

@media (max-width: 640px) {
  .app.nova-split,
  .app.nova-split.collapsed {
    display: block;
  }
}

@media print {
  .nova-bar {
    display: none !important;
  }
}

/* Selection actions stay beside the passage until the student chooses to ask. */
.nova-selection-prompt {
  position: fixed;
  z-index: 55;
  width: max-content;
  max-width: calc(100vw - 24px);
}

.nova-selection-prompt[hidden] {
  display: none;
}

.nova-selection-prompt > button {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 7px 12px;
  border: 1px solid #e4e0ea;
  border-radius: 12px;
  background: white;
  color: #29252e;
  box-shadow: 0 4px 18px #24173624;
  font-size: 12px;
  font-weight: 550;
}

.nova-selection-prompt > button:hover {
  background: #f8f5fc;
}

.nova-selection-prompt img {
  object-fit: contain;
  image-rendering: pixelated;
}

.nova-selection-prompt svg {
  margin-left: 4px;
  color: #82738f;
}

::highlight(nova-passage) {
  background: #e8e8e8;
  color: var(--color-text);
}

#nova-panel .nova-selected-passage {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 0 0 14px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--color-muted);
}

#nova-panel .nova-selected-passage[hidden] {
  display: none;
}

#nova-panel .nova-selected-passage .icon-button {
  flex-shrink: 0;
  padding: 4px;
  margin-top: -3px;
  color: var(--color-muted);
}

#nova-panel .nova-selected-passage blockquote {
  flex: 1;
  min-width: 0;
  max-height: 96px;
  overflow: auto;
  margin: 0;
  padding-left: 12px;
  border-left: 2px solid #d9d9d9;
  font-size: 12px;
  line-height: 1.65;
  white-space: pre-wrap;
}

#nova-panel .nova-message-passage {
  max-width: 88%;
  margin: 0 0 10px auto;
  padding: 0 0 0 12px;
  border-left: 2px solid #d9d9d9;
  border-radius: 0;
  background: transparent;
  color: var(--color-muted);
  font-size: 12px;
  line-height: 1.65;
  max-height: 130px;
  overflow: auto;
  white-space: pre-wrap;
}

.nova-help-action {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  padding: 6px 0;
  border: 0;
  background: transparent;
  color: #333;
  text-align: left;
  font-size: 12px;
  font-weight: 550;
}

.nova-help-action > span {
  flex: 1;
}

.nova-help-action > img {
  object-fit: contain;
  image-rendering: pixelated;
}

.nova-help-action > svg {
  color: #999;
}

.nova-help-action:hover > span {
  color: #7854a7;
}

#lesson-context .nova-help-section > p {
  margin: 7px 0 0;
  font-size: 11px;
  line-height: 1.6;
  color: #929292;
}

@media print {
  .nova-selection-prompt {
    display: none !important;
  }
}

/* A centered arrow and a clear circular target make sending easy to spot. */
.nova-bar button[type="submit"],
#nova-panel .nova-composer > button[type="submit"] {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  padding: 6px;
  border-radius: 50%;
  transition:
  background var(--motion-ui),
  transform var(--motion-press);
}

#nova-panel .nova-composer > button[type="submit"] {
  background: var(--color-action);
  color: var(--color-surface);
}

#nova-panel .nova-composer > button[type="submit"]:hover {
  background: var(--color-action-hover);
}

.nova-bar button[type="submit"]:hover {
  background: #ededed;
}

.nova-bar button[type="submit"]:active,
#nova-panel .nova-composer > button[type="submit"]:active {
  transform: scale(0.94);
}

.nova-bar button[type="submit"]:focus-visible,
#nova-panel .nova-composer > button[type="submit"]:focus-visible {
  outline: 2px solid var(--color-focus);
  outline-offset: 3px;
}
