/* Chatbot (frontend/panel/chatbot.js). Sizes and colours are the values in
   output/reference/behaviours/chatbot.md § Layout; the rules are this port's
   own. Tooltips, word tokens, the spinner and the toolbar tools are in panel.css. */

/* The page: the chat (.cb-main), and on a wide page the conversation's words in a column beside it (.cb-words). */
.cb {
  position: relative;
  display: flex;
  height: var(--page-h);
  background: var(--bg);
  /* The speakers' bubbles (the owner's chat redesign, 2026-10-22): Wovi's on the raised surface, the learner's
     lightly tinted with the accent. */
  --cb-user: color-mix(in srgb, var(--accent) 16%, var(--surface-raised));
  --cb-aria: var(--surface-raised);
}

.cb-main {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
}

.cb-main > div:empty,
.cb > div:empty {
  display: none;
}

.cb-no-llm {
  margin: 0;
  padding: 10px 24px;
  border-bottom: 1px solid oklch(from rgba(255, 128, 128, 0.35) min(l, var(--max-lightness, 1)) c h);
  background: oklch(from rgba(255, 80, 80, 0.12) min(l, var(--max-lightness, 1)) c h);
  color: oklch(from #ffb4b4 min(l, var(--max-lightness, 1)) c h);
  font-size: 14px;
  text-align: center;
}

.cb-head {
  display: flex;
  align-items: center;
  height: 34px;
  padding: 0 10px;
  border-bottom: 3px solid color-mix(in srgb, var(--ink) 6.7%, transparent);
}

/* The chat's tools in the page's app bar (chatbot.js; the owner's chat redesign, 2026-10-22): new chat, Từ with
   its count, the search, then the sentence pages' tools; the slots sit in the box as its own children. */
.cb-tools {
  display: flex;
  align-items: center;
}

.cb-tools-slot {
  display: contents;
}

.cb-new,
.cb-words-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.cb-new {
  color: var(--selected-text);
}

.cb-new > span,
.cb-words-toggle > span:not(.cb-count) {
  font: 600 14px/1 var(--font);
}

.cb-words-toggle.is-on {
  background: var(--selected);
  color: var(--selected-text);
}

.cb-words-toggle {
  position: relative;
}

.cb-count {
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  box-sizing: border-box;
  border-radius: 9px;
  background: var(--accent);
  color: var(--on-accent);
  font: 700 12px/18px var(--font);
  text-align: center;
}

/* Without its name (a small screen) the count sits on the picture's corner. */
.cb-words-toggle:not(.has-text) .cb-count {
  position: absolute;
  top: 2px;
  right: -2px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  font-size: 12px;
  line-height: 16px;
}

.cb-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
}

/* The list and, over its right edge, the search matches' marks. */
.cb-scroll-wrap {
  position: relative;
  display: flex;
  flex: 1;
  flex-direction: column;
  min-height: 0;
}

.cb-marks {
  display: contents;
}

.cb-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  min-height: 40vh;
  color: var(--text-muted);
}

/* Intro (#14–#21), compact since the owner's chat redesign (2026-10-22, canvas Se1psxah): Wovi and her greeting on
   one row, what to know in a card, the question, then the starter tiles as cards, "Chỉ Wovi" first and across. */

.cb-intro {
  display: flex;
  flex-direction: column;
  gap: 18px;
  max-width: 560px;
  margin: 0 auto;
  padding: 22px 16px 24px;
  box-sizing: border-box;
  font-size: 15px;
  animation: cb-fade 0.4s ease-out both;
}

.cb-intro p {
  margin: 0;
}

.cb-intro-hello {
  display: flex;
  align-items: center;
  gap: 14px;
}

.cb-avatar {
  display: flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--on-accent);
  animation: cb-scale 0.5s ease-out both;
}

