/* 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. */

.cb {
  position: relative;
  display: flex;
  flex-direction: column;
  height: var(--page-h);
  background: var(--bg);
  /* The speakers' bubbles, the reference's #2b4c7e and #282c32 on its dark ground: a raised
     surface, the learner's tinted with the accent; a sentence not playing shows them at 60%. */
  --cb-user: color-mix(in srgb, var(--accent) 40%, var(--surface-raised));
  --cb-aria: var(--surface-raised);
}

.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);
}

.cb-new {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-left: 10px;
  padding: 2px 8px;
  border: 0;
  border-radius: 4px;
  background: none;
  color: var(--accent-soft);
  font: 600 14px/1 var(--font);
  cursor: pointer;
}

.cb-new:hover {
  background: color-mix(in srgb, var(--wovia-blue) 8%, transparent);
  color: var(--wovia-blue);
}

.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) ------------------------------------------------------------ */

.cb-intro {
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: 540px;
  margin: 0 auto;
  padding: 20px 12px 40px;
  font-size: 16px;
  text-align: center;
  animation: cb-fade 0.5s ease-out both;
}

.cb-intro p {
  margin: 0;
  padding-top: 20px;
  opacity: 0.9;
}

.cb-intro .cb-intro1 {
  padding-top: 0;
  font-size: 17px;
  line-height: 1.6;
  opacity: 0.95;
}

.cb-avatar {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 180px;
  height: 180px;
  margin-bottom: 16px;
  border: 2px solid oklch(from rgba(0, 191, 255, 0.2) min(l, var(--max-lightness, 1)) c h);
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, var(--wovia-blue-deep), color-mix(in srgb, var(--wovia-blue-deep) 30%, var(--surface)) 70%);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  color: var(--wovia-blue-light);
  animation: cb-scale 0.6s ease-out both;
}

@media (max-width: 600px) {
  .cb-avatar {
    width: 140px;
    height: 140px;
  }
}

.cb-intro-same {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.cb-intro .cb-warn-text {
  padding-top: 8px;
  color: oklch(from #ff8888 min(l, var(--max-lightness, 1)) c h);
  font-weight: 500;
}

.cb-change {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 12px;
  padding: 6px 14px;
  border: 1px solid oklch(from rgba(0, 191, 255, 0.3) min(l, var(--max-lightness, 1)) c h);
  border-radius: 6px;
  background: oklch(from rgba(0, 191, 255, 0.1) min(l, var(--max-lightness, 1)) c h);
  color: oklch(from #00bfff min(l, var(--max-lightness, 1)) c h);
  font: 500 14px/1.4 var(--font);
  cursor: pointer;
  transition: transform 0.2s, background-color 0.2s, border-color 0.2s;
}

.cb-change:hover {
  border-color: oklch(from rgba(0, 191, 255, 0.6) min(l, var(--max-lightness, 1)) c h);
  background: oklch(from rgba(0, 191, 255, 0.15) min(l, var(--max-lightness, 1)) c h);
  transform: translateY(-2px);
}

.cb-intro .cb-memory-note {
  font-size: 14px;
  opacity: 0.75;
}

.cb-tiles {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  width: 350px;
  max-width: 100%;
  margin-top: 24px;
  padding: 8px 8px 50px;
  animation: cb-rise 0.7s ease-out 0.2s both;
}

.cb-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  width: 106px;
  margin-bottom: 12px;
  padding: 6px;
  border: 0;
  border-radius: 10px;
  background: none;
  color: var(--text);
  cursor: pointer;
  animation: cb-fade 0.5s ease-out both;
  transition: transform 0.2s;
}

.cb-tile:hover {
  transform: translateY(-4px);
}

.cb-tile-art {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 70px;
  height: 70px;
  border: 1px solid color-mix(in srgb, var(--ink) 10%, transparent);
  border-radius: 50%;
  background: color-mix(in srgb, var(--ink) 5%, transparent);
  font-size: 32px;
  opacity: 0.85;
  transition: border-color 0.2s;
}

.cb-tile:hover .cb-tile-art {
  border-color: oklch(from rgba(0, 191, 255, 0.5) min(l, var(--max-lightness, 1)) c h);
}

.cb-tile-label {
  font-size: 14px;
  font-weight: 500;
}

@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(16px); }
  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: flex;
  flex-wrap: wrap;
  justify-content: center;
  padding: 16px;
}

