#saved-chat-sidebar,
#chat-topic-header {
  display: none;
}
body.has-chat-sidebar:has(#practice:not([hidden]) #interaction:not([hidden])) {
  --chat-sidebar-width: var(--saved-sidebar-preferred-width, 244px);
}
body.has-chat-sidebar:has(#practice:not([hidden]) #interaction:not([hidden]))
  :is(.page-language-bar, .header, main, footer) {
  margin-left: var(--chat-sidebar-width) !important;
  width: calc(100% - var(--chat-sidebar-width)) !important;
  max-width: none;
}
body.has-chat-sidebar:has(#practice:not([hidden]) #interaction:not([hidden])) #saved-chat-sidebar {
  display: flex;
  flex-direction: column;
  gap: 14px;
  position: fixed;
  z-index: 60;
  left: 0;
  top: 0;
  bottom: 0;
  width: var(--chat-sidebar-width);
  padding: 20px 14px 12px;
  background: #edf3fc;
  color: #05274f;
  border-right: 1px solid #cad7e9;
}
.saved-chat-brand {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.saved-chat-brand img {
  width: 126px;
  height: 53px;
  object-fit: contain;
  padding: 5px 9px;
  background: #f7faff;
  border-radius: 8px;
}
#collapse-chat-sidebar,
#open-chat-sidebar {
  padding: 8px;
  width: 36px;
  height: 36px;
  min-height: 36px;
  border: 0;
  border-radius: 8px;
  color: var(--blue);
  background: transparent;
}
#new-saved-chat {
  display: flex;
  gap: 8px;
  align-items: center;
  width: 100%;
  padding: 11px 12px;
  text-align: left;
  border: 0;
  border-radius: 10px;
  color: #005bea;
  background: #dce9ff;
  font: inherit;
  font-weight: 600;
}
#new-saved-chat span:first-child {
  font-size: 21px;
  line-height: 1;
}
#saved-chat-list {
  flex: 1;
  min-height: 0;
  overflow-y: scroll;
  overflow-x: hidden;
  scrollbar-gutter: stable;
  padding-right: 4px;
}
.saved-chat-date {
  color: #52657d;
  font-size: 12px;
  margin: 16px 10px 7px;
}
.saved-chat-row {
  display: flex;
  position: relative;
  align-items: center;
  border-radius: 9px;
  margin: 3px 0;
}
.saved-chat-row.active {
  background: #dce9ff;
}
.saved-chat-row.active::before {
  content: '';
  position: absolute;
  left: 0;
  width: 3px;
  height: 20px;
  background: var(--blue);
  border-radius: 3px;
}
.saved-chat-row button {
  color: inherit;
  background: transparent;
  border: 0;
  border-radius: 8px;
  cursor: pointer;
  font: inherit;
}
.saved-chat-select {
  flex: 1;
  min-width: 0;
  padding: 11px 10px;
  text-align: start;
  overflow-wrap: anywhere;
  line-height: 1.4;
  font-size: 13px !important;
}
.saved-chat-more {
  flex: none;
  width: 30px;
  padding: 7px 4px;
  font-size: 20px !important;
}
.saved-chat-row:hover {
  background: #e0e9f6;
}
.saved-chat-settings {
  border-top: 1px solid #cad7e9;
  padding-top: 10px;
}
.saved-chat-settings .check {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  margin: 4px 0;
  font-size: 12px;
}
.saved-chat-settings input {
  flex: none;
  margin: 3px 0 0;
  accent-color: #005bea;
}
.saved-chat-settings .fine {
  margin: 6px 0;
  font-size: 11px !important;
  line-height: 1.4;
  color: #52657d;
}
#saved-chat-status:empty {
  display: none;
}
#sidebar-learner-profile {
  margin-top: 4px;
  padding: 6px 0;
  font-size: 13px;
}
body.has-chat-sidebar:has(#practice:not([hidden]) #interaction:not([hidden])) .header .brand {
  display: none;
}
body.has-chat-sidebar:has(#practice:not([hidden]) #interaction:not([hidden])) #chat-topic-header {
  display: flex;
  gap: 10px;
  align-items: center;
  min-width: 0;
  flex: 1;
}
#active-chat-title {
  font-size: 16px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
  overflow: hidden;
  min-width: 0;
}
#open-chat-sidebar {
  display: none;
  flex: none;
}
body.has-chat-sidebar:has(#practice:not([hidden]) #interaction:not([hidden])) .header {
  gap: 16px;
  padding-left: 24px !important;
  padding-right: 24px !important;
}
body.has-chat-sidebar:has(#practice:not([hidden]) #interaction:not([hidden])) #practice {
  padding-left: 24px !important;
  padding-right: 24px !important;
}
body.has-chat-sidebar:has(#practice:not([hidden]) #interaction:not([hidden])) footer {
  padding-left: 24px !important;
  padding-right: 24px !important;
  font-size: 12px;
}
.learner-level-profile {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
#learner-level {
  font-size: 13px;
  color: var(--ink);
  white-space: nowrap;
}
body:not(:has(#interaction:not([hidden]))) #learner-level {
  display: none;
}
body.chat-sidebar-collapsed.has-chat-sidebar:has(
    #practice:not([hidden]) #interaction:not([hidden])
  ) {
  --chat-sidebar-width: 0px;
}
body.chat-sidebar-collapsed #saved-chat-sidebar {
  visibility: hidden;
  overflow: hidden;
}
body.chat-sidebar-collapsed #open-chat-sidebar {
  display: inline-flex;
}
#saved-chat-dialog {
  width: min(380px, 90vw);
  padding: 22px;
  border-radius: 16px;
}
#saved-chat-dialog h2 {
  margin-top: 0;
  font-size: 20px;
}
#saved-chat-dialog input {
  width: 100%;
  margin-top: 8px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font: inherit;
}
.saved-chat-dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 20px;
}
.saved-chat-dialog-actions button {
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font: inherit;
  cursor: pointer;
}
#delete-saved-chat {
  color: #b33434;
  margin-right: auto;
}
html[data-theme='dark'] body.has-chat-sidebar #saved-chat-sidebar {
  background: #0c1623;
  color: #edf4ff;
  border-color: #374c66;
}
html[data-theme='dark'] #new-saved-chat,
html[data-theme='dark'] .saved-chat-row.active {
  background: #1d3558;
  color: #edf4ff;
}
html[data-theme='dark'] #new-saved-chat {
  color: #8dbbff;
}
html[data-theme='dark'] .saved-chat-row:hover {
  background: #1c2c42;
}
html[data-theme='dark'] :is(.saved-chat-date, .saved-chat-settings .fine) {
  color: #aabdd5;
}
html[data-theme='dark'] .saved-chat-settings {
  border-color: #374c66;
}
html[data-theme='dark'] #delete-saved-chat {
  color: #ff9a89;
}
@media (max-width: 1000px) and (min-width: 701px) {
  body.has-chat-sidebar:has(#practice:not([hidden]) #interaction:not([hidden])) {
    --chat-sidebar-width: var(--saved-sidebar-preferred-width, 218px);
  }
  body.chat-sidebar-collapsed.has-chat-sidebar:has(
      #practice:not([hidden]) #interaction:not([hidden])
    ) {
    --chat-sidebar-width: 0px;
  }
  body.has-chat-sidebar:has(#practice:not([hidden]) #interaction:not([hidden])) #practice {
    padding-left: 14px !important;
    padding-right: 14px !important;
  }
  body.has-chat-sidebar .header-right {
    gap: 8px;
  }
  body.has-chat-sidebar .header .pill {
    display: none;
  }
}
@media (max-width: 700px) {
  body.has-chat-sidebar:has(#practice:not([hidden]) #interaction:not([hidden]))
    :is(.page-language-bar, .header, main, footer) {
    margin-left: 0 !important;
    width: 100% !important;
  }
  body.has-chat-sidebar:has(#practice:not([hidden]) #interaction:not([hidden]))
    #saved-chat-sidebar {
    width: var(--saved-sidebar-preferred-width, 244px);
    max-width: calc(100vw - 24px);
    box-shadow: 8px 0 30px #0004;
  }
  body.chat-sidebar-collapsed #saved-chat-sidebar {
    transform: translateX(-100%);
  }
  #open-chat-sidebar {
    display: inline-flex;
  }
  body.has-chat-sidebar:has(#practice:not([hidden]) #interaction:not([hidden])) .header {
    padding-left: 10px !important;
    padding-right: 10px !important;
  }
  body.has-chat-sidebar:has(#practice:not([hidden]) #interaction:not([hidden])) #practice {
    padding-left: 10px !important;
    padding-right: 10px !important;
  }
  body.has-chat-sidebar .header .pill {
    display: none;
  }
  body.has-chat-sidebar .header-right {
    gap: 5px;
  }
  body.has-chat-sidebar .header #logout {
    min-height: 38px;
    padding: 7px;
    font-size: 12px;
  }
  body.has-chat-sidebar .header #logout svg {
    display: none;
  }
  #active-chat-title {
    font-size: 14px;
  }
}
/* Match the accepted sidebar concept while keeping the live controls. */
body.has-chat-sidebar:has(#practice:not([hidden]) #interaction:not([hidden])) .header {
  min-height: 76px;
  padding-block: 12px !important;
}
body.has-chat-sidebar:has(#practice:not([hidden]) #interaction:not([hidden])) .header-right {
  gap: 9px;
  flex-wrap: nowrap;
}
body.has-chat-sidebar:has(#practice:not([hidden]) #interaction:not([hidden]))
  .header
  .page-language-bar {
  margin: 0 !important;
  width: auto !important;
  display: flex;
  gap: 7px;
  padding: 0;
  background: transparent;
  border: 0;
}
body.has-chat-sidebar:has(#practice:not([hidden]) #interaction:not([hidden]))
  .header
  .page-language-bar
  label {
  font-size: 12px;
  font-weight: 400;
  white-space: nowrap;
  margin: 0;
}
body.has-chat-sidebar .header .page-language-bar label svg {
  display: block;
}
body.has-chat-sidebar .header .page-language-bar select {
  width: 90px;
  min-height: 30px;
  padding: 3px 5px;
  font-size: 12px;
  border: 0;
  background: transparent;
}
body.has-chat-sidebar .header .pill {
  font-size: 10px;
  padding: 6px 8px;
}
body.has-chat-sidebar .header #logout {
  min-height: 40px;
  padding: 8px 12px;
  font-size: 13px;
  gap: 7px;
}
body.has-chat-sidebar .header .profile-icon-button {
  width: 28px;
  min-height: 32px;
  padding: 3px;
}
.chat-topic-copy {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
#active-chat-subtitle {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}
#active-chat-title {
  display: block;
}
body.has-chat-sidebar #practice .practice-header-tools {
  gap: 14px;
  font-size: 12px;
}
body.has-chat-sidebar #practice #learner-level {
  font-size: var(--chat-control-font-size, 13px);
}
body.has-chat-sidebar #practice #practice-clock {
  font-size: 12px;
}
body.has-chat-sidebar #practice .practice-header-tools svg {
  width: 17px;
  height: 17px;
}
body.has-chat-sidebar #practice #chat-messages {
  gap: 12px;
}
body.has-chat-sidebar #practice .chat-message {
  font-size: 14px;
  line-height: 1.5;
  padding: 10px 12px;
}
body.has-chat-sidebar
  #practice
  :is(#speaking-mode-menu > summary, #session-tools > summary, #homework-tools > summary) {
  font-size: 13px;
}
body.has-chat-sidebar #practice #understand-help button {
  min-height: 32px;
  padding: 6px 9px;
  font-size: 12px;
}
body.has-chat-sidebar #practice #toggle-ideas {
  font-size: 14px;
  min-height: 38px;
}
body.has-chat-sidebar #practice #answer {
  font-size: 14px;
}
body.has-chat-sidebar #practice #bilingual-support + span {
  font-size: 12px;
}
body.has-chat-sidebar #practice #composer-options > summary {
  font-size: 12px;
}
@media (max-width: 850px) {
  body.has-chat-sidebar .header .page-language-bar select {
    width: 72px;
  }
}
@media (max-width: 700px) {
  body.has-chat-sidebar:has(#practice:not([hidden]) #interaction:not([hidden])) .header {
    gap: 7px;
  }
  body.has-chat-sidebar .header-right {
    gap: 3px !important;
  }
}
body.has-chat-sidebar .header .page-language-bar select {
  width: 90px !important;
}
body.has-chat-sidebar .header-right {
  flex: none;
  min-width: 0;
}
#saved-chat-sidebar button {
  background: transparent;
  border: 0;
  color: inherit;
}
#saved-chat-sidebar #new-saved-chat {
  background: #dce9ff;
  color: #005bea;
}
html[data-theme='dark'] #saved-chat-sidebar {
  background: #0e1722 !important;
  color: #edf4ff !important;
  border-color: #344256 !important;
}
html[data-theme='dark'] #saved-chat-sidebar #new-saved-chat {
  background: #1d3558;
  color: #8dbbff;
}
html[data-theme='dark'] #saved-chat-sidebar .saved-chat-row.active {
  background: #1d3558;
}
html[data-theme='dark'] #saved-chat-sidebar :is(.saved-chat-date, .fine) {
  color: #b6c6dc;
}
#sidebar-learner-profile {
  display: flex;
  width: 100%;
  align-items: center;
  gap: 9px;
  text-align: start;
  text-decoration: none;
}
body.has-chat-sidebar #practice #chat-messages .chat-message {
  padding: 10px 12px;
  font-size: 14px;
  max-width: 75%;
}
@media (max-width: 700px) {
  body.has-chat-sidebar .header .page-language-bar select {
    width: 65px !important;
  }
}
body.has-chat-sidebar .header #logout {
  white-space: nowrap;
  flex-shrink: 0;
}
@media (max-width: 700px) {
  body.has-chat-sidebar:has(#practice:not([hidden]) #interaction:not([hidden])) .header {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 5px;
    padding-block: 6px !important;
  }
  body.has-chat-sidebar #chat-topic-header {
    width: 100%;
  }
  body.has-chat-sidebar .chat-topic-copy {
    flex: 1;
  }
  body.has-chat-sidebar #active-chat-subtitle {
    display: none;
  }
  body.has-chat-sidebar .header-right {
    justify-content: flex-end;
    width: 100%;
    gap: 8px !important;
  }
  body.has-chat-sidebar .header .page-language-bar {
    margin-right: auto !important;
  }
  body.has-chat-sidebar .header #logout {
    min-height: 32px;
    padding: 5px 9px;
  }
  body.has-chat-sidebar #practice #chat-messages .chat-message {
    max-width: 88%;
  }
}
body.has-chat-sidebar:has(#practice:not([hidden]) #interaction:not([hidden])) .header-right {
  width: max-content !important;
}
body.has-chat-sidebar:has(#practice:not([hidden]) #interaction:not([hidden]))
  .header
  .page-language-bar {
  padding: 0 !important;
}
@media (max-width: 700px) {
  body.has-chat-sidebar:has(#practice:not([hidden]) #interaction:not([hidden])) .header-right {
    width: 100% !important;
  }
}

/* Keep the history rail visible and the resize grip distinct from scrolling. */
#saved-chat-list::-webkit-scrollbar {
  width: 10px;
  display: block;
}
#saved-chat-list::-webkit-scrollbar-track {
  background: #d7e2f1;
  border-radius: 8px;
}
#saved-chat-list::-webkit-scrollbar-thumb {
  background: #8198b6;
  border: 2px solid #d7e2f1;
  border-radius: 8px;
}
#saved-chat-list::-webkit-scrollbar-thumb:hover {
  background: #526d93;
}
html[data-theme='dark'] #saved-chat-list::-webkit-scrollbar-track {
  background: #1d2c40;
}
html[data-theme='dark'] #saved-chat-list::-webkit-scrollbar-thumb {
  background: #829bbd;
  border-color: #1d2c40;
}
@supports not selector(::-webkit-scrollbar) {
  #saved-chat-list {
    scrollbar-width: auto;
    scrollbar-color: #8198b6 #d7e2f1;
  }
}
.saved-chat-brand,
#new-saved-chat,
.saved-chat-settings {
  flex-shrink: 0;
}
#resize-chat-sidebar {
  position: absolute;
  z-index: 2;
  right: -5px;
  top: 0;
  bottom: 0;
  width: 10px;
  cursor: col-resize;
  touch-action: none;
}
#resize-chat-sidebar::after {
  content: '';
  position: absolute;
  right: 4px;
  top: calc(50% - 22px);
  height: 44px;
  width: 3px;
  border-radius: 4px;
  background: #8198b6;
}
#resize-chat-sidebar:hover::after,
#resize-chat-sidebar:focus-visible::after,
body.resizing-chat-sidebar #resize-chat-sidebar::after {
  background: var(--blue);
  width: 4px;
}
body.resizing-chat-sidebar,
body.resizing-chat-sidebar * {
  cursor: col-resize !important;
  user-select: none !important;
}