.cb-intro-hi {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.cb-intro-title {
  margin: 0;
  color: var(--text-strong);
  font: 700 21px/28px var(--font-display);
}

.cb-intro .cb-intro-role {
  color: var(--text-label);
  font-size: 15px;
  line-height: 21px;
}

.cb-intro-notes {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px 14px;
  border-radius: 16px;
  background: var(--surface-raised);
  border: var(--card-border);
  box-shadow: var(--card-shadow);
}

.cb-intro .cb-intro-note {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  color: var(--text-label);
  font-size: 14px;
  line-height: 20px;
}

.cb-intro-note > svg {
  flex: none;
  color: var(--accent);
}

.cb-intro-same {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
}

.cb-intro .cb-warn-text {
  color: var(--danger);
  font-weight: 500;
}

.cb-change {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border: 1px solid color-mix(in srgb, var(--accent) 40%, transparent);
  border-radius: 18px;
  background: color-mix(in srgb, var(--accent) 10%, transparent);
  color: var(--selected-text);
  font: 500 14px/1.4 var(--font);
  cursor: pointer;
}

.cb-change:hover {
  background: color-mix(in srgb, var(--accent) 16%, transparent);
}

.cb-intro-ask {
  margin: 0;
  color: var(--text-strong);
  font: 600 16px/22px var(--font-display);
}

.cb-tiles {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  animation: cb-rise 0.5s ease-out 0.1s both;
}

.cb-tile {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 6px;
  min-height: 76px;
  padding: 10px 14px;
  box-sizing: border-box;
  border: 0;
  border-radius: 16px;
  background: var(--surface-raised);
  color: var(--text);
  text-align: left;
  cursor: pointer;
  animation: cb-fade 0.4s ease-out both;
}

.cb-tile:hover {
  background: color-mix(in srgb, var(--accent) 7%, var(--surface-raised));
}

/* "Chỉ Wovi": the chat as it is, the main way in. */
.cb-tile.is-main {
  grid-column: 1 / -1;
  flex-direction: row;
  align-items: center;
  gap: 12px;
  min-height: 56px;
  background: var(--accent);
  color: var(--on-accent);
  box-shadow: var(--block-shadow);
}

.cb-tile.is-main:hover {
  background: var(--accent-hover);
}

.cb-tile-go {
  margin-left: auto;
}

/* A tile's picture: a Material Symbol in the brand's blue (owner, 2026-10-21). */
.cb-tile-art {
  display: flex;
  color: var(--accent);
}

.cb-tile.is-main .cb-tile-art {
  color: inherit;
}

.cb-tile-label {
  max-width: 100%;
  overflow: hidden;
  font: 600 15px/1.3 var(--font);
  text-overflow: ellipsis;
  white-space: nowrap;
}

@keyframes cb-fade {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes cb-scale {
  from { opacity: 0; transform: scale(0.85); }
  to { opacity: 1; transform: scale(1); }
}

@keyframes cb-rise {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
  .cb-intro,
  .cb-avatar,
  .cb-tiles,
  .cb-tile {
    animation: none;
  }
}

/* Starter sub-tiles (#21) */
.dialog.cb-pick {
  width: min(420px, calc(100vw - 32px));
  padding: 0;
  border: 1px solid oklch(from rgba(0, 191, 255, 0.2) min(l, var(--max-lightness, 1)) c h);
  border-radius: 12px;
  background: var(--surface-raised);
}

.cb-pick-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 12px 0 20px;
}

.cb-pick-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  padding: 16px;
}

.cb-pick .cb-tile {
  background: color-mix(in srgb, var(--ink) 5%, transparent);
}

.cb-pick .dialog-actions {
  padding: 0 15px 15px;
}

/* The sentence list as speech bubbles (#48–#52; the owner's chat redesign, 2026-10-22, canvas Se1psxah) ------- */

.cb-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-width: 760px;
  margin: 0 auto;
  padding: 12px 12px 24px;
}

.cb-msg {
  display: flex;
  gap: 8px;
  align-items: flex-start;
}

/* The day and hour over a part of the conversation (bubbles.js). */
.cb-when {
  align-self: center;
  margin: 4px 0 -4px;
  color: var(--text-muted);
  font: 600 12px/1.4 var(--font);
}

.cb-msg.is-user {
  justify-content: flex-end;
}

.cb-msg-main {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  min-width: 0;
  max-width: min(560px, 100%);
}

.cb-msg.is-user .cb-msg-main {
  align-items: flex-end;
}