.cb-pick .cb-tile-art {
  width: 90px;
  height: 90px;
  font-size: 40px;
}

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

/* The sentence list (#48–#52) ---------------------------------------------------- */

.cb-list {
  display: flex;
  flex-direction: column;
  max-width: 715px;
  margin: 0 auto;
  padding: 8px 90px 24px;
}

.cb-list:has(.layout-show_translations_horiz) {
  max-width: 1100px;
}

@media (max-width: 900px) {
  .cb-list {
    padding: 8px 10px 24px;
  }
}

.cb-row {
  position: relative;
  display: flex;
  align-items: stretch;
  margin-top: 4px;
  border-radius: 4px;
  cursor: pointer;
}

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

.cb-row.is-aria {
  background: color-mix(in srgb, var(--cb-aria) 60%, transparent);
}

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

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

.cb-row.is-first {
  border-top-left-radius: 16px;
  border-top-right-radius: 16px;
}

.cb-row.is-last {
  margin-bottom: 9px;
  border-bottom-left-radius: 16px;
  border-bottom-right-radius: 16px;
}

/* The speaker's side of a message's last corner. */
.cb-row.is-user.is-last {
  border-bottom-right-radius: 4px;
}

.cb-row.is-aria.is-last {
  border-bottom-left-radius: 4px;
}

.cb-row.is-last::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: -6px;
  left: 36px;
  height: 1px;
  background: color-mix(in srgb, var(--ink) 5%, transparent);
}

/* Wovi's face (#49; ix:L116850–116876): left of her first sentence on a big screen, above it with the message's copy on a small one;
   the brand's yellow (--saved, its gold on a light ground), Wovi's colour beside the learner's blue (single.js, timeline.js). */
.cb-aria-mark {
  display: flex;
  color: var(--saved);
  pointer-events: none;
}

.cb-row > .cb-aria-mark {
  position: absolute;
  top: 6px;
  left: -38px;
  opacity: 0.75;
}

.cb-aria-head {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-bottom: 2px;
  padding-left: 16px;
  opacity: 0.75;
}

/* The learner's delete under the message on a small screen (ix:L116877–116905). */
.cb-row-after {
  display: flex;
  justify-content: flex-end;
  margin-top: 3px;
  padding-right: 6px;
}

/* While the input has the keys the face and the message's buttons dim (the list's `focused`, Chat L6529). */
.cb:has(.cb-field:focus) .cb-row > .cb-aria-mark,
.cb:has(.cb-field:focus) .cb-aria-head,
.cb:has(.cb-field:focus) .cb-outside,
.cb:has(.cb-field:focus) .cb-row-after {
  opacity: 0.5;
}

.cb-play {
  display: flex;
  flex: 0 0 48px;
  align-items: flex-start;
  justify-content: center;
  padding: 6px 0 0;
  border: 0;
  background: none;
  color: color-mix(in srgb, var(--ink) 55%, transparent);
  cursor: pointer;
}

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

.cb-body {
  flex: 1;
  min-width: 0;
  padding: 3px 0;
}

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

.cb-trans {
  color: color-mix(in srgb, var(--ink) 72%, transparent);
  font-size: 15px;
  line-height: 26px;
}

.cb-row.is-user .cb-trans {
  background: color-mix(in srgb, var(--bg) 26.7%, transparent);
}

.cb-row.is-aria .cb-trans {
  background: color-mix(in srgb, var(--bg) 46.7%, transparent);
}

/* Side by side: the translation beside the sentence (the reference's default). */
.layout-show_translations_horiz .cb-body {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  padding: 0;
}

.layout-show_translations_horiz .cb-text {
  padding: 3px 0;
}

.layout-show_translations_horiz .cb-trans {
  padding: 3px 22px 3px 16px;
  font-size: 16px;
  line-height: 27px;
}

.layout-show_translations_vert .cb-trans {
  margin-top: 2px;
  padding: 0 8px;
  border-radius: 4px;
}

.cb-plain {
  cursor: help;
}

.cb-side {
  display: flex;
  flex: 0 0 43px;
  flex-direction: column;
  align-items: center;
  padding-top: 2px;
}