.page-language-bar label {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
}
.page-language-label {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}
#add-material-menu {
  position: fixed;
  z-index: 100;
  width: min(272px, calc(100vw - 16px));
  padding: 6px;
  background: #f7faff;
  color: #05274f;
  border: 1px solid #cad7e9;
  border-radius: 12px;
  box-shadow: 0 8px 30px #071c3929;
}
#add-material-menu button {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 11px 10px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: inherit;
  text-align: start;
  font-size: 14px;
}
#add-material-menu button svg {
  flex: none;
  color: #005bea;
}
#add-material-menu button:hover,
#add-material-menu button:focus-visible {
  background: #e0ebfc;
}
#add-material-dialog {
  width: min(580px, calc(100vw - 24px));
  padding: 22px;
  border-radius: 16px;
}
#add-material-dialog h2 {
  font-size: 22px;
  margin-bottom: 18px;
}
#add-material-dialog label {
  font-weight: 600;
}
#add-material-dialog input {
  width: 100%;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: var(--cream);
}
#add-material-dialog textarea {
  min-height: 160px;
  max-height: 40dvh;
  resize: vertical;
}
#add-material-dialog .fine {
  font-size: 13px;
  line-height: 1.5;
  margin: 10px 0;
}
.material-dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 9px;
  margin-top: 18px;
}
html[data-theme='dark'] #add-material-menu {
  background: #17263b;
  color: #edf4ff;
  border-color: #71849e;
}
html[data-theme='dark'] #add-material-menu button {
  background: transparent;
  color: #edf4ff;
}
html[data-theme='dark'] #add-material-menu button svg {
  color: #8dbbff;
}
html[data-theme='dark'] #add-material-menu button:hover,
html[data-theme='dark'] #add-material-menu button:focus-visible {
  background: #263d5c;
}
#practice #attachment-chip {
  padding: 6px 8px;
  margin-top: 4px;
  font-size: 13px;
}
#practice #attachment-chip button {
  min-height: 30px;
  padding: 4px 8px;
  font-size: 13px;
}
#practice #attachment-chip:not([hidden]) + #homework-status {
  font-size: 13px;
  line-height: 1.4;
  margin: 4px 0;
}