/* Wovi's face beside her messages. */
.cb-face {
  display: flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  margin-top: 4px;
  border-radius: 50%;
  background: var(--selected);
  color: var(--selected-text);
}

.cb-bubble {
  display: flex;
  flex-direction: column;
  gap: 2px;
  max-width: 100%;
  padding: 4px;
  border-radius: 6px 20px 20px;
  background: var(--cb-aria);
  box-shadow: 0 1px 2px color-mix(in srgb, var(--ink) 6%, transparent);
}

.cb-msg.is-user .cb-bubble {
  border-radius: 20px 20px 6px;
  background: var(--cb-user);
  box-shadow: none;
}

.cb-row {
  position: relative;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  align-items: start;
  padding: 3px 10px 5px 0;
  border-radius: 16px;
  cursor: pointer;
}

.cb-row.is-current {
  background: var(--selected);
}

.cb-msg.is-user .cb-row.is-current {
  background: color-mix(in srgb, var(--accent) 14%, transparent);
}

/* A saved sentence keeps room for its heart. */
.cb-row.is-saved {
  padding-right: 40px;
}

/* In a bubble the heart says a sentence is saved, not the lists' yellow line (panel.css). */
.cb-row.sentence-row.is-saved {
  box-shadow: none;
}

.cb-play {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 40px;
  padding: 0;
  border: 0;
  background: none;
  color: color-mix(in srgb, var(--ink) 62%, transparent);
  cursor: pointer;
}

.cb-row.is-current .cb-play,
.cb-msg.is-user .cb-play {
  color: var(--selected-text);
}

.cb-body {
  min-width: 0;
  padding-top: 4px;
}

.cb-text {
  line-height: 29px;
}

.cb-trans {
  margin-top: 1px;
  color: color-mix(in srgb, var(--ink) 68%, transparent);
  font-size: 15px;
  line-height: 22px;
}

.cb-plain {
  cursor: help;
}

/* A sentence's own buttons, the heart, copy and ⋯, in a row under the sentence playing or last played (and the one
   with the keys), as the canvas draws them; a saved sentence's heart stays in its corner. */
.cb-row .cb-side {
  display: none;
  grid-column: 2;
  justify-self: end;
  margin-top: 2px;
}

.cb-row.is-current .cb-side,
.cb-row:focus-within .cb-side {
  display: flex;
}

.cb-row.is-saved:not(.is-current):not(:focus-within) .cb-side {
  position: absolute;
  top: 2px;
  right: 2px;
  display: flex;
  margin: 0;
}

.cb-row.is-saved:not(.is-current):not(:focus-within) .cb-side > :not(.cb-heart) {
  display: none;
}

.cb-heart,
.cb-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 34px;
  padding: 0;
  border: 0;
  border-radius: 17px;
  background: none;
  color: color-mix(in srgb, var(--ink) 62%, transparent);
  cursor: pointer;
}

.cb-heart {
  color: var(--heart);
}

.cb-heart:hover,
.cb-icon:hover {
  background: var(--hover);
}

.cb-heart.is-on {
  color: var(--heart);
}

/* Under a learner's message: what the server did to it (#51, #52), a chip that opens a card. */
.cb-change-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 34px;
  padding: 0 8px 0 10px;
  border: 0;
  border-radius: 17px;
  background: color-mix(in srgb, var(--success) 12%, var(--surface-raised));
  color: var(--success);
  font: 600 13px/1.3 var(--font);
  cursor: pointer;
}

.cb-change-what {
  font-weight: 500;
}

.cb-change-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: min(340px, 100%);
  box-sizing: border-box;
  padding: 4px 14px 14px;
  border-radius: 16px;
  background: var(--surface-raised);
  box-shadow: var(--card-shadow);
  border: var(--card-border);
}

.cb-change-card .cb-change-chip {
  justify-content: flex-start;
  margin: 0 -8px 0 -10px;
  background: none;
  font-size: 14px;
}

.cb-change-card .cb-change-chip > svg:last-child {
  margin-left: auto;
}

.cb-change-lines {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: baseline;
  gap: 6px 10px;
  margin: 0;
}