.cb-star,
.cb-icon {
  display: flex;
  padding: 3px;
  border: 0;
  border-radius: 50%;
  background: none;
  color: color-mix(in srgb, var(--ink) 26.7%, transparent);
  cursor: pointer;
}

.cb-star:hover,
.cb-icon:hover {
  background: var(--hover);
  color: var(--selected-text);
}

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

/* Correction (#51) */
.cb-fix {
  position: relative;
  top: 3px;
  display: inline-flex;
  margin-left: 18px;
  opacity: 0.45;
  cursor: help;
}

.cb-fix:hover,
.cb-fix:focus-visible {
  opacity: 0.8;
}

.cb-fix-tip {
  padding: 4px 8px;
  white-space: pre-wrap;
}

.cb-added {
  background: #070;
}

.cb-removed {
  background: #a00;
  text-decoration: line-through;
}

.cb-fix-why {
  max-width: 300px;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid color-mix(in srgb, var(--on-inverse) 20%, transparent);
  color: color-mix(in srgb, var(--on-inverse) 86.7%, transparent);
  font-size: 0.9em;
}

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

.cb-input {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 18px;
  padding: 10px 16px 20px;
  background: linear-gradient(transparent, var(--bg) 10px);
}

/* A small screen's bar (Chat L2536–2548): no side margin, a tint fading up. */
.cb-input.is-small {
  margin: 0;
  background: linear-gradient(180deg, #6666ff10, #6666ff00 60%);
}

/* Floating over the list once the chat started (#73): a blurred pill; the list's end and the band keep above it. */
.cb-input.is-floating {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 1;
  background: #6666ff10;
}

.cb-input.is-floating .cb-pill {
  background: color-mix(in srgb, var(--bg) 72%, transparent);
  backdrop-filter: blur(14px);
}

.cb.is-floating-input .cb-scroll {
  padding-bottom: var(--cb-input-h, 0px);
}

.cb.is-floating-input.has-band .cb-scroll {
  padding-bottom: calc(130px + var(--cb-input-h, 0px));
}

.cb.is-floating-input .gb {
  bottom: var(--cb-input-h, 0px);
  transition: bottom 0.15s ease-out;
}

.cb-esc {
  margin-right: 12px;
  padding: 1px 5px;
  border: 1px solid currentColor;
  border-radius: 4px;
  font: 700 11px/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: oklch(from #00bfff min(l, var(--max-lightness, 1)) c h);
  box-shadow: 0 0 0 3px oklch(from #00bfff33 min(l, var(--max-lightness, 1)) c h);
}

.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;
}

.cb-send,
.cb-mic {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  border: 0;
  border-radius: 50%;
  background: none;
  color: oklch(from #00bfff min(l, var(--max-lightness, 1)) c h);
  cursor: pointer;
}

.cb-mic:disabled {
  color: color-mix(in srgb, var(--ink) 25%, 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: 11px;
}

.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;
}

/* Copy (Aria) and delete (user) by a message's last sentence, outside the bubble on a big screen (#49). */
.cb-outside {
  position: absolute;
  right: -40px;
  bottom: 2px;
}

/* 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). */
.cb-note {
  margin: -5px 0 9px;
  padding: 0 48px;
  color: oklch(from #ffb4b4 min(l, var(--max-lightness, 1)) c h);
  font-size: 13px;
  opacity: 0.8;
}

.cb-note.is-user {
  text-align: right;
}

/* 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 {
  color: oklch(from #ef4565 min(l, var(--max-lightness, 1)) c h);
  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);
}

/* The band or the big play button under the sentences (stage.js). The list
   keeps 130 px free above the band (GESTURE_BAND.LIST_PADDING_PX; pf:L1063). */
.cb-stage {
  display: contents;
}

.cb.has-band .cb-scroll {
  padding-bottom: 130px;
}

/* One sentence at a time on a small screen: "Trò chuyện mới" as its icon alone (#59). */
.cb-new.is-compact {
  min-width: 36px;
  justify-content: center;
}

/* Văn bản / Từ tabs (pageframe-words.md #1–#2) ----------------------------------- */

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

/* The header's redrawn parts sit in it as if they were its own children. */
.cb-head-slot {
  display: contents;
}

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

.cb-tabs {
  display: flex;
  align-self: stretch;
  margin-bottom: -3px;
}

.cb-tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  padding: 0 8px;
  border: 0;
  border-bottom: 2px solid transparent;
  background: none;
  color: var(--text-strong);
  opacity: 0.6;
  cursor: pointer;
}

.cb-tabs.is-text .cb-tab {
  min-width: 70px;
  padding: 0 12px;
  font: 500 15px/1 var(--font);
}

.cb-tab.is-on {
  border-bottom-color: var(--accent);
  opacity: 0.9;
}

.cb-tabs.is-text .cb-tab.is-on {
  opacity: 1;
}

/* The Words tab (words-tab.js; pageframe-words.md #6–#45) ------------------------ */

.cb-wt {
  padding-top: 8px;
}

.cb-wt-sort {
  display: flex;
  justify-content: center;
  padding: 12px 0 8px;
}

.cb-wt-segments {
  display: flex;
  padding: 2px;
  border-radius: 10px;
  background: color-mix(in srgb, var(--ink) 8%, transparent);
}

.cb-wt-segment {
  padding: 4px 12px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: color-mix(in srgb, var(--ink) 53.3%, transparent);
  font: 12px/1.4 var(--font);
  cursor: pointer;
  transition: all 0.2s;
}

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

.cb-wt-center {
  display: flex;
  justify-content: center;
  margin: 8px 0;
}

.cb-wt-filters {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 6px 0 8px;
}

.cb-wt-pills {
  display: flex;
  gap: 6px;
}

.cb-wt-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border: 1px solid color-mix(in srgb, var(--ink) 20%, transparent);
  border-radius: 14px;
  background: none;
  color: var(--text-strong);
  font: 600 13px/1 var(--font);
  opacity: 0.45;
  cursor: pointer;
}

.cb-wt-pill.is-on {
  border-color: currentColor;
  opacity: 1;
}

.cb-wt-pill-count {
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  opacity: 0.8;
}

.cb-wt-list {
  max-width: 900px;
  margin: 0 auto;
  padding: 12px 8px 150px;
}

.cb-wt-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 20px 0;
  color: color-mix(in srgb, var(--ink) 80%, transparent);
  font-size: 13px;
  letter-spacing: 0.4px;
}

.cb-wt-divider::before,
.cb-wt-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: color-mix(in srgb, var(--ink) 12%, transparent);
}