#practice .menu-label-icon {
  width: 18px;
  height: 18px;
  margin-inline-end: 5px;
  color: var(--blue);
}
#practice .bilingual-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
#practice .bilingual-label .ui-icon {
  width: 18px;
  height: 18px;
  flex-basis: 18px;
  color: var(--blue);
}

#practice .practice-header-tools #edit-setup.learner-profile-trigger {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  width: auto;
  min-width: 0;
  padding: 3px 5px;
  text-decoration: none;
}
#practice .practice-header-tools #edit-setup.learner-profile-trigger:hover {
  background: color-mix(in srgb, var(--blue) 10%, transparent);
}

#learner-profile-dialog {
  width: min(380px, calc(100vw - 24px));
  max-height: calc(100dvh - 32px);
  overflow: auto;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 16px;
}
#learner-profile-dialog::backdrop {
  background: #0006;
}
#learner-profile-dialog h2 {
  font-size: 22px;
  margin: 0 0 18px;
}
#learner-profile-dialog label {
  margin: 12px 0 6px;
  font-size: 14px;
}
#learner-profile-dialog select {
  padding: 9px 10px;
  font-size: 14px;
}
.learner-profile-actions {
  display: flex;
  justify-content: flex-end;
  gap: 9px;
  margin-top: 22px;
}
.learner-profile-actions button {
  min-height: 38px;
  padding: 8px 13px;
  font-size: 14px;
}

#practice #chat-box .composer-input-shell {
  position: relative;
  min-width: 0;
  grid-column: 1;
  grid-row: 1;
}
.composer-keyboard-icon {
  display: none;
  position: absolute;
  inset-inline-start: 12px;
  top: 12px;
  z-index: 1;
  color: var(--muted);
  pointer-events: none;
}
.composer-input-shell:has(> #answer:placeholder-shown) > .composer-keyboard-icon {
  display: block;
}
#practice #chat-box #answer:placeholder-shown {
  text-indent: 26px;
}

/* Keep everyday reply supports together; expanded voice controls flow below. */
#practice #chat-box .composer-support-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 16px;
  grid-column: 1 / -1;
  margin-top: 4px;
}
#practice #chat-box .composer-support-row .understand-actions {
  margin: 0;
  gap: 6px;
}
#practice #chat-box .composer-support-row > .check {
  margin: 0;
}
#practice #chat-box .composer-support-row > #composer-options {
  display: block;
  margin: 0 !important;
}
#practice #chat-box .composer-support-row > #composer-options > summary {
  margin: 0;
  white-space: nowrap;
}
#practice #chat-box #voice-options-panel {
  grid-column: 1 / -1;
  min-width: 0;
}
#practice #chat-box #voice-options-panel[hidden] {
  display: none;
}
body.has-chat-sidebar #practice .composer-support-row .understand-actions button {
  min-height: 32px;
  padding: 6px 9px;
  font-size: 12px;
}

.chat-empty-state .conversation-start-icon {
  display: block;
  width: 72px;
  height: 72px;
  padding: 8px;
  margin: 0 auto 12px;
  background: transparent;
  overflow: hidden;
}

/* Composer actions sit inside its lower-right edge, with Send nearest the text. */
#practice #chat-box .composer-input-shell {
  grid-column: 1 / -1;
}
#practice #chat-box .composer-input-shell > .composer-actions {
  position: absolute;
  right: 20px;
  bottom: 10px;
  margin: 0 !important;
  padding: 0;
  float: none;
}
body:has(
    #practice:not([hidden]) #interaction:not(.talk-mode):not([hidden]) #chat-panel:not([hidden])
  )
  #practice
  #interaction:not(.talk-mode)
  #chat-box
  #practice-form
  .composer-input-shell
  > #answer {
  height: calc(144px - 2lh);
  min-height: calc(144px - 2lh);
  padding-bottom: 60px !important;
}

.chat-topic-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
#new-chat-heading-icon {
  flex: none;
  color: var(--coral);
}
#new-chat-heading-icon[hidden] {
  display: none;
}

/* Keep the original blue/coral artwork; lift only navy details on dark surfaces. */
html[data-theme='dark'] .conversation-start-art {
  filter: url(#chat-logo-dark-contrast);
}

.conversation-info-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.conversation-info-heading h2 {
  margin: 0;
}
#close-conversation-info {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: none;
}
#conversation-transcript {
  background: var(--cream);
  color: var(--ink);
}

.understand-actions > button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
}
.reply-support-icon {
  flex: none;
  width: 16px;
  height: 16px;
}
/* Keep reply-support labels and icons readable, including before a reply exists. */
#practice .composer-support-row .understand-actions > button {
  opacity: 1;
  filter: none;
  color: var(--blue);
  border-color: var(--line);
}

#sidebar-learner-profile > .ui-icon {
  width: 18px;
  height: 18px;
  flex: none;
  color: var(--blue);
}
/* A shared size keeps everyday chat and sidebar controls consistent. */
body.has-chat-sidebar {
  --chat-control-font-size: 13px;
}
body.has-chat-sidebar
  :is(
    #help-simpler,
    #help-language,
    #help-example,
    #bilingual-support + span,
    #composer-options > summary,
    #homework-tools > summary,
    #session-tools > summary,
    #speaking-mode-menu > summary,
    #learning-subject,
    #toggle-ideas,
    #logout,
    #new-saved-chat,
    .saved-chat-select,
    .saved-chat-settings .check,
    #sidebar-learner-profile
  ) {
  font-size: var(--chat-control-font-size) !important;
}
/* Small coral details echo ELVI's two-color logo while keeping blue outlines. */
#session-tools > summary .ui-icon > path:nth-of-type(2),
#hear-reply svg > path[fill='none'] {
  stroke: var(--coral);
}

/* Learner-profile marks use one consistent coral stroke. */
:is(#edit-setup, #sidebar-learner-profile) > .ui-icon {
  color: var(--coral);
  stroke: var(--coral);
}
#practice-clock > .ui-icon {
  color: var(--blue);
}
#homework-tools > summary .ui-icon,
.page-language-bar label .ui-icon {
  color: var(--blue);
}

#composer-options > summary .ui-icon {
  stroke: var(--blue);
}
#composer-options > summary .voice-slider-accent {
  stroke: var(--coral);
}

.translation-a {
  stroke: var(--coral);
}

#help-simpler .simpler-middle-line {
  stroke: var(--coral);
}
#choose-homework > .ui-icon {
  color: var(--coral);
}

#speaking-mode-menu > summary .speaking-mode-current {
  display: inline-block;
  margin-inline-start: 8px;
  padding: 2px 6px;
  border-radius: 6px;
  background: color-mix(in srgb, var(--blue) 10%, transparent);
  color: var(--blue);
  font-size: inherit;
  line-height: 1.4;
  vertical-align: middle;
}
/* Keep mode and activity menus together at the start of the toolbar. */
#practice .unified-chat .composer-toolbar {
  justify-content: flex-start;
  flex-wrap: wrap;
}
#practice #session-tools .session-menu-actions {
  left: 0;
  right: auto;
}
/* Give the conversation about one more text line without growing the composer. */
body.has-chat-sidebar:has(#practice:not([hidden]) #interaction:not([hidden])) .header {
  min-height: 56px;
  padding-block: 2px !important;
}

/* Related setup disclosures share the compact support row. */
#practice #chat-box .composer-support-row {
  gap: 6px 10px;
}
.composer-extra-menus {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  max-width: 100%;
}
#practice #chat-box .composer-extra-menus > :is(#composer-options, #homework-tools) {
  display: block;
  margin: 0 !important;
  padding: 0 !important;
  border: 0;
  background: transparent;
  box-shadow: none;
}
#practice #chat-box .composer-extra-menus > details > summary {
  min-height: 0 !important;
  margin: 0;
  padding: 0 !important;
  white-space: nowrap;
}
#practice #chat-box #homework-options-panel {
  flex: none;
  min-width: 0;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}
#practice #chat-box #homework-options-panel[hidden] {
  display: none;
}
#practice #chat-panel .chat-footer-tools:not(:has(button:not([hidden]))) {
  display: none !important;
}
#ideas-menu {
  position: relative;
  max-width: 100%;
}
#practice .unified-chat .composer-toolbar #toggle-ideas {
  min-height: 40px !important;
  margin: 0 !important;
  padding: 8px 12px !important;
  border-radius: 12px;
}
#ideas-menu #explore-panel {
  position: absolute;
  z-index: 35;
  top: calc(100% + 4px);
  left: auto;
  right: 0;
  width: min(380px, calc(100vw - 24px));
  max-height: min(560px, 70dvh);
  overflow-y: auto;
  margin: 0;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--cream);
  color: var(--ink);
  box-shadow: 0 8px 24px #05274f26;
}
#ideas-menu #explore-title {
  margin: 0 0 8px;
  font-size: 18px;
}
#ideas-menu #ideas {
  margin-top: 10px;
}
#ideas-menu #prompt-card {
  margin-top: 10px;
  padding: 12px;
}
#ideas-menu #prompt-card :is(h3, p) {
  font-size: 14px;
}
#ideas-menu #explore-panel > p:empty {
  display: none;
}
@media (max-width: 700px) {
  #ideas-menu #explore-panel {
    position: fixed;
    left: 12px;
    right: 12px;
    top: 120px;
    width: auto;
    max-height: calc(100dvh - 144px);
  }
}
#practice #chat-box .composer-extra-menus {
  flex: 0 0 auto;
}
#practice #chat-box .composer-extra-menus > :is(#composer-options, #homework-tools) {
  flex: 0 0 auto !important;
  width: auto !important;
}
/* Make the three reply-support button boundaries easier to distinguish. */
#practice .composer-support-row .understand-actions > button {
  border-color: #52657d;
}
html[data-theme='dark'] #practice .composer-support-row .understand-actions > button {
  border-color: #8da5c5;
}