.cb-change-lines dt {
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

.cb-change-lines dd {
  margin: 0;
  color: var(--text);
  font-size: 17px;
  line-height: 1.5;
}

.cb-removed {
  padding: 0 2px;
  border-radius: 4px;
  background: color-mix(in srgb, var(--danger) 14%, transparent);
  color: var(--danger);
}

.cb-added {
  padding: 0 2px;
  border-radius: 4px;
  background: color-mix(in srgb, var(--success) 14%, transparent);
  color: var(--success);
  font-weight: 500;
  text-decoration: none;
}

.cb-change-why,
.cb-change-original {
  margin: 0;
  color: var(--text-label);
  font-size: 14px;
  line-height: 21px;
}

.cb-change-original {
  color: var(--text);
  font-size: 16px;
}

/* The input (#67, #45) ------------------------------------------------------------- */

/* Under the list on every screen (the owner's chat redesign, 2026-10-22), the list's width. */
.cb-input {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  max-width: 760px;
  margin: 0 auto;
  padding: 6px 12px 16px;
  box-sizing: border-box;
}

.cb-input.is-small {
  padding: 6px 12px 10px;
}

.cb-input-lead:empty {
  display: none;
}

/* A big screen's play button at the input's start, in place of the reference's big round one (#58): ▶ or ⏸ in the
   brand's blue, the hold shown as the band showed it (#57). */
.cb-play-main {
  display: flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--accent);
  color: var(--on-accent);
  cursor: pointer;
}

.cb-play-main[hidden] {
  display: none;
}

.cb-play-main.is-armed,
.cb-strip-play.is-armed {
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--success) 55%, transparent);
}

.cb-play-main.is-held,
.cb-strip-play.is-held {
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--danger) 70%, transparent);
}

/* The playback strip on a phone or a touch screen (strip.js), over the input: the speed, ⏮ ▶ ⏭, auto-pause. */
.cb-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: calc(100% - 24px);
  max-width: 736px;
  height: 52px;
  margin: 6px auto 0;
  padding: 0 6px;
  box-sizing: border-box;
  border-radius: 26px;
  background: var(--surface-raised);
  box-shadow: 0 1px 3px color-mix(in srgb, var(--ink) 10%, transparent);
}

.cb-strip[hidden],
.cb.is-typing .cb-strip {
  display: none;
}

.cb-strip-speed,
.cb-strip-nav {
  display: flex;
  align-items: center;
}

.cb-strip-nav {
  gap: 6px;
}

.cb-strip-button,
.cb-strip-play {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: none;
  color: var(--text-strong);
  cursor: pointer;
}

.cb-strip-play {
  background: var(--accent);
  color: var(--on-accent);
}

.cb-strip-ap {
  padding-right: 6px;
}

.cb-esc {
  margin-right: 12px;
  padding: 1px 5px;
  border: 1px solid currentColor;
  border-radius: 4px;
  font: 700 12px/16px var(--font);
  opacity: 0.35;
  cursor: help;
}

.cb-esc:hover {
  opacity: 0.5;
}

.cb-pill {
  display: flex;
  align-items: flex-end;
  width: 600px;
  max-width: 100%;
  min-height: 48px;
  padding-left: 16px;
  border: 1px solid color-mix(in srgb, var(--ink) 10%, transparent);
  border-radius: 24px;
  background: var(--field-bg);
}

.cb-pill:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 20%, transparent);
}

.cb-field {
  flex: 1;
  min-height: 46px;
  padding: 11px 0;
  border: 0;
  background: none;
  color: var(--text-strong);
  font: 400 17px/24px var(--font);
  resize: none;
  outline: none;
}

/* Send and the microphone: round buttons in the brand's blue at the pill's end (the owner's chat redesign). */
.cb-send,
.cb-mic {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  margin: 3px;
  border: 0;
  border-radius: 50%;
  background: var(--accent);
  color: var(--on-accent);
  cursor: pointer;
}

.cb-mic:disabled {
  background: color-mix(in srgb, var(--ink) 8%, transparent);
  color: color-mix(in srgb, var(--ink) 35%, transparent);
  cursor: not-allowed;
}

.cb-mic-wrap {
  display: inline-flex;
}