.cb-wt-divider.is-sticky {
  position: sticky;
  top: -1px;
  z-index: 2;
  margin: 10px 0 4px;
  padding: 10px 0 6px;
  background: var(--bg);
}

.cb-wt-group {
  position: relative;
  display: flex;
  gap: 10px;
  margin: 10px 0;
}

.cb-wt-badge {
  position: sticky;
  top: 8px;
  flex: none;
  width: 32px;
  height: 18px;
  border-radius: 12px;
  background: color-mix(in srgb, var(--tint) 10%, transparent);
  color: var(--tint);
  font: 600 10px/18px var(--font);
  text-align: center;
}

.cb-wt-group-body {
  flex: 1;
  border-left: 2px solid color-mix(in srgb, var(--tint) 25%, transparent);
  padding-left: 8px;
}

.cb-wt-row {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
}

.cb-wt-letter {
  width: 18px;
  height: 18px;
  margin-right: 6px;
  border: 1px solid color-mix(in srgb, var(--tint) 40%, transparent);
  border-radius: 4px;
  background: var(--bg);
  color: var(--tint);
  font: 600 11px/18px var(--font);
  text-align: center;
}

.cb-wt-cell {
  padding: 6px 14px;
  font-size: 16px;
}

.cb-wt-cell.is-compact {
  padding: 0;
}

.word-token[data-underline] {
  text-decoration: underline 2px;
  text-underline-offset: 4px;
}