/* Optional first steps live only in the existing empty-conversation state. */
#practice #chat-history .chat-empty-state {
  top: 50%;
  transform: translateY(-50%);
}
.chat-starter-actions {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}
#practice .chat-starter-actions > button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 36px;
  padding: 7px 10px;
  font-size: var(--chat-control-font-size, 13px);
  line-height: 1.4;
  border: 1px solid #52657d;
  border-radius: 9px;
  background: transparent;
  color: var(--blue);
}
.chat-starter-actions .ui-icon {
  flex: none;
  width: 18px;
  height: 18px;
}
#practice .chat-starter-actions > button:hover {
  background: color-mix(in srgb, var(--blue) 10%, transparent);
}
html[data-theme='dark'] #practice .chat-starter-actions > button {
  border-color: #8da5c5;
}
@media (max-width: 600px) {
  .chat-empty-state .conversation-start-icon {
    width: 56px;
    height: 56px;
    margin-bottom: 8px;
    padding: 6px;
  }
  .chat-starter-actions {
    gap: 6px;
    margin-top: 10px;
  }
}

/* Share one top row so the conversation gains the old status-row space. */
body:has(#practice:not([hidden]) #interaction:not([hidden]) #chat-panel:not([hidden]))
  #practice
  .practice-heading {
  min-height: 0 !important;
  height: 0;
  margin: 0 !important;
  padding: 0;
}
#practice .unified-chat .composer-toolbar > .practice-header-tools {
  display: flex;
  align-items: center;
  align-self: center;
  margin-inline-start: auto;
  flex: 0 0 auto;
}

/* Ideas uses the same quiet, outlined treatment as its neighboring menus. */
#practice .unified-chat .composer-toolbar #toggle-ideas {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 9px 12px !important;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--ink);
  font-weight: 400;
}
#practice .unified-chat .composer-toolbar #toggle-ideas:hover {
  background: color-mix(in srgb, var(--blue) 8%, transparent);
  border-color: var(--line);
}
#practice .unified-chat .composer-toolbar #toggle-ideas::before {
  content: '▸';
}
#practice .unified-chat .composer-toolbar #toggle-ideas[aria-expanded='true']::before {
  content: '▾';
}
#practice .unified-chat .composer-toolbar #toggle-ideas .ui-icon {
  width: 20px;
  height: 20px;
  color: var(--blue);
}

/* Match the stronger outlines already used by reply-support buttons. */
#practice
  .unified-chat
  .composer-toolbar
  :is(#speaking-mode-menu > summary, #session-tools > summary, #toggle-ideas) {
  border-color: #52657d;
}
html[data-theme='dark']
  #practice
  .unified-chat
  .composer-toolbar
  :is(#speaking-mode-menu > summary, #session-tools > summary, #toggle-ideas) {
  border-color: #8da5c5;
}

/* Goal fields keep the same typography after moving out of the disclosure. */
#practice
  #learning-goals
  :is(
    label,
    #learning-subject,
    #learning-subject option,
    #content-goal,
    #language-goal,
    #content-goal-example,
    #language-goal-example
  ) {
  font-family: inherit;
  font-size: var(--chat-control-font-size, 13px);
  line-height: 1.5;
}
#practice #learning-goals :is(#content-goal, #language-goal)::placeholder {
  font: inherit;
  color: var(--muted);
  opacity: 1;
}

/* The elapsed-time shortcut retains its compact clock appearance. */
#practice #practice-clock {
  border: 0;
  padding: 0;
  background: transparent;
  font-family: inherit;
  font-weight: 400;
  color: var(--ink);
  cursor: pointer;
}
#practice #practice-clock:hover {
  color: var(--blue);
}

/* Equal touch-friendly sizing for the six everyday menu/support choices. */
#practice
  .unified-chat
  :is(
    .composer-toolbar #speaking-mode-menu > summary,
    .composer-toolbar #session-tools > summary,
    .composer-toolbar #toggle-ideas,
    .composer-support-row .understand-actions > button
  ) {
  min-height: 44px !important;
  padding: 9px 12px !important;
  box-sizing: border-box;
}
/* Keep the compact artwork while giving touch users a larger actual target. */
@media (any-pointer: coarse) {
  body.has-chat-sidebar
    :is(
      .theme-toggle,
      #switch-learner,
      #collapse-chat-sidebar,
      #open-chat-sidebar,
      .saved-chat-more
    ),
  #practice :is(#edit-setup, #practice-clock),
  #practice #chat-box .composer-actions :is(#coach-submit, #record, #hear-reply, #choose-homework) {
    min-width: 44px !important;
    min-height: 44px !important;
  }
  #practice #chat-box .composer-extra-menus > details > summary,
  #practice #chat-box .composer-support-row > .check {
    min-height: 44px !important;
    display: inline-flex;
    align-items: center;
  }
}

/* Main shell dividers match the stronger control outlines. */
body.has-chat-sidebar .header {
  border-bottom-color: #52657d;
}
body.has-chat-sidebar #saved-chat-sidebar {
  border-right-color: #52657d !important;
}
html[data-theme='dark'] body.has-chat-sidebar .header {
  border-bottom-color: #8da5c5;
}
html[data-theme='dark'] body.has-chat-sidebar #saved-chat-sidebar {
  border-right-color: #8da5c5 !important;
}

/* Give both goal entry fields the full available homework-menu width. */
#practice #learning-goals :is(#content-goal, #language-goal) {
  display: block;
  width: 100%;
  max-width: none;
  min-width: 0;
  box-sizing: border-box;
  margin-top: 6px;
}
#practice #learning-goals :is(#content-goal-example, #language-goal-example) {
  display: block;
  margin: 6px 0 12px;
}
#practice #learning-goals :is(label[for='content-goal'], label[for='language-goal']) {
  display: block;
}

/* Neutral reply-support labels; preserve the blue/coral icon artwork. */
#practice :is(#help-simpler, #help-language, #help-example) > span {
  color: #000;
}
html[data-theme='dark'] #practice :is(#help-simpler, #help-language, #help-example) > span {
  color: #fff;
}

/* Subtle fills distinguish the three top menus from the page surface. */
#practice
  .unified-chat
  .composer-toolbar
  :is(#speaking-mode-menu > summary, #session-tools > summary, #toggle-ideas) {
  background: #edf3fc;
}
#practice
  .unified-chat
  .composer-toolbar
  :is(#speaking-mode-menu > summary, #session-tools > summary, #toggle-ideas):hover {
  background: #dce9ff;
}
html[data-theme='dark']
  #practice
  .unified-chat
  .composer-toolbar
  :is(#speaking-mode-menu > summary, #session-tools > summary, #toggle-ideas) {
  background: #22364f;
}
html[data-theme='dark']
  #practice
  .unified-chat
  .composer-toolbar
  :is(#speaking-mode-menu > summary, #session-tools > summary, #toggle-ideas):hover {
  background: #2b4565;
}

/* White reply-support button surfaces in light mode only. */
html:not([data-theme='dark']) #practice .composer-support-row .understand-actions > button {
  background: #fff;
}

/* White light-mode surfaces for the three empty-chat starting choices. */
html:not([data-theme='dark']) #practice .chat-starter-actions > button {
  background: #fff;
}

/* Translated controls wrap within their available space instead of clipping. */
#practice .composer-toolbar > :is(#speaking-mode-menu, #session-tools, #ideas-menu) {
  min-width: 0;
  max-width: 100%;
}
#practice
  .composer-toolbar
  :is(#speaking-mode-menu > summary, #session-tools > summary, #toggle-ideas),
#practice .speaking-mode-buttons > button,
#practice .composer-support-row .understand-actions > button,
#practice .composer-extra-menus > details > summary {
  white-space: normal !important;
  overflow-wrap: anywhere;
  max-width: 100%;
}
#practice .composer-support-row .understand-actions {
  min-width: 0;
  max-width: 100%;
}
#practice .composer-support-row .understand-actions > button > span {
  min-width: 0;
}
#practice #chat-box :is(#record-status, #practice-status) {
  overflow-wrap: anywhere;
}
#practice .composer-toolbar .ui-icon,
#practice .composer-support-row .ui-icon {
  flex-shrink: 0;
}

/* A temporary jump control overlays history without moving the composer. */
#practice #chat-history .new-chat-reply {
  position: sticky;
  bottom: 8px;
  z-index: 6;
  display: block;
  width: fit-content;
  max-width: calc(100% - 16px);
  min-height: 36px;
  margin: -36px auto 0;
  padding: 7px 12px;
  border: 1px solid var(--blue);
  border-radius: 18px;
  background: var(--cream);
  color: var(--ink);
  font: inherit;
  font-size: 13px;
  line-height: 20px;
  cursor: pointer;
  box-shadow: 0 2px 8px #05274f26;
}