.cb-pill.is-busy {
  align-items: center;
  justify-content: center;
  padding-left: 0;
}

.cb-dots {
  display: inline-flex;
  gap: 6px;
}

.cb-dots span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: oklch(from #00bfff min(l, var(--max-lightness, 1)) c h);
  animation: cb-pulse 1.4s ease-in-out infinite;
}

.cb-dots span:nth-child(2) {
  animation-delay: 0.16s;
}

.cb-dots span:nth-child(3) {
  animation-delay: 0.32s;
}

@keyframes cb-pulse {
  0%, 80%, 100% { opacity: 0.25; transform: scale(0.8); }
  40% { opacity: 1; transform: scale(1); }
}

.cb-ap-on {
  color: oklch(from #14ff00 min(l, var(--max-lightness, 1)) c h);
}

.cb-tool-warn {
  margin: 0 6px;
}

/* Settings tab: Aria's memory (#79–#86) --------------------------------------------- */

.cb-settings {
  max-width: 500px;
  margin: 0 auto;
  padding: 32px 24px;
}

.cb-settings-title {
  margin: 0 0 8px;
  font-size: 20px;
  font-weight: 500;
}

.cb-settings-intro {
  margin: 0 0 16px;
  color: var(--text-muted);
  font-size: 14px;
}

.cb-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 12px;
}

.cb-chips-gap {
  flex: 1;
}

.cb-chip {
  padding: 2px 10px;
  border: 1px solid color-mix(in srgb, var(--ink) 20%, transparent);
  border-radius: 12px;
  background: none;
  color: var(--text);
  font: 500 13px/20px var(--font);
  cursor: pointer;
}

.cb-chip.is-on {
  border-color: transparent;
  background: var(--selected);
}

.cb-memories {
  max-height: max(340px, calc(100vh - 430px));
  margin: 0;
  padding: 0 12px;
  overflow-y: auto;
  border: 1px solid color-mix(in srgb, var(--ink) 10%, transparent);
  border-radius: 8px;
  list-style: none;
}

.cb-memory {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  padding: 8px 0;
  border-bottom: 1px solid color-mix(in srgb, var(--ink) 6%, transparent);
}

.cb-memory:last-child {
  border-bottom: 0;
}

.cb-memory-text {
  flex: 1 1 60%;
  font-size: 14px;
}

.cb-subject,
.cb-date {
  display: inline-flex;
  align-items: center;
  height: 18px;
  padding: 0 6px;
  border-radius: 9px;
  font-size: 12px;
}

.cb-subject.is-user {
  background: rgba(91, 141, 214, 0.25);
}

.cb-subject.is-aria {
  background: color-mix(in srgb, var(--wovia-yellow) 25%, transparent);
}

.cb-date {
  background: color-mix(in srgb, var(--ink) 6%, transparent);
  color: color-mix(in srgb, var(--ink) 45%, transparent);
}

.cb-memory.is-editing {
  flex-direction: column;
  align-items: stretch;
}

.cb-memory-field {
  padding: 6px 8px;
  border: 1px solid var(--field-border);
  border-radius: 6px;
  background: var(--field-bg);
  color: var(--text);
  font: 400 14px/1.4 var(--font);
  resize: vertical;
}

.cb-memory-actions {
  display: flex;
  justify-content: flex-end;
}

.cb-memory-state {
  color: var(--text-muted);
}

.cb-memory-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 10px;
  color: color-mix(in srgb, var(--ink) 40%, transparent);
  font-size: 13px;
}

.cb-forget-all {
  border: 0;
  background: none;
  color: var(--danger);
  font: 500 13px/1 var(--font);
  cursor: pointer;
}

/* A memory stays on one line; its text wraps in its own cell. */
.cb-memory {
  flex-wrap: nowrap;
  align-items: flex-start;
}

.cb-memory .cb-subject,
.cb-memory .cb-date {
  flex: none;
  margin-top: 1px;
}

.cb-memory-text {
  flex: 1 1 auto;
  min-width: 0;
}

.cb-memory.is-editing {
  flex-wrap: wrap;
}