.word-token[data-underline="C1"] { text-decoration-color: oklch(from #38ad00 min(l, var(--max-lightness, 1)) c h); }
.word-token[data-underline="C2"] { text-decoration-color: oklch(from #ddff00 min(l, var(--max-lightness, 1)) c h); }
.word-token[data-underline="C3"] { text-decoration-color: oklch(from #ff6658 min(l, var(--max-lightness, 1)) c h); }
.word-token[data-underline="C4"] { text-decoration-color: oklch(from #67e6ff min(l, var(--max-lightness, 1)) c h); }

/* The TO_LEARN page (#21–#44). */
.cb-wt-study {
  max-width: 640px;
  margin: 0 auto;
  padding: 4px 16px 150px;
}

.cb-wt-coverage {
  text-align: center;
}

.cb-wt-coverage-text,
.cb-wt-more {
  color: color-mix(in srgb, var(--ink) 66.7%, transparent);
  font-size: 13px;
  text-align: center;
}

.cb-wt-coverage-text {
  margin-bottom: 5px;
}

.cb-wt-more {
  margin: 12px 0 4px;
}

.cb-wt-bar {
  display: flex;
  height: 6px;
  overflow: hidden;
  border-radius: 3px;
  background: color-mix(in srgb, var(--ink) 11%, transparent);
}

.cb-wt-bar > span {
  flex-shrink: 0;
  height: 100%;
  transition: width 0.4s;
}

.cb-wt-bar-known {
  background: var(--lr-word-known);
}

.cb-wt-bar-learning {
  background: var(--lr-word-marked-learning);
  opacity: 0.45;
}

.cb-wt-word {
  padding: 6px 0 10px;
}

.cb-wt-word-line {
  display: flex;
  align-items: baseline;
  flex-wrap: nowrap;
  column-gap: 10px;
  margin-bottom: 3px;
  padding: 2px 6px;
  border-radius: 9px;
  background: color-mix(in srgb, var(--ink) 6.7%, transparent);
}

.cb-wt-number {
  flex-shrink: 0;
  align-self: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--ink) 7.8%, transparent);
  color: color-mix(in srgb, var(--ink) 53.3%, transparent);
  font: 11px/22px var(--font);
  font-variant-numeric: tabular-nums;
  text-align: center;
}

.cb-wt-count {
  align-self: center;
  padding: 2px 7px;
  border-radius: 12px;
  background: color-mix(in srgb, var(--tint) 10%, transparent);
  color: var(--tint);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
}

.cb-wt-meaning {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  color: color-mix(in srgb, var(--ink) 80%, transparent);
  font-size: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cb-wt-learn {
  display: inline-flex;
  flex-shrink: 0;
  align-self: center;
  margin-left: auto;
  padding: 3px;
  border: 1px solid color-mix(in srgb, var(--lr-word-marked-learning) 35%, transparent);
  border-radius: 6px;
  background: none;
  color: color-mix(in srgb, var(--lr-word-marked-learning) 70%, transparent);
  cursor: pointer;
}

.cb-wt-learn.is-on {
  border-color: var(--lr-word-marked-learning);
  background: var(--lr-word-marked-learning);
  color: var(--on-word);
}

.cb-wt-example {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 4px 0;
  padding: 5px 10px;
  border-radius: 8px;
  background: color-mix(in srgb, var(--ink) 3.1%, transparent);
  cursor: pointer;
}

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

.cb-wt-example-play {
  display: inline-flex;
  color: var(--wovia-blue);
}

.cb-wt-example-body {
  flex: 1;
  min-width: 0;
}

.cb-wt-example-trans {
  font-size: 15px;
  opacity: 0.75;
}

.cb-wt-example-tools {
  display: flex;
  gap: 2px;
  opacity: 0;
}

.cb-wt-example:hover .cb-wt-example-tools {
  opacity: 1;
}

.cb-wt-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 16px;
}

.cb-wt-mark-all {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 34px;
  padding: 0 12px;
  border: 1px solid color-mix(in srgb, var(--lr-word-marked-learning) 53.3%, transparent);
  border-radius: 6px;
  background: none;
  color: var(--lr-word-marked-learning);
  font: 600 13px/1 var(--font);
  cursor: pointer;
}

.cb-wt-mark-all:hover {
  border-color: var(--lr-word-marked-learning);
  background: color-mix(in srgb, var(--lr-word-marked-learning) 7.8%, transparent);
}

.cb-wt-pager {
  display: flex;
  align-items: center;
  gap: 4px;
}

.cb-wt-page {
  color: color-mix(in srgb, var(--ink) 53.3%, transparent);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

.cb-wt-none {
  margin-top: 20px;
  color: color-mix(in srgb, var(--ink) 40%, transparent);
  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,
.cb-head-focus:empty {
  display: none;
}

.cb-head-focus {
  max-width: 40vw;
  min-width: 0;
  margin: 0 8px;
}

.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);
}