/* Separate compact activity and session menus, retaining their existing actions. */
#games-menu {
  position: relative;
  min-width: 0;
  max-width: 100%;
}
#practice .composer-toolbar #games-menu > summary {
  cursor: pointer;
  border: 1px solid #52657d;
  border-radius: 12px;
  min-height: 44px;
  padding: 9px 12px;
  font-size: var(--chat-control-font-size, 13px);
  background: #edf3fc;
  color: var(--ink);
  white-space: normal;
  overflow-wrap: anywhere;
}
#practice .composer-toolbar #games-menu > summary:hover {
  background: #dce9ff;
}
#games-menu > summary .ui-icon {
  color: var(--blue);
}
#games-menu > summary .ui-icon > path:nth-of-type(2) {
  stroke: var(--coral);
}
html[data-theme='dark'] #practice .composer-toolbar #games-menu > summary {
  background: #22364f;
  border-color: #8da5c5;
}
html[data-theme='dark'] #practice .composer-toolbar #games-menu > summary:hover {
  background: #2b4565;
}
#practice .composer-toolbar :is(#games-menu, #session-tools) .session-menu-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 4px;
  left: 0;
  right: auto;
  width: min(260px, calc(100vw - 24px));
  max-height: min(420px, 65dvh);
  overflow-y: auto;
  padding: 6px;
}
#practice .composer-toolbar #games-menu .activity-buttons {
  display: contents;
}
#practice .composer-toolbar :is(#games-menu, #session-tools) .session-menu-actions button {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  min-height: 44px;
  width: 100%;
  margin: 0;
  padding: 8px 10px;
  font-size: 13px;
  font-weight: 400;
  line-height: 1.4;
  border-radius: 8px;
  text-align: start;
  white-space: normal;
  overflow-wrap: anywhere;
  background: transparent;
  color: var(--ink);
  border: 1px solid transparent;
}
#practice
  .composer-toolbar
  :is(#games-menu, #session-tools)
  .session-menu-actions
  button:hover:not(:disabled) {
  background: color-mix(in srgb, var(--blue) 10%, transparent);
  border-color: var(--line);
}
#practice .composer-toolbar :is(#games-menu, #session-tools) .session-menu-actions .ui-icon {
  width: 18px;
  height: 18px;
  flex: none;
  margin: 0;
  color: var(--blue);
}
#practice
  .composer-toolbar
  :is(#games-menu, #session-tools)
  .session-menu-actions
  button
  > span[aria-hidden] {
  display: inline-flex;
  flex: none;
}
@media (max-width: 600px) {
  #practice .composer-toolbar :is(#games-menu, #session-tools) .session-menu-actions {
    position: fixed;
    z-index: 100;
    inset: auto 12px 12px;
    width: auto;
    max-height: 60dvh;
    padding: 10px;
    box-shadow: 0 -4px 24px #05274f33;
  }
}

/* ELVI bubbles share the End session button’s original light-mode coral. */
html:not([data-theme='dark']) #practice .chat-message-elvi {
  background: #ff705d;
  border-color: #ff705d;
}

/* Conversation information is a compact anchored popup, outside page flow. */
#practice #conversation-transcript {
  position: fixed;
  z-index: 110;
  top: var(--conversation-info-top, 112px);
  width: min(360px, calc(100vw - 24px));
  max-height: min(380px, calc(100dvh - var(--conversation-info-top, 112px) - 12px));
  margin: 0;
  padding: 14px;
  overflow-y: auto;
  border: 1px solid #52657d;
  border-radius: 14px;
  box-shadow: 0 8px 28px #05274f33;
  background: var(--cream);
  color: var(--ink);
  font-size: 13px;
}
html[data-theme='dark'] #practice #conversation-transcript {
  border-color: #8da5c5;
}
#conversation-transcript .conversation-info-heading {
  flex-wrap: nowrap;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 8px;
}
#conversation-transcript .conversation-info-heading h2 {
  font-size: 16px;
  line-height: 1.4;
}
#conversation-transcript #close-conversation-info {
  width: 32px;
  min-height: 32px;
  justify-content: center;
  padding: 6px;
}
#conversation-transcript :is(.session-summary, li, p) {
  font-size: 13px;
  line-height: 1.5;
}
#conversation-transcript .session-summary {
  padding: 10px;
  margin: 0;
}
#conversation-transcript #transcript-entries {
  max-height: 240px;
  margin-bottom: 0;
}
#conversation-transcript #transcript-entries li {
  padding: 8px 0;
}

/* All four top menus share the compact Games/Tools typography. */
#practice :is(#speaking-modes, #ideas-menu #explore-panel),
#practice
  :is(#speaking-modes, #ideas-menu #explore-panel)
  :is(h2, h3, p, label, small, select, option, input, button, .starter > span, .eyebrow) {
  font-family: inherit;
  font-size: var(--chat-control-font-size, 13px);
  font-weight: 400;
  font-style: normal;
  line-height: 1.4;
  letter-spacing: normal;
  text-transform: none;
}

/* Collapsible chat organization shares the existing scrolling sidebar. */
#saved-chat-list .saved-chat-section {
  margin: 8px 0;
  padding: 0;
  border: 0;
  background: transparent;
}
#saved-chat-list .saved-chat-section > summary {
  cursor: pointer;
  padding: 8px 10px;
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  color: var(--ink);
  overflow-wrap: anywhere;
}
#saved-chat-list .saved-chat-section .saved-chat-section {
  margin-inline-start: 8px;
}
#saved-chat-list .saved-chat-empty {
  margin: 2px 10px 8px;
  font-size: 12px;
  line-height: 1.4;
  color: var(--muted);
}
#saved-chat-list .saved-chat-date {
  margin-top: 8px;
}
#saved-chat-dialog .saved-chat-pin {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 14px 0;
}
#saved-chat-dialog .saved-chat-pin input {
  width: 20px;
  height: 20px;
  margin: 0;
  flex: none;
}
#saved-chat-dialog :is(label, input, button) {
  font-family: inherit;
  font-size: 13px;
}

/* Speaking choices use the same compact single-column menu rhythm. */
#practice .unified-chat #speaking-mode-menu #speaking-modes {
  width: min(260px, calc(100vw - 24px)) !important;
  max-width: calc(100vw - 24px) !important;
  padding: 6px;
  overflow-y: auto;
}
#practice #speaking-mode-menu .speaking-mode-buttons {
  display: flex;
  flex-direction: column;
  flex-wrap: nowrap;
  gap: 4px;
  align-items: stretch;
}
#practice #speaking-mode-menu .speaking-mode-buttons > button {
  width: 100%;
  min-height: 44px;
  justify-content: flex-start;
  text-align: start;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 400;
  line-height: 1.4;
}
#practice #speaking-mode-menu .speaking-mode-buttons > button:not([aria-pressed='true']) {
  background: transparent;
  border-color: transparent;
}
#practice
  #speaking-mode-menu
  .speaking-mode-buttons
  > button:hover:not(:disabled):not([aria-pressed='true']) {
  background: color-mix(in srgb, var(--blue) 10%, transparent);
  border-color: var(--line);
}
#practice #speaking-mode-menu .speaking-mode-buttons .ui-icon {
  width: 18px;
  height: 18px;
  flex: none;
}

/* Homework joins the top menus; voice settings stay under the audio controls. */
#practice .composer-toolbar #homework-tools {
  position: relative;
  display: block;
  flex: 0 0 auto !important;
  width: auto;
  max-width: 100%;
  min-width: 0;
  margin: 0 !important;
  padding: 0 !important;
  border: 0;
  background: transparent;
  box-shadow: none;
}
#practice .composer-toolbar #homework-tools > summary {
  min-height: 44px !important;
  padding: 9px 12px !important;
  margin: 0;
  border: 1px solid #52657d;
  border-radius: 12px;
  background: #edf3fc;
  color: var(--ink);
  font-family: inherit;
  font-size: 13px;
  font-weight: 400;
  line-height: 1.4;
  white-space: normal;
  overflow-wrap: anywhere;
  cursor: pointer;
}
#practice .composer-toolbar #homework-tools > summary:hover {
  background: #dce9ff;
}
#practice .composer-toolbar #homework-tools > summary .ui-icon {
  width: 20px;
  height: 20px;
  vertical-align: middle;
}
html[data-theme='dark'] #practice .composer-toolbar #homework-tools > summary {
  background: #22364f;
  border-color: #8da5c5;
}
html[data-theme='dark'] #practice .composer-toolbar #homework-tools > summary:hover {
  background: #2b4565;
}
#practice #homework-tools #homework-options-panel {
  position: fixed;
  z-index: 105;
  top: var(--homework-popup-top, 112px);
  left: 12px;
  width: min(380px, calc(100vw - 24px));
  max-height: none;
  overflow: visible;
  margin: 0;
  padding: 14px;
  background: var(--cream);
  color: var(--ink);
  border: 1px solid #52657d;
  border-radius: 14px;
  box-shadow: 0 8px 24px #05274f26;
  font-family: inherit;
  font-size: 13px;
  line-height: 1.5;
}
html[data-theme='dark'] #practice #homework-tools #homework-options-panel {
  border-color: #8da5c5;
}
#practice #homework-options-panel :is(p, label, small, select, input, button, summary) {
  font-family: inherit;
  font-size: 13px;
}
#practice #homework-options-panel > p:first-child {
  margin-top: 0;
}
#practice #homework-options-panel #learning-subject {
  width: 100%;
}
#practice #chat-box .composer-support-row > .composer-extra-menus {
  margin-inline-start: auto;
  justify-content: flex-end;
}

/* File privacy belongs with adding materials, not the homework goal fields. */
#add-material-menu {
  max-height: min(560px, calc(100dvh - 16px));
  overflow-y: auto;
}
#add-material-menu #homework-details {
  margin: 4px 0 0;
  padding: 0;
  border-top: 1px solid var(--line);
}
#add-material-menu #homework-details > summary {
  min-height: 40px;
  padding: 10px;
  font-family: inherit;
  font-size: 13px;
  line-height: 1.4;
  color: inherit;
  cursor: pointer;
}
#add-material-menu #homework-details > p {
  margin: 4px 10px 10px;
  font-family: inherit;
  font-size: 12px;
  line-height: 1.5;
  color: inherit;
  overflow-wrap: anywhere;
}