/* What the server could not do for a message (translations, the correction), under its bubble. */
.cb-note {
  margin: 0;
  padding: 0 8px;
  color: var(--danger);
  font-size: 13px;
}

/* Recording (#70) and the recorded clip (#71) */
.cb-rec,
.cb-clip {
  display: flex;
  flex: 1;
  align-items: center;
  gap: 10px;
  min-height: 46px;
}

.cb-pill.is-recording {
  border-color: oklch(from rgba(239, 69, 101, 0.5) min(l, var(--max-lightness, 1)) c h);
}

.cb-rec-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #ef4565;
  animation: cb-blink 1.3s infinite;
}

@keyframes cb-blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.2; }
}

.cb-rec-time {
  color: oklch(from #ef4565 min(l, var(--max-lightness, 1)) c h);
  font: 400 13px/1 ui-monospace, monospace;
}

.cb-clip .cb-rec-time {
  color: var(--text-muted);
}

.cb-clip-wave {
  display: flex;
  flex: 1;
}

.cb-pill.is-recording .cb-mic {
  background: oklch(from #ef4565 min(l, var(--max-lightness, 1)) c h);
  color: var(--on-accent);
  animation: cb-mic-pulse 1.2s infinite;
}

@keyframes cb-mic-pulse {
  0% { box-shadow: 0 0 0 0 rgba(239, 69, 101, 0.35); }
  100% { box-shadow: 0 0 0 6px rgba(239, 69, 101, 0); }
}

/* One sentence at a time (single.js; pageframe-words.md #53–#58) ---------------- */

.cb.is-single .cb-head {
  gap: 12px;
}

.cb-timeline {
  flex: 1;
  min-width: 100px;
  height: 20px;
  margin: 0 12px;
}

.cb-single {
  min-height: 100%;
  box-sizing: border-box;
  padding: 8px 0 20px;
}

.cb-single-speaker {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding-top: 14px;
  color: color-mix(in srgb, var(--ink) 66.7%, transparent);
  font-size: 13px;
  opacity: 0.75;
}

.cb-single-speaker > span {
  display: inline-flex;
}

/* The speaker's colour under the sentence (#54); the rest of the card is the
   sentence pages' one-at-a-time view (panel/single-line.js, .sl-* in panel.css). */
.cb-single-card.is-user {
  background: var(--cb-user);
}

.cb-single-card.is-aria {
  background: var(--cb-aria);
}

.cb-input[hidden] {
  display: none;
}

/* The past conversations (history.js; S720, the owner's chat redesign, 2026-10-22): a column on the chat's left on a
   wide page, over the whole chat on a narrower one. ----------------------------------------------------------- */

.cb-history {
  display: flex;
  flex: none;
  flex-direction: column;
  width: 300px;
  min-height: 0;
  border-right: 1px solid var(--line);
  background: var(--surface);
}

.cb-history[hidden] {
  display: none;
}

.cb.is-history-page .cb-history {
  position: absolute;
  inset: 0;
  z-index: 4;
  width: auto;
  border-right: 0;
  background: var(--bg);
}

.cb-history-head {
  display: flex;
  flex: none;
  align-items: center;
  gap: 4px;
  height: 52px;
  padding: 0 10px 0 4px;
  border-bottom: 1px solid var(--line-soft);
  background: var(--surface);
}

.cb-history-close {
  width: 44px;
  height: 44px;
}

.cb-history-name {
  flex: 1;
  min-width: 0;
  margin: 0;
  overflow: hidden;
  color: var(--text-strong);
  font: 700 18px/1.2 var(--font-display);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cb-history-new {
  display: inline-flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 0;
  border-radius: 20px;
  background: var(--accent);
  color: var(--on-accent);
  font: 600 14px/1 var(--font);
  white-space: nowrap;
  cursor: pointer;
  box-shadow: var(--block-shadow);
}

.cb-history-find {
  display: flex;
  flex: none;
  align-items: center;
  gap: 8px;
  height: 40px;
  margin: 12px 12px 4px;
  padding: 0 12px;
  border-radius: 12px;
  background: var(--pill-bg);
  color: var(--text-muted);
}

.cb-history-search {
  flex: 1;
  min-width: 0;
  border: 0;
  background: none;
  color: var(--text);
  font: 400 15px/1.2 var(--font);
  outline: none;
}

.cb-history-body {
  flex: 1;
  min-height: 0;
  padding: 0 12px 16px;
  overflow-y: auto;
}

.cb-history-day {
  margin: 14px 4px 6px;
  color: var(--text-muted);
  font: 600 13px/1.2 var(--font);
}

.cb-history-list {
  margin: 0;
  padding: 0;
  overflow: hidden;
  border-radius: 16px;
  background: var(--surface-raised);
  list-style: none;
  border: var(--card-border);
  box-shadow: var(--card-shadow);
}

.cb-history-row {
  position: relative;
  display: flex;
  align-items: center;
  border-top: 1px solid var(--line-soft);
}

.cb-history-row:first-child {
  border-top: 0;
}

.cb-history-row.is-open {
  background: var(--selected);
}

.cb-history-entry {
  display: grid;
  flex: 1;
  grid-template-columns: 36px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  min-width: 0;
  padding: 10px 4px 10px 12px;
  border: 0;
  background: none;
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.cb-history-mark {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--selected);
  color: var(--selected-text);
}

.cb-history-row.is-open .cb-history-mark {
  background: var(--accent);
  color: var(--on-accent);
}

.cb-history-text {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}

.cb-history-title,
.cb-history-preview {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cb-history-title {
  color: var(--text-strong);
  font: 600 15px/1.35 var(--font);
}

.cb-history-preview {
  color: var(--text-muted);
  font-size: 14px;
  line-height: 1.35;
}

.cb-history-when {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  color: var(--text-muted);
  font-size: 12px;
  white-space: nowrap;
}

.cb-history-note {
  font-size: 12px;
  font-weight: 600;
}

.cb-history-row.is-open .cb-history-note {
  color: var(--selected-text);
}

.cb-history-more {
  flex: none;
  width: 40px;
  height: 40px;
  margin-right: 4px;
}

.cb-history-state {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 24px 4px;
  color: var(--text-muted);
}

.cb-history-state.is-error {
  color: var(--danger);
}

.cb-history-toggle.is-on {
  background: var(--selected);
  color: var(--selected-text);
}

/* The conversation's words (chatbot.js drawWords; the owner's chat redesign, 2026-10-22): a column beside the chat on
   a wide page, a sheet over it from the bottom on a narrower one. ------------------------------------------------ */

.cb-words {
  display: flex;
  flex: none;
  flex-direction: column;
  width: 360px;
  min-height: 0;
  border-left: 1px solid var(--line);
  background: var(--surface);
}

.cb-words[hidden],
.cb-words-backdrop[hidden] {
  display: none;
}

.cb-words-head {
  display: flex;
  flex: none;
  align-items: center;
  justify-content: space-between;
  height: 52px;
  padding: 0 6px 0 16px;
  border-bottom: 1px solid var(--line-soft);
}

.cb-words-title {
  margin: 0;
  color: var(--text-strong);
  font: 700 18px/1 var(--font-display);
}

.cb-words-count {
  color: var(--text-muted);
  font: 500 14px/1 var(--font);
}

.cb-words-close {
  width: 44px;
  height: 44px;
}

.cb-words-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
}

.cb.is-words-sheet .cb-words {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 3;
  width: auto;
  height: 78%;
  border-left: 0;
  border-radius: 20px 20px 0 0;
  box-shadow: 0 -4px 20px color-mix(in srgb, var(--ink) 14%, transparent);
}

/* The sheet's grip, as a phone's sheets have. */
.cb.is-words-sheet .cb-words::before {
  content: "";
  align-self: center;
  width: 36px;
  height: 5px;
  margin-top: 8px;
  border-radius: 3px;
  background: var(--line-strong);
}

.cb-words-backdrop {
  position: absolute;
  inset: 0;
  z-index: 2;
  padding: 0;
  border: 0;
  background: color-mix(in srgb, #000 32%, transparent);
  cursor: default;
}

/* The conversation's words (words-tab.js; the owner's chat redesign, 2026-10-22, canvas Se1psxah): the chips and the
   order, then a row per word. ------------------------------------------------------------------------------------ */

.cb-wt {
  padding-bottom: 16px;
}

.cb-wt-center {
  display: flex;
  justify-content: center;
  padding: 24px 16px;
}

.cb-wt-chips {
  position: sticky;
  top: 0;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line-soft);
  background: var(--surface);
}

.cb-wt-chip-row {
  display: flex;
  flex: 1 1 auto;
  gap: 4px;
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: none;
}

.cb-wt-chip {
  display: inline-flex;
  flex: none;
  align-items: center;
  gap: 4px;
  height: 32px;
  padding: 0 10px;
  border: 0;
  border-radius: 16px;
  background: var(--pill-bg);
  color: var(--text);
  font: 500 13px/1 var(--font);
  white-space: nowrap;
  cursor: pointer;
}

.cb-wt-chip.is-on {
  background: var(--text-strong);
  color: var(--surface);
  font-weight: 600;
}

.cb-wt-chip-count {
  opacity: 0.7;
}

.cb-wt-order select {
  height: 32px;
  padding: 0 8px;
  border: 1px solid var(--field-border);
  border-radius: 16px;
  background: var(--field-bg);
  color: var(--text);
  font: 500 13px/1 var(--font);
}

.cb-wt-items {
  margin: 0;
  padding: 0 8px;
  list-style: none;
}

.cb-wt-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  padding: 8px 4px 8px 12px;
  border-bottom: 1px solid var(--line-soft);
}

.cb-wt-main {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}

.cb-wt-head {
  display: flex;
  align-items: baseline;
  gap: 8px;
  min-width: 0;
}

.cb-wt-cell {
  font-size: 20px;
  line-height: 1.35;
  white-space: nowrap;
}

.cb-wt-reading {
  color: var(--text-muted);
  font-size: 13px;
  white-space: nowrap;
}

.cb-wt-level {
  padding: 1px 6px;
  border-radius: 6px;
  background: color-mix(in srgb, var(--success) 12%, transparent);
  color: var(--success);
  font: 600 12px/1.4 var(--font);
  white-space: nowrap;
}

.cb-wt-meaning {
  min-height: 20px;
  overflow: hidden;
  color: var(--text-label);
  font-size: 14px;
  line-height: 20px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cb-wt-marks {
  display: flex;
  gap: 2px;
}

.cb-wt-stage {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: none;
  cursor: pointer;
}

.cb-wt-stage.is-known {
  color: var(--success);
}

.cb-wt-stage.is-learning {
  color: var(--saved-text);
}

.cb-wt-stage.is-known.is-active {
  background: color-mix(in srgb, var(--success) 14%, transparent);
}

.cb-wt-stage.is-learning.is-active {
  background: color-mix(in srgb, var(--saved) 30%, transparent);
}

.cb-wt-stage:hover {
  background: var(--hover);
}

.cb-wt-none {
  margin-top: 20px;
  color: var(--text-muted);
  font-size: 13px;
  text-align: center;
}

/* The document the chat is about (focus-chip.js; chatbot.md #35; Chat:L6466–6504): MUI's small chip on a tint of the brand's blue (the reference's purple). */
.cb-focus-slot {
  display: flex;
  flex-shrink: 0;
  justify-content: center;
  padding: 6px 12px 0;
}

.cb-focus-slot:empty {
  display: none;
}

.cb-focus-chip {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  min-width: 0;
  height: 24px;
  border-radius: 16px;
  background: color-mix(in srgb, var(--wovia-blue) 18%, transparent);
  color: color-mix(in srgb, var(--ink) 86.7%, transparent);
  font-size: 13px;
}

.cb-focus-icon {
  flex: none;
  margin: 0 -2px 0 5px;
}

.cb-focus-label {
  overflow: hidden;
  padding: 0 8px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cb-focus-clear {
  display: flex;
  flex: none;
  margin: 0 5px 0 -6px;
  padding: 0;
  border: 0;
  background: none;
  color: color-mix(in srgb, var(--ink) 26%, transparent);
  cursor: pointer;
}

.cb-focus-clear:hover {
  color: var(--selected-text);
}