/* Compact the existing Voice Options disclosure without relocating it. */
#practice #voice-options-panel :is(p, label, select, option, button) {
  font-family: inherit;
  font-size: 13px;
  font-weight: 400;
  line-height: 1.4;
}
#practice #voice-options-panel #language-help > p {
  margin: 4px 0 6px;
}
#practice #voice-options-panel .voice-controls {
  align-items: flex-end;
  gap: 6px;
  padding: 6px 0;
}
#practice #voice-options-panel .voice-controls > label {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 4px;
  min-width: 0;
  margin: 0;
}
#practice #voice-options-panel .voice-controls > label:first-child {
  flex: 1 1 200px;
  max-width: 320px;
}
#practice #voice-options-panel .voice-controls > label:not(:first-child) {
  flex: 1 1 150px;
  max-width: 190px;
}
#practice #voice-options-panel .voice-controls select {
  min-height: 36px;
  margin: 0;
  padding: 6px 8px;
}
#practice #voice-options-panel .voice-controls button {
  min-height: 36px;
  margin: 0;
  padding: 6px 10px;
}
#practice #voice-options-panel .voice-controls > p {
  margin: 2px 0 0;
}
#practice #voice-options-panel .voice-controls > p:empty {
  display: none;
}
@media (any-pointer: coarse) {
  #practice #voice-options-panel .voice-controls :is(select, button) {
    min-height: 44px;
  }
}

/* Keep the reaction affordance readable on ELVI's coral bubbles. */
html[data-theme='dark'] #practice .chat-message-elvi .message-reaction-picker > summary {
  color: #05274f;
}

/* Opt-in page reader: speaker between BETA and Page Language. */
#page-reader {
  position: relative;
  display: inline-flex;
  flex: 0 0 auto;
}
#page-reader-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  min-height: 44px;
  padding: 6px;
  border: 0;
  background: transparent;
  color: var(--blue);
  cursor: pointer;
}
#page-reader-toggle .page-reader-waves {
  stroke: var(--coral);
}
#page-reader-toggle[aria-pressed='true'] {
  border-radius: 8px;
  background: color-mix(in srgb, var(--coral) 18%, transparent);
}
#page-reader-panel {
  position: absolute;
  z-index: 100;
  top: calc(100% + 6px);
  inset-inline-end: 0;
  width: min(270px, calc(100vw - 24px));
  padding: 8px;
  border: 1px solid #52657d;
  border-radius: 12px;
  background: #fff;
  color: #05274f;
  box-shadow: 0 8px 24px #05274f24;
}
#page-reader-panel[hidden] {
  display: none;
}
#page-reader-panel > button {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 44px;
  padding: 8px 10px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: inherit;
  text-align: start;
  font:
    400 13px/1.5 system-ui,
    sans-serif;
  white-space: normal;
}
#page-reader-panel > button:hover:not(:disabled) {
  background: #edf3fc;
}
#page-reader-panel > button:disabled {
  opacity: 0.55;
}
#page-reader-status {
  margin: 4px 8px;
  font:
    400 13px/1.5 system-ui,
    sans-serif;
  overflow-wrap: anywhere;
}
#page-reader-panel > audio {
  max-width: 100%;
}
html[data-theme='dark'] #page-reader-panel {
  background: #17263b;
  color: #edf4ff;
  border-color: #8da5c5;
}
html[data-theme='dark'] #page-reader-panel > button:hover:not(:disabled) {
  background: #22364f;
}
.header .page-language-bar {
  margin: 0;
  width: auto;
  padding: 0;
  border: 0;
  background: transparent;
}
@media (max-width: 600px) {
  #page-reader-panel {
    position: fixed;
    top: 112px;
    inset-inline: 12px;
    width: auto;
    max-height: calc(100dvh - 136px);
    overflow-y: auto;
  }
}

#page-reader-panel .page-reader-menu-icon {
  flex: 0 0 20px;
  color: var(--blue);
}
#page-reader-panel .page-reader-waves {
  stroke: var(--coral);
}
#page-reader-panel .page-reader-label {
  min-width: 0;
}

/* Searchable multi-language choices stay compact when closed. */
.profile-question {
  display: block;
  font: inherit;
  font-weight: 600;
  margin: 12px 0 6px;
}
.profile-language-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 6px;
}
.profile-language-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
  padding: 3px 5px 3px 10px;
  border: 1px solid #8ba9d1;
  border-radius: 18px;
  background: #e7f0ff;
  color: #082c55;
  font: inherit;
  overflow-wrap: anywhere;
}
.profile-language-chip button {
  display: inline-grid;
  place-items: center;
  min-width: 28px;
  min-height: 28px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: inherit;
  font-size: 20px;
  line-height: 1;
}
.profile-language-picker {
  position: relative;
  margin-bottom: 10px;
}
.profile-language-picker > summary {
  display: flex;
  align-items: center;
  gap: 7px;
  width: fit-content;
  min-height: 40px;
  border: 1px solid var(--border, #718299);
  border-radius: 8px;
  padding: 6px 12px;
  font: inherit;
  cursor: pointer;
}
.profile-language-picker > summary::before {
  content: '+';
  color: var(--blue);
  font-size: 20px;
}
.profile-language-picker > summary::marker {
  content: '';
}
.profile-language-picker > summary::-webkit-details-marker {
  display: none;
}
.profile-language-panel {
  position: fixed;
  z-index: 30;
  box-sizing: border-box;
  max-height: calc(100dvh - 24px);
  overflow: auto;
  padding: 8px;
  border: 1px solid #718299;
  border-radius: 10px;
  background: #fff;
  color: #082c55;
  box-shadow: 0 6px 20px #082c5526;
}
.profile-language-panel input[type='search'] {
  box-sizing: border-box;
  width: 100%;
  min-height: 40px;
  margin: 0 0 5px;
  padding: 7px 10px;
  font: inherit;
}
.profile-language-choices {
  max-height: 170px;
  overflow-y: auto;
}
.profile-language-choices .check {
  display: flex;
  align-items: center;
  min-height: 36px;
  gap: 8px;
  margin: 0;
  padding: 2px 5px;
  font: inherit;
  border-radius: 6px;
}
.profile-language-choices .check:hover {
  background: #e7f0ff;
}
.profile-language-choices .check[hidden] {
  display: none;
}
.profile-language-choices input {
  flex: 0 0 auto;
}
html[data-theme='dark'] .profile-language-panel {
  background: #18283a;
  color: #edf3ff;
}
html[data-theme='dark'] .profile-language-chip {
  background: #223b5b;
  color: #edf3ff;
}
html[data-theme='dark'] .profile-language-choices .check:hover {
  background: #223b5b;
}
#learner-profile-dialog {
  max-height: 90dvh;
  overflow-y: auto;
}
#learner-profile-form {
  padding-bottom: 8px;
}

.profile-explanation-options {
  margin: 10px 0;
}
#setup-learning-focus label,
#profile-learning-focus label {
  display: block;
  margin: 10px 0 5px;
  font: inherit;
  font-weight: 600;
}
#setup-learning-focus select,
#profile-learning-focus select {
  width: 100%;
  font: inherit;
}

/* Fixed-position picker panels must not escape their closed details container. */
.profile-language-picker:not([open]) > .profile-language-panel {
  display: none;
}
.profile-language-panel-title {
  display: block;
  margin: 0 0 7px;
  font: inherit;
  font-weight: 600;
}

/* One text size throughout both Learner profile views, matching Grade / Age. */
#setup-form,
#learner-profile-form {
  --profile-text-size: 14px;
  font-size: var(--profile-text-size);
}
:is(#setup-form, #learner-profile-form)
  :is(h2, label, select, option, input, button, summary, p, span, strong, legend) {
  font-family: inherit;
  font-size: var(--profile-text-size);
}
:is(#setup-form, #learner-profile-form) .profile-language-picker > summary::before {
  font-size: var(--profile-text-size);
}

/* Left-hand disclosure arrows retain the familiar picker inside each question. */
.profile-language-question > summary.profile-question {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 0;
  padding: 9px 0;
  cursor: pointer;
  list-style: none;
}
.profile-language-question > summary::-webkit-details-marker {
  display: none;
}
.profile-language-question > summary::before {
  content: '▸';
  color: var(--blue);
  flex: 0 0 12px;
}
.profile-language-question[open] > summary::before {
  content: '▾';
}
.profile-language-question-content {
  padding-inline-start: 19px;
}
.profile-language-question:not([open]) > .profile-language-question-content {
  display: none;
}
.profile-language-question:not([open]) .profile-language-panel {
  display: none;
}

/* Compact text preference beside the page reader; native radios support keyboards. */
#text-size-menu {
  position: relative;
  display: inline-flex;
  flex: none;
}
#text-size-toggle {
  min-width: 36px;
  min-height: 44px;
  padding: 6px;
  border: 0;
  background: transparent;
  color: var(--blue);
  font-size: 16px;
  font-weight: 600;
}
#text-size-panel {
  position: fixed;
  z-index: 140;
  box-sizing: border-box;
  width: 220px;
  max-width: calc(100vw - 24px);
  max-height: 70dvh;
  overflow: auto;
  padding: 12px;
  border: 1px solid #52657d;
  border-radius: 12px;
  background: var(--cream);
  color: var(--ink);
  box-shadow: 0 8px 24px #05274f26;
  font-size: 14px;
}
#text-size-panel[hidden] {
  display: none;
}
#text-size-panel fieldset {
  min-width: 0;
  border: 0;
  margin: 0;
  padding: 0;
}
#text-size-panel legend {
  font-weight: 600;
  margin-bottom: 6px;
}
#text-size-panel label {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  margin: 0;
  cursor: pointer;
  font-size: inherit;
}
#text-size-panel input {
  width: 18px;
  height: 18px;
  flex: none;
  accent-color: var(--blue);
}
#text-size-reset {
  min-height: 44px;
  margin-top: 6px;
  width: 100%;
  padding: 8px;
  font-size: inherit;
  background: transparent;
  color: inherit;
  border: 1px solid #52657d;
  border-radius: 8px;
}
html[data-theme='dark'] #text-size-panel {
  background: #192a40;
  color: #edf3fc;
}
html:is([data-text-size='large'], [data-text-size='extra-large']) .header-right {
  flex-wrap: wrap;
}
html:is([data-text-size='large'], [data-text-size='extra-large']) #practice {
  overflow: visible;
  height: auto;
  min-height: 0;
}
html:is([data-text-size='large'], [data-text-size='extra-large']) #practice .composer-support-row {
  flex-wrap: wrap;
}

/* Show the complete homework form, with no nested scrolling or resize handle. */
#practice #homework-options-panel {
  resize: none;
}
#practice #homework-options-panel p {
  margin-block: 8px;
}
#practice
  #homework-options-panel
  #learning-goals
  :is(#content-goal-example, #language-goal-example) {
  margin: 4px 0 8px;
}
#practice #homework-options-panel #homework-goal-status:empty {
  display: none;
}
#practice #homework-options-panel #goals-tip {
  margin-bottom: 0;
}

/* Voice Options escapes the composer's scroll clipping without shifting the chat. */
#practice > #voice-options-panel {
  position: fixed;
  z-index: 105;
  width: min(380px, calc(100vw - 24px));
  max-height: calc(100dvh - 24px);
  overflow: auto;
  overscroll-behavior: contain;
  box-sizing: border-box;
  margin: 0;
  padding: 12px;
  border: 1px solid #52657d;
  border-radius: 14px;
  background: var(--cream);
  color: var(--ink);
  box-shadow: 0 8px 24px #05274f26;
  font-family: inherit;
  font-size: 13px;
  line-height: 1.4;
}
#practice > #voice-options-panel[hidden] {
  display: none;
}
html[data-theme='dark'] #practice > #voice-options-panel {
  border-color: #8da5c5;
}

/* Keep all header actions reachable on phones, including reader and text size. */
@media (max-width: 700px) {
  .header {
    flex-wrap: wrap !important;
    gap: 8px;
    padding-inline: 10px;
  }
  .header #chat-topic-header {
    flex: 1 1 100%;
    width: 100%;
    min-width: 0;
  }
  .header .header-right {
    display: flex;
    flex: 1 1 100%;
    flex-wrap: wrap !important;
    justify-content: flex-start !important;
    width: 100%;
    min-width: 0;
    max-width: 100%;
    margin-inline-start: 0;
    gap: 6px;
  }
  .header .header-right > * {
    flex-shrink: 0;
  }
  .header :is(#page-reader-toggle, #text-size-toggle, .theme-toggle, #switch-learner) {
    min-width: 44px;
    min-height: 44px;
  }
  .header .page-language-bar {
    min-width: 0;
    max-width: 100%;
  }
  .header #page-language {
    min-width: 90px;
    max-width: 160px;
  }
}

/* Same ELVI palette, fewer primary choices. Popups never reserve chat height. */
.workspace-streamlined .workspace-menu-toggle,
.workspace-popup {
  font: inherit;
}
.workspace-streamlined .workspace-menu-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 10px 14px;
  border: 1px solid #52657d;
  border-radius: 12px;
  background: #edf3fb;
  color: #082a50;
  cursor: pointer;
}
.workspace-popup {
  position: fixed;
  z-index: 1200;
  box-sizing: border-box;
  overflow: auto;
  padding: 10px;
  background: #fff;
  color: #082a50;
  border: 1px solid #52657d;
  border-radius: 12px;
  box-shadow: 0 8px 24px #082a5026;
}
.workspace-popup[hidden],
.workspace-streamlined .workspace-tester-only {
  display: none !important;
}
.workspace-menu-item {
  display: flex;
  gap: 10px;
  align-items: center;
  width: 100%;
  min-height: 44px;
  text-align: start;
  border: 0;
  border-radius: 8px;
  padding: 10px;
  font: inherit;
  background: transparent;
  color: inherit;
  cursor: pointer;
}
.workspace-popup .ui-icon {
  color: #005bea;
  flex: none;
}
.workspace-menu-item:hover {
  background: #edf3fb;
}
.workspace-streamlined .workspace-menu-sources {
  display: contents;
}
.workspace-streamlined .workspace-source {
  position: static !important;
  margin: 0 !important;
}
.workspace-streamlined .workspace-source > summary,
.workspace-streamlined #ideas-menu > #toggle-ideas {
  display: none !important;
}
.workspace-streamlined .workspace-source > :is(.session-menu-actions, #explore-panel) {
  position: fixed !important;
  z-index: 1201;
  overflow: auto;
  box-sizing: border-box;
  margin: 0 !important;
  transform: none !important;
  right: auto !important;
}
.workspace-streamlined #speaking-mode-menu > summary > span:not(#current-speaking-mode) {
  display: none;
}
.workspace-streamlined #current-speaking-mode {
  background: transparent;
  padding: 0;
  color: inherit;
  font: inherit;
}
.workspace-streamlined .header-right {
  flex-wrap: nowrap !important;
  width: auto;
  flex: none;
}
.workspace-streamlined .header-right > .pill {
  display: none;
}
.workspace-streamlined #workspace-more-panel > * {
  margin: 4px 0;
}
.workspace-streamlined
  #workspace-more-panel
  :is(.page-language-bar, .learner-level-profile, #edit-setup, #switch-learner, #logout) {
  width: 100%;
  max-width: 100%;
  justify-content: flex-start;
  box-sizing: border-box;
}
.workspace-streamlined #workspace-more-panel .page-language-bar {
  display: flex;
  flex-wrap: wrap;
}
.workspace-streamlined #workspace-more-panel #edit-setup {
  min-height: 44px;
}
.workspace-appearance {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 10px;
}
.workspace-streamlined .composer-support-row {
  align-items: center;
}
.workspace-streamlined #practice .understand-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  flex: 1 1 auto;
  min-width: 0;
}
.workspace-streamlined #practice .understand-actions button {
  width: 100%;
  min-width: 0;
  min-height: 44px;
  height: 100%;
  box-sizing: border-box;
  justify-content: center;
  gap: 8px;
  white-space: normal;
  font: inherit;
}
.workspace-streamlined #reply-language-panel label {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  margin: 4px 8px;
}
.workspace-streamlined .workspace-menu-toggle:focus-visible,
.workspace-popup :is(button, select, input):focus-visible {
  outline: 3px solid #005bea;
  outline-offset: 2px;
}
html[data-theme='dark'] .workspace-menu-toggle,
html[data-theme='dark'] .workspace-popup {
  color: #edf4ff;
  background: #17263b;
  border-color: #71849e;
}
html[data-theme='dark'] .workspace-menu-item:hover {
  background: #22364f;
}
html[data-theme='dark'] .workspace-popup .ui-icon {
  color: #8dbbff;
}
@media (max-width: 700px) {
  .workspace-streamlined .header {
    flex-wrap: nowrap !important;
    gap: 6px;
    padding: 8px 10px;
  }
  .workspace-streamlined #chat-topic-header {
    width: auto;
    flex: 1 1 auto;
    min-width: 0;
  }
  .workspace-streamlined #chat-topic-header :is(.chat-topic-title, h1, h2) {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .workspace-streamlined #chat-topic-header .chat-topic-subtitle {
    display: none;
  }
  .workspace-streamlined .header-right {
    gap: 2px;
  }
  .workspace-streamlined #workspace-more-toggle {
    padding: 8px;
    min-width: 44px;
  }
  .workspace-streamlined #workspace-more-toggle span {
    display: none;
  }
  .workspace-streamlined #workspace-more-toggle {
    font-size: 13px;
  }
  .workspace-streamlined #practice .composer-toolbar {
    gap: 6px;
    align-items: center;
    flex-wrap: wrap;
  }
  .workspace-streamlined #practice .composer-toolbar > #speaking-mode-menu {
    margin-right: 0;
  }
  .workspace-streamlined #practice .composer-toolbar #speaking-mode-menu > summary {
    padding: 8px;
    gap: 5px;
    min-height: 44px;
  }
  .workspace-streamlined .workspace-menu-toggle {
    padding: 8px;
    gap: 5px;
  }
  .workspace-streamlined #practice .understand-actions {
    flex-basis: 100%;
    width: 100%;
  }
  .workspace-streamlined #practice .understand-actions button {
    flex-direction: column;
    padding: 8px 4px;
    gap: 4px;
    min-height: 64px;
  }
  .workspace-streamlined #practice .understand-actions button svg {
    width: 20px;
    height: 20px;
  }
  .workspace-streamlined #practice .understand-actions button span {
    text-align: center;
    overflow-wrap: anywhere;
  }
  .workspace-streamlined #whiteboard-pane #whiteboard-header {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 4px;
    padding: 6px 8px;
  }
  .workspace-streamlined #whiteboard-pane #whiteboard-header h2 {
    margin: 0 auto 0 0;
    padding: 0;
    min-width: 0;
  }
  .workspace-streamlined #whiteboard-header :is(#pause-board, #replay-board, #toggle-whiteboard) {
    width: 44px;
    height: 44px;
    min-height: 44px;
    padding: 10px;
    flex: 0 0 44px;
    margin: 0;
  }
  .workspace-streamlined
    #whiteboard-header
    :is(#pause-board, #replay-board, #toggle-whiteboard)
    span {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }
}

@media (max-width: 700px) {
  html.workspace-streamlined body.has-chat-sidebar .header {
    flex-wrap: wrap !important;
  }
  html.workspace-streamlined body.has-chat-sidebar #chat-topic-header {
    flex: 1 1 100% !important;
    width: 100% !important;
  }
  html.workspace-streamlined body.has-chat-sidebar .header-right {
    flex: 0 0 auto !important;
    width: auto !important;
    margin-left: auto;
  }
  html.workspace-streamlined #active-chat-subtitle {
    display: none !important;
  }
  html.workspace-streamlined
    #whiteboard-header
    :is(#pause-board, #replay-board, #toggle-whiteboard)[hidden] {
    display: none !important;
  }
}

.workspace-streamlined .workspace-source:is(details):not([open]) {
  display: none !important;
}
.workspace-streamlined .workspace-source:is(details) > summary {
  display: block !important;
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  overflow: hidden;
  padding: 0 !important;
  border: 0 !important;
  clip-path: inset(50%);
  white-space: nowrap;
}
.workspace-streamlined .workspace-source > .session-menu-actions {
  padding: 10px;
  border: 1px solid #52657d;
  border-radius: 12px;
  background: #fff;
  color: #082a50;
  box-shadow: 0 8px 24px #082a5026;
}
.workspace-streamlined .workspace-source :is(.session-menu-actions, .activity-buttons) {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.workspace-streamlined .workspace-source .session-menu-actions button {
  display: flex;
  gap: 8px;
  align-items: center;
  min-height: 44px;
  text-align: start;
  font: inherit;
  color: inherit;
}
html[data-theme='dark'].workspace-streamlined .workspace-source > .session-menu-actions {
  background: #17263b;
  color: #edf4ff;
  border-color: #71849e;
}
.workspace-streamlined #practice #current-speaking-mode {
  background: transparent !important;
  color: inherit !important;
  padding: 0 !important;
  font: inherit !important;
}

.workspace-streamlined .workspace-detached-popup {
  position: fixed !important;
  z-index: 1201;
  overflow: auto;
  box-sizing: border-box;
  margin: 0 !important;
  padding: 12px;
  border: 1px solid #52657d;
  border-radius: 12px;
  background: #fff;
  color: #082a50;
  box-shadow: 0 8px 24px #082a5026;
  font:
    13px/1.4 system-ui,
    sans-serif;
}
.workspace-streamlined .workspace-detached-popup[hidden] {
  display: none !important;
}
.workspace-streamlined .workspace-detached-popup :is(.activity-buttons) {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.workspace-streamlined .session-menu-actions.workspace-detached-popup {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.workspace-streamlined .workspace-detached-popup button {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  font: inherit;
  text-align: start;
}
.workspace-streamlined .workspace-detached-popup .ui-icon {
  color: #005bea;
  flex: none;
}
.workspace-streamlined #workspace-more-panel #switch-learner span {
  display: inline;
}
html[data-theme='dark'].workspace-streamlined .workspace-detached-popup {
  background: #17263b;
  color: #edf4ff;
  border-color: #71849e;
}
html[data-theme='dark'].workspace-streamlined .workspace-detached-popup .ui-icon {
  color: #8dbbff;
}

@media (max-width: 700px) {
  .workspace-streamlined #practice .understand-actions button {
    padding: 8px 4px !important;
    gap: 4px !important;
    line-height: 1.3;
  }
}

/* Direct header actions requested during design review. */
html.workspace-streamlined #chat-topic-header #header-new-chat,
html.workspace-streamlined #saved-chat-sidebar #new-saved-chat {
  background: #ff6b57;
  color: #082a50;
  border: 1px solid transparent;
}
html.workspace-streamlined #chat-topic-header #header-new-chat:hover,
html.workspace-streamlined #saved-chat-sidebar #new-saved-chat:hover {
  background: #ff907e;
}
html.workspace-streamlined #chat-topic-header #header-new-chat {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  flex: 0 0 auto;
  width: auto;
  min-width: 0;
  min-height: 44px;
  margin: 0 0 0 10px;
  padding: 8px 12px;
  border-radius: 12px;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}
html.workspace-streamlined #chat-topic-header #header-new-chat[hidden] {
  display: none !important;
}
html.workspace-streamlined #chat-topic-header #header-new-chat:focus-visible,
html.workspace-streamlined .teacher-login-button:focus-visible {
  outline: 3px solid #005bea;
  outline-offset: 2px;
}
html.workspace-streamlined #chat-topic-header .chat-topic-copy {
  min-width: 0;
}
html.workspace-streamlined .workspace-menu-sources #reset {
  display: none;
}
html.workspace-streamlined .teacher-login-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  box-sizing: border-box;
  margin: 12px 0 4px;
  padding: 8px 12px;
  border: 1px solid #52657d;
  border-radius: 12px;
  background: #fff;
  color: #082a50;
  font: inherit;
  text-decoration: none;
}
html.workspace-streamlined .teacher-login-button .ui-icon {
  color: #005bea;
}
html[data-theme='dark'].workspace-streamlined .teacher-login-button {
  background: #17263b;
  color: #edf4ff;
  border-color: #71849e;
}
html[data-theme='dark'].workspace-streamlined .teacher-login-button .ui-icon {
  color: #8dbbff;
}
@media (max-width: 700px) {
  html.workspace-streamlined #chat-topic-header #header-new-chat {
    padding: 8px 10px;
    font-size: 13px;
  }
  html.workspace-streamlined #chat-topic-header .chat-topic-title-row {
    min-width: 0;
  }
  html.workspace-streamlined #active-chat-title {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  html.workspace-streamlined .header-right .theme-toggle {
    width: 44px;
    min-width: 44px;
    height: 44px;
    padding: 10px;
  }
}

/* Keep speaking setup visible above mobile keyboards, without moving the chat. */
.workspace-streamlined #practice .unified-chat #speaking-mode-menu #speaking-modes {
  position: fixed;
  inset-inline-start: auto;
  margin: 0;
  box-sizing: border-box;
  overscroll-behavior: contain;
}
@media (max-width: 1000px), (pointer: coarse) {
  #practice #speaking-modes input:not([type='checkbox']),
  #practice #speaking-modes textarea {
    font-size: max(16px, calc(13px * var(--elvi-text-scale, 1))) !important;
  }
}

/* Guided first visit uses the same compact controls and panel finish as ELVI. */
#guided-start {
  width: min(560px, calc(100vw - 32px));
  max-width: calc(100vw - 32px);
  max-height: calc(100dvh - 32px);
  padding: 20px;
  box-sizing: border-box;
  overflow: auto;
  border: 1px solid #52657d;
  border-radius: 16px;
  background: var(--cream);
  color: var(--ink);
  box-shadow: 0 12px 40px #05274f40;
  font-family: inherit;
  font-size: 13px;
}
#guided-start::backdrop {
  background: #05274f66;
}
#guided-start-title {
  font-family: inherit;
  font-size: 20px;
  line-height: 1.35;
  margin: 18px 0;
}
.guided-start-language-row {
  display: grid;
  gap: 6px;
}
#guided-start-language {
  width: 100%;
  min-width: 0;
  min-height: 44px;
  font: inherit;
  border: 1px solid #52657d;
  border-radius: 10px;
  padding: 8px 10px;
  background: var(--cream);
  color: var(--ink);
}
.guided-start-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}
#guided-start .guided-start-actions button {
  min-width: 0;
  min-height: 44px;
  white-space: normal;
  font: inherit;
  line-height: 1.4;
  padding: 10px;
}
.guided-start-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 18px;
}
#guided-start .check {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  font: inherit;
}
#guided-start-hide {
  width: 18px;
  height: 18px;
  flex: none;
}
#guided-start [data-guide-action='skip'] {
  min-height: 44px;
  padding: 8px 12px;
  font: inherit;
}
#session-notice:empty {
  display: none;
}
.workspace-streamlined #workspace-more-panel #alpha-log-toggle[hidden] {
  display: none !important;
}
.workspace-streamlined #workspace-more-panel #workspace-page-language label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px !important;
  white-space: normal;
  margin: 0;
}
.workspace-streamlined #workspace-more-panel #workspace-page-language select {
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
  min-height: 44px;
  box-sizing: border-box;
  font-size: 13px;
  padding: 8px 10px;
  margin: 0;
}
@media (max-width: 700px) {
  .guided-start-actions {
    grid-template-columns: 1fr;
  }
  #guided-start-language {
    font-size: max(16px, calc(13px * var(--elvi-text-scale, 1))) !important;
  }
}
/* Moved header controls must shed the header's icon-only and compact rules. */
.workspace-streamlined #workspace-more-panel #workspace-page-language {
  background: transparent;
  border: 0;
}
.workspace-streamlined #workspace-more-panel .page-language-label {
  position: static;
  width: auto;
  height: auto;
  margin: 0;
  overflow: visible;
  clip-path: none;
  white-space: normal;
}
.workspace-streamlined #workspace-more-panel #workspace-page-language select {
  height: auto !important;
  min-height: 44px !important;
  padding: 8px 10px !important;
}
.workspace-streamlined #workspace-more-panel #alpha-log-toggle {
  width: 100%;
  min-height: 44px;
  display: flex;
  align-items: center;
  gap: 8px;
  border: 0;
  padding: 10px;
  font: inherit;
  background: transparent;
  color: inherit;
}
@media (max-width: 1000px) {
  .workspace-streamlined #workspace-more-panel #workspace-page-language select {
    font-size: max(16px, calc(13px * var(--elvi-text-scale, 1))) !important;
  }
}
