:root {
  --canvas-default: #ffffff;
  --canvas-subtle: #f6f8fa;
  --canvas-inset: #eff2f5;
  /* Default = ash (Пепел); ids are theme names, not CSS colors */
  --chat-wallpaper: #a8b4c0;
  --chat-room: #5a6878;
  --chat-room-hi: #c4ced8;
  --chat-room-mid: #8898a8;
  --chat-chrome: #dce4ec;
  --chat-doodle: url("/chats/chat-wallpaper-ash.svg");
  --bubble-in: #ffffff;
  --bubble-out: #eeffde;
  --bubble-out-time: #4d7c49;
  --bubble-read-tick: #53bdeb;
  --send-fg: #3390ec;
  --send-emphasis: #1d7ed4;
  --border-default: #d0d7de;
  --fg-default: #1f2328;
  --fg-muted: #59636e;
  --fg-on-emphasis: #ffffff;
  --accent-fg: #3390ec;
  --accent-emphasis: #1d7ed4;
  --accent-subtle: #e3f1fc;
  --attention-fg: #9a6700;
  --attention-subtle: #fff8c5;
  --correction-error: #cf222e;
  --correction-ok: #117465;
  --danger-fg: #cf222e;
  --radius: 16px;
  --font: "Mona Sans", "Segoe UI", system-ui, -apple-system, sans-serif;
  --chat-col: 40rem;
  /* Chat spacing scale (8px grid, messenger density) */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --chat-pad-inline: var(--space-2);
  --chat-pad-block: var(--space-2);
  --chat-gap: var(--space-2);
  --bubble-pad-block: var(--space-2);
  --bubble-pad-inline: var(--space-3);
  /* meta: inset 4 + time ~12 + clearance 4 */
  --bubble-pad-meta: 20px;
  --bubble-meta-inset-block: var(--space-1);
  --bubble-meta-inset-inline: var(--space-2);
}

html[data-wallpaper="grove"] {
  --chat-wallpaper: #a8c8b4;
  --chat-room: #6a8878;
  --chat-room-hi: #c0dcc8;
  --chat-room-mid: #88b098;
  --chat-chrome: #e0eedc;
  --chat-doodle: url("/chats/chat-wallpaper-grove.svg");
}

html[data-wallpaper="ash"] {
  --chat-wallpaper: #a8b4c0;
  --chat-room: #5a6878;
  --chat-room-hi: #c4ced8;
  --chat-room-mid: #8898a8;
  --chat-chrome: #dce4ec;
  --chat-doodle: url("/chats/chat-wallpaper-ash.svg");
}

html[data-wallpaper="sky"] {
  --chat-wallpaper: #9ed4e8;
  --chat-room: #5a8898;
  --chat-room-hi: #c8eaf4;
  --chat-room-mid: #78b8c8;
  --chat-chrome: #e8f6fc;
  --chat-doodle: url("/chats/chat-wallpaper-sky.svg");
}

html[data-wallpaper="figures"] {
  --chat-wallpaper: #e8a8b8;
  --chat-room: #986878;
  --chat-room-hi: #f0c8d4;
  --chat-room-mid: #b88898;
  --chat-chrome: #f8e4ea;
  --chat-doodle: url("/chats/chat-wallpaper-figures.svg?v=20260930k");
}

html[data-wallpaper="magic"] {
  --chat-wallpaper: #c4b8d4;
  --chat-room: #847892;
  --chat-room-hi: #d8d0e4;
  --chat-room-mid: #9a8cb0;
  --chat-chrome: #ece6f4;
  --chat-doodle: url("/chats/chat-wallpaper-magic.svg?v=20260930k");
}

html[data-wallpaper="desert"] {
  --chat-wallpaper: #e0c8a0;
  --chat-room: #9a8268;
  --chat-room-hi: #eee0c0;
  --chat-room-mid: #c8a880;
  --chat-chrome: #f6eedc;
  --chat-doodle: url("/chats/chat-wallpaper-desert.svg");
}

* { box-sizing: border-box; }
html, body { height: 100%; }
html:has(body.app-chat) {
  overflow: hidden;
  overscroll-behavior: none;
}
body {
  margin: 0;
  color: var(--fg-default);
  font-family: var(--font);
  background: var(--canvas-default);
  min-height: 100dvh;
}

body.app-chat {
  display: grid;
  justify-items: center;
  min-height: 0;
  height: 100%;
  overflow: hidden;
  overscroll-behavior: none;
  background-color: var(--chat-room);
  background-image: radial-gradient(
    ellipse 54% 92% at 50% 46%,
    var(--chat-room-hi) 0%,
    var(--chat-room-mid) 58%,
    var(--chat-room) 100%
  );
}

.chat-shell {
  --contacts-rail: 3.5rem;
  --contacts-panel: 12rem;
  width: min(100%, var(--chat-col));
  height: var(--app-height, 100dvh);
  height: var(--app-height, 100svh);
  max-height: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr);
  position: fixed;
  top: var(--app-top, 0px);
  left: 0;
  right: 0;
  margin-inline: auto;
  overflow: hidden;
  z-index: 1;
  box-shadow: 0 0 0 1px rgba(16, 35, 47, 0.12), 0 18px 48px rgba(16, 35, 47, 0.22);
}

.atmosphere {
  display: block;
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image:
    radial-gradient(ellipse 75% 70% at 50% 42%, transparent 42%, rgba(28, 48, 58, 0.22) 100%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)' opacity='0.45'/%3E%3C/svg%3E");
  background-size: auto, 160px 160px;
  opacity: 0.55;
}

.preview-banner {
  display: none;
  position: fixed;
  top: var(--app-top, 0px);
  left: 0;
  right: 0;
  z-index: 6;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 40px;
  padding: 8px 16px;
  background: #fff4cc;
  color: #6e4b00;
  font-size: 0.875rem;
  box-shadow: 0 1px 0 rgba(28, 48, 58, 0.12);
}
.preview-banner p { margin: 0; font-weight: 600; }
.preview-banner a {
  color: inherit;
  font-weight: 600;
  text-decoration: none;
  border-bottom: 1px solid currentColor;
}
html[data-preview="1"] .preview-banner { display: flex; }
html[data-preview="1"] .chat-shell {
  top: calc(var(--app-top, 0px) + 40px);
  height: calc(var(--app-height, 100dvh) - 40px);
  height: calc(var(--app-height, 100svh) - 40px);
}

.contacts {
  display: none;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  height: 100%;
  background: color-mix(in srgb, var(--chat-chrome) 88%, #1c303a 12%);
  position: absolute;
  inset: 0;
  z-index: 5;
}

.chat-shell.is-contacts-home .contacts {
  display: flex;
}

/* Sheets live under .chat-stage; lift above the contacts overlay when list is home. */
.chat-shell.is-contacts-home .settings:not([hidden]) {
  position: fixed;
  top: var(--app-top, 0px);
  left: 0;
  right: 0;
  width: min(100%, var(--chat-col));
  height: var(--app-height, 100dvh);
  height: var(--app-height, 100svh);
  margin-inline: auto;
  z-index: 10;
}

html[data-preview="1"] .chat-shell.is-contacts-home .settings:not([hidden]) {
  top: calc(var(--app-top, 0px) + 40px);
  height: calc(var(--app-height, 100dvh) - 40px);
  height: calc(var(--app-height, 100svh) - 40px);
}

.contacts__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-shrink: 0;
  min-height: 54px;
  padding: calc(6px + env(safe-area-inset-top, 0px)) 12px 6px;
  box-shadow: 0 1px 0 rgba(28, 48, 58, 0.12);
}

.contacts__title {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1.2;
}

.contacts__list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 0;
  flex: 1 1 auto;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 8px 8px calc(12px + env(safe-area-inset-bottom, 0px));
  scrollbar-width: none;
}

.contacts__list::-webkit-scrollbar {
  display: none;
}

.contacts__item {
  display: flex;
  align-items: center;
  gap: 4px;
  width: 100%;
  margin: 0;
  padding: 4px 8px;
  border: 0;
  border-radius: 14px;
  background: color-mix(in srgb, #ffffff 72%, transparent);
  box-shadow: inset 0 0 0 1px rgba(28, 48, 58, 0.12);
  color: var(--fg-default);
  font: inherit;
  text-align: left;
  touch-action: manipulation;
  cursor: grab;
  user-select: none;
  -webkit-user-select: none;
}

.contacts__open {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1 1 auto;
  min-width: 0;
  margin: 0;
  padding: 8px 4px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: inherit;
}

.contacts__item:hover,
.contacts__item:focus-within {
  background: color-mix(in srgb, #ffffff 88%, transparent);
  box-shadow: inset 0 0 0 1px rgba(28, 48, 58, 0.18);
}

.contacts__open:focus-visible {
  outline: 2px solid var(--brand, #3390ec);
  outline-offset: 1px;
}

.contacts__item.is-active {
  background: color-mix(in srgb, #ffffff 86%, var(--accent-subtle));
  box-shadow: inset 0 0 0 1px rgba(51, 144, 236, 0.28);
}

.contacts__list.is-reordering {
  touch-action: none;
  overflow-y: hidden;
}

.contacts__item.is-dragging {
  cursor: grabbing;
  background: color-mix(in srgb, #ffffff 94%, transparent);
  box-shadow:
    inset 0 0 0 1px rgba(28, 48, 58, 0.16),
    0 8px 24px rgba(28, 48, 58, 0.18);
  z-index: 2;
  position: relative;
  touch-action: none;
}

.contacts__item.is-drag-armed {
  background: color-mix(in srgb, #ffffff 86%, var(--accent-subtle));
  box-shadow: inset 0 0 0 1px rgba(51, 144, 236, 0.24);
}

.contacts__avatar {
  display: block;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  object-fit: cover;
  -webkit-user-drag: none;
  pointer-events: none;
  flex-shrink: 0;
  background: #dceefb;
  box-shadow: inset 0 0 0 1px rgba(28, 48, 58, 0.08);
}

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

.contacts__name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 1.0625rem;
  font-weight: 600;
  line-height: 1.25;
}

.contacts__hint {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.8125rem;
  color: rgba(28, 48, 58, 0.55);
  line-height: 1.3;
}

.chat-stage {
  display: grid;
  grid-template-rows: auto 1fr auto;
  min-width: 0;
  min-height: 0;
  height: 100%;
  position: relative;
}

.top, .chat, .hint-anchor, .composer-dock { position: relative; z-index: 1; }
.top { z-index: 3; }

.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 54px;
  padding: calc(6px + env(safe-area-inset-top, 0px)) 12px 6px;
  background: var(--chat-chrome);
  box-shadow: 0 1px 0 rgba(28, 48, 58, 0.12);
}

.top__back {
  flex-shrink: 0;
}

.peer {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex: 1 1 auto;
  color: inherit;
}

body.channel-tutor .peer__name {
  letter-spacing: 0.01em;
}

.bubble.assistant .tutor-sections {
  display: grid;
  gap: 10px;
}

.tutor-sections__block {
  display: grid;
  gap: 4px;
}

.tutor-sections__label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: rgba(28, 48, 58, 0.55);
}

.tutor-sections__text {
  white-space: pre-wrap;
}

.tutor-sections__correction {
  display: grid;
  gap: 6px;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid rgba(28, 48, 58, 0.1);
}

.tutor-sections__correction-line,
.tutor-sections__correction-write {
  font-size: 0.9375rem;
  line-height: 1.4;
}

.tutor-sections__correction-write {
  margin-top: 2px;
}

.specialty-gazette__title {
  font-weight: 700;
  margin-bottom: 6px;
}

.specialty-gazette__body {
  white-space: pre-wrap;
}

.specialty-sentences {
  display: grid;
  gap: 8px;
}

.specialty-sentence {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.specialty-sentence__text {
  flex: 1 1 auto;
  text-align: left;
  border: 0;
  background: transparent;
  padding: 0;
  font: inherit;
  color: inherit;
  cursor: pointer;
  line-height: 1.45;
}

.specialty-sentence__text.is-ru {
  color: rgba(28, 48, 58, 0.72);
}

.specialty-sentence__speak {
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 50%;
  background: rgba(51, 144, 236, 0.12);
  color: #3390ec;
  font-size: 11px;
  cursor: pointer;
}

.specialty-quiz__verdict {
  margin-bottom: 8px;
  color: rgba(28, 48, 58, 0.72);
  font-size: 0.95em;
}

.specialty-quiz__question {
  margin-bottom: 10px;
  font-weight: 600;
}

.specialty-quiz__options {
  display: grid;
  gap: 8px;
}

.specialty-quiz__option {
  display: block;
  width: 100%;
  text-align: left;
  border: 1px solid rgba(28, 48, 58, 0.12);
  border-radius: 12px;
  background: #fff;
  padding: 10px 12px;
  font: inherit;
  color: inherit;
  cursor: pointer;
}

.specialty-quiz__option:hover:not(:disabled) {
  border-color: #3390ec;
  background: rgba(51, 144, 236, 0.06);
}

.specialty-quiz__option:disabled {
  opacity: 0.65;
  cursor: default;
}

.specialty-translate__reply {
  white-space: pre-wrap;
  font-weight: 400;
}

.specialty-translate__ru {
  margin-top: 6px;
  font-size: 0.82em;
  line-height: 1.35;
  font-weight: 400;
  color: color-mix(in srgb, var(--text, #1a1a1a) 62%, transparent);
  white-space: pre-wrap;
}

.specialty-translate__badges {
  margin-top: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.bubble.assistant.bubble--translate {
  width: 100%;
  max-width: 100%;
}

.specialty-translate__badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
  min-height: 36px;
  padding: 7px 12px 7px 14px;
  border: 1px solid color-mix(in srgb, var(--accent-fg, #3390ec) 35%, transparent);
  border-radius: 12px;
  background: #fff;
  color: var(--accent-fg, #1a5f9e);
  box-shadow: 0 1px 2px rgba(16, 35, 47, 0.1);
  font: inherit;
  font-size: 0.84rem;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: 0.01em;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.12s ease, border-color 0.12s ease, box-shadow 0.12s ease;
}

.specialty-translate__badge::after {
  content: '';
  width: 0.45em;
  height: 0.45em;
  margin-left: 2px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg);
  opacity: 0.75;
  flex: 0 0 auto;
}

.specialty-translate__badge:hover,
.specialty-translate__badge:focus-visible {
  background: var(--accent-subtle, #e3f1fc);
  border-color: var(--accent-fg, #3390ec);
  box-shadow: 0 1px 3px rgba(16, 35, 47, 0.14);
}

.specialty-translate__badge:active {
  transform: translateY(1px);
}

.specialty-translate__badge:focus-visible {
  outline: 2px solid var(--accent-fg, #3390ec);
  outline-offset: 2px;
}

.specialty-translate__badge.is-active {
  background: var(--accent-fg, #3390ec);
  border-color: var(--accent-fg, #3390ec);
  color: #fff;
  box-shadow: none;
}

.specialty-translate__badge.is-active::after {
  transform: rotate(-135deg);
  margin-top: 3px;
}

.specialty-translate__badge.is-loading {
  opacity: 0.72;
}

.specialty-translate__badge-explain {
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px solid rgba(28, 48, 58, 0.1);
  color: rgba(28, 48, 58, 0.78);
  font-size: 0.9em;
  line-height: 1.45;
}

.specialty-translate__badge-explain.body--md p {
  margin: 0 0 0.55em;
}

.specialty-translate__badge-explain.body--md p:last-child {
  margin-bottom: 0;
}

.specialty-translate__badge-explain.body--md ul {
  margin: 0.35em 0 0.55em;
  padding-left: 1.2em;
}

.specialty-translate__badge-explain.body--md code {
  font-size: 0.92em;
}

.specialty-translate__grammar {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid rgba(28, 48, 58, 0.1);
  display: grid;
  gap: 12px;
}

.specialty-translate__forms {
  margin: 0;
  padding-left: 1.15em;
  color: rgba(28, 48, 58, 0.72);
  font-size: 0.9em;
  line-height: 1.4;
}

.specialty-translate__forms li {
  margin-bottom: 3px;
}

.specialty-translate__alts {
  margin: 10px 0 0;
  padding-left: 1.2em;
  color: rgba(28, 48, 58, 0.75);
  font-size: 0.95em;
}

.specialty-translate__alts li {
  margin-bottom: 4px;
}

.specialty-translate__note {
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px solid rgba(28, 48, 58, 0.1);
  color: rgba(28, 48, 58, 0.7);
  font-size: 0.9em;
}

body.channel-specialty .hint-anchor {
  display: none;
}

.peer__open {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  max-width: 100%;
  padding: 0;
  margin: 0;
  border: none;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
  border-radius: 8px;
}

.peer__open:focus-visible {
  outline: 2px solid var(--send-fg, #3390ec);
  outline-offset: 2px;
}

.peer__avatar {
  display: block;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  background: #dceefb;
  box-shadow: inset 0 0 0 1px rgba(28, 48, 58, 0.08);
  pointer-events: none;
}

.peer-profile {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 8px;
  padding: 8px 8px 4px;
}

.peer-profile__avatar {
  width: min(72vw, 11rem);
  height: min(72vw, 11rem);
  border-radius: 50%;
  object-fit: cover;
  background: #dceefb;
  box-shadow:
    inset 0 0 0 1px rgba(28, 48, 58, 0.08),
    0 8px 24px rgba(16, 35, 47, 0.12);
}

.peer-profile__name {
  margin: 8px 0 0;
  font-size: 1.375rem;
  font-weight: 700;
  line-height: 1.2;
}

.peer-profile__role {
  margin: 0;
  font-size: 0.875rem;
  font-weight: 600;
  color: rgba(28, 48, 58, 0.55);
}

.peer-profile__bio {
  margin: 8px 0 0;
  max-width: 28rem;
  font-size: 0.9375rem;
  line-height: 1.5;
  color: rgba(28, 48, 58, 0.82);
  white-space: pre-wrap;
  text-align: left;
}

.peer__text {
  display: flex;
  flex-direction: column;
  min-width: 0;
  line-height: 1.25;
}

.peer__name {
  font-size: 1.0625rem;
  font-weight: 600;
}

.peer__status,
.meta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--fg-muted);
  font-size: 0.75rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.peer__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #8b969e;
  flex-shrink: 0;
}

.peer.is-online .peer__dot {
  background: #3dcc6d;
}

.peer.is-online .peer__status {
  color: #2ea44f;
}

.peer.is-typing .peer__dot {
  background: var(--accent-fg);
  animation: peer-typing-pulse 1s ease-in-out infinite;
}

.peer.is-typing .peer__status {
  color: var(--accent-fg);
}

@keyframes peer-typing-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.45; transform: scale(0.85); }
}

.top__actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.top__menu {
  position: relative;
  flex-shrink: 0;
}

.top__icon {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: color-mix(in srgb, #ffffff 72%, var(--accent-subtle));
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.55);
  color: var(--accent-fg);
  padding: 0;
  cursor: pointer;
}

.top__icon:hover,
.top__icon:focus-visible,
.top__icon[aria-expanded="true"] {
  background: var(--accent-subtle);
  box-shadow: inset 0 0 0 1px rgba(51, 144, 236, 0.14);
}

.top__icon:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 8;
  min-width: 16.5rem;
  padding: 6px;
  overflow: hidden;
  background: var(--canvas-default);
  border-radius: 14px;
  box-shadow: 0 6px 20px rgba(16, 35, 47, 0.18);
}

.menu.menu--shell {
  top: calc(6px + env(safe-area-inset-top, 0px) + 46px);
  right: 12px;
  z-index: 9;
}

.menu[hidden] {
  display: none;
}

.menu__item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--fg-default);
  font: inherit;
  font-size: 1rem;
  text-align: left;
  padding: 14px 16px;
  cursor: pointer;
}

.menu__icon {
  flex-shrink: 0;
  color: var(--accent-fg);
}

.menu__label {
  flex: 1;
  min-width: 0;
}

.menu__item[hidden] {
  display: none;
}

.menu__item:hover,
.menu__item:focus-visible {
  background: var(--canvas-subtle);
}

.menu__item:focus-visible {
  outline: 2px solid var(--accent-fg);
  outline-offset: -2px;
}

.menu__item:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.chat {
  overflow-y: auto;
  overflow-anchor: none;
  overscroll-behavior: contain;
  scrollbar-width: none;
  -ms-overflow-style: none;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: var(--chat-gap);
  padding: var(--chat-pad-block) var(--chat-pad-inline);
  background-color: var(--chat-wallpaper);
  background-image: var(--chat-doodle);
  background-size: 268px 268px;
  background-repeat: repeat;
  background-attachment: local;
  box-shadow: inset 0 10px 12px -12px rgba(16, 35, 47, 0.28);
}

.chat::-webkit-scrollbar {
  display: none;
}

.chat-empty {
  align-self: center;
  margin: auto 0;
  max-width: 18rem;
  padding: 0.75rem 1rem;
  border-radius: 12px;
  background: rgba(16, 35, 47, 0.22);
  color: #fff;
  font-size: 0.9375rem;
  line-height: 1.4;
  text-align: center;
  box-shadow: none;
}
.chat-empty p {
  margin: 0;
  font-weight: 500;
}
.chat-empty[hidden] {
  display: none !important;
}

.bubble {
  position: relative;
  display: block;
  flex-shrink: 0;
  width: fit-content;
  max-width: 85%;
  min-width: 5.75rem;
  box-sizing: border-box;
  /* низ — под мету (время / галочки) */
  padding: var(--bubble-pad-block) var(--bubble-pad-inline) var(--bubble-pad-meta);
  border-radius: var(--radius);
  background: var(--bubble-in);
  box-shadow: 0 1px 2px rgba(16, 35, 47, 0.12);
  animation: rise 0.18s ease-out both;
  line-height: 1.35;
  font-size: 1.125rem;
}

.bubble.assistant {
  animation: rise-reply 0.28s cubic-bezier(0.22, 0.61, 0.36, 1) both;
}

.bubble.assistant.is-final {
  animation: finalize 0.35s ease-out both;
}

.bubble.user {
  align-self: flex-end;
  background: var(--bubble-out);
  border-radius: 16px 16px 16px 16px;
}

.bubble.system,
.bubble.error {
  align-self: center;
  max-width: 92%;
  min-width: 0;
  padding: var(--space-2) var(--space-3);
  border-radius: var(--space-3);
  background: rgba(16, 35, 47, 0.22);
  color: #fff;
  box-shadow: none;
  font-size: 0.9375rem;
  text-align: center;
  animation: rise-reply 0.2s ease-out both;
}

.bubble.system .bubble__meta,
.bubble.error .bubble__meta {
  color: rgba(255, 255, 255, 0.72);
}

.bubble.system .body,
.bubble.error .body {
  text-align: center;
}

.bubble__quota-text {
  margin: 0 0 0.55rem;
}

.bubble__quota-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 8px;
  background: #fff;
  color: #10232f;
  font-size: 0.8125rem;
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
}

.bubble__quota-btn:hover {
  opacity: 0.92;
}

.bubble.error .bubble__link {
  color: #fff;
  font-weight: 650;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.bubble.error .bubble__link:hover {
  opacity: 0.9;
}

.bubble.assistant,
.bubble.correction {
  align-self: flex-start;
}

.bubble.is-tail.user {
  border-bottom-right-radius: 4px;
}

.bubble.is-tail.assistant,
.bubble.is-tail.correction {
  border-bottom-left-radius: 4px;
}

.bubble.is-follow {
  margin-top: 0;
}

.bubble.correction,
.bubble.system_lesson {
  animation: rise-reply 0.24s cubic-bezier(0.22, 0.61, 0.36, 1) both;
  align-self: center;
  max-width: 90%;
  background: var(--attention-subtle);
  color: var(--fg-default);
  font-size: 1.125rem;
  text-align: left;
}

/* Same width for lesson cards («Новое слово», grammar) — % of chat column (not a rem cap). */
.bubble.system_lesson {
  width: 90%;
  max-width: 90%;
  box-sizing: border-box;
}

.lesson__head {
  margin-bottom: 0.5em;
}

.lesson__title {
  font-weight: 700;
  font-size: 1.22em;
  color: var(--fg-default);
  line-height: 1.28;
}

.lesson__title-ru {
  margin-top: 0.2em;
  font-weight: 500;
  font-size: 0.72em;
  line-height: 1.35;
  color: var(--fg-muted);
}

.lesson__concept {
  margin-bottom: 0.85em;
  color: var(--fg-default);
  font-size: 0.94em;
  line-height: 1.55;
  letter-spacing: 0.01em;
}

.lesson__examples-title,
.lesson__words-title,
.lesson__forms-title {
  display: block;
  font-size: 0.62em;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--attention-fg);
  margin-bottom: 0.4em;
}

.lesson__examples,
.lesson__words,
.lesson__forms {
  margin-bottom: 0.75em;
}

.lesson__examples-list,
.lesson__words-list,
.lesson__forms-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.lesson__forms-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35em 0.75em;
}

.lesson__forms-list li {
  font-size: 0.94em;
  line-height: 1.35;
  color: var(--fg-default);
}

.lesson__forms-list strong {
  font-weight: 700;
}

.lesson__examples-list li {
  margin-bottom: 0.55em;
}

.lesson__examples-list li:last-child {
  margin-bottom: 0;
}

.lesson__example-en {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.lesson__example-en em,
.lesson__example-en .lesson__example-en-text {
  flex: 1;
  min-width: 0;
}

.lesson__examples-list em,
.lesson__word-example em {
  display: block;
  font-style: normal;
  font-weight: 600;
  color: var(--fg-default);
  font-size: 0.9444em;
}

.bubble__speak.lesson__speak {
  width: 2.25rem;
  height: 2.25rem;
  margin-top: -0.2em;
  background: #fff;
  color: var(--attention-fg);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--attention-fg) 28%, transparent);
}

.bubble__speak.lesson__speak.is-playing {
  background: var(--attention-fg);
  color: var(--fg-on-emphasis);
  box-shadow: none;
}

.bubble__speak.lesson__speak svg {
  width: 18px;
  height: 18px;
}

.lesson__word-example--quote {
  margin-top: 0.2em;
  font-size: 0.9em;
  line-height: 1.4;
  font-weight: 400;
  color: var(--fg-muted);
}

.lesson__stats {
  margin-top: 0.65em;
  font-size: 0.78em;
  line-height: 1.35;
  font-weight: 500;
  letter-spacing: 0.01em;
  color: var(--fg-muted);
}

.lesson__examples-list li > span,
.lesson__word-example > span:not(.lesson__example-en-text) {
  display: block;
  margin-top: 0.15em;
  font-size: 0.8889em;
  color: var(--fg-muted);
}

.lesson__word {
  margin-bottom: 0.75em;
  padding-bottom: 0.65em;
  border-bottom: 1px solid rgba(154, 103, 0, 0.16);
}

.lesson__word:last-child {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
}

.lesson__words--plain .lesson__word {
  margin-bottom: 0.35em;
  padding-bottom: 0;
  border-bottom: none;
}

.lesson__words--plain .lesson__word:last-child {
  margin-bottom: 0;
}

.lesson__word-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.35em 0.65em;
  margin-bottom: 0.2em;
}

.lesson__word-head strong {
  font-weight: 700;
  font-size: 1em;
  color: var(--fg-default);
}

.lesson__word-head strong.lesson__lexis-correct {
  color: var(--correction-ok);
}

.lesson__lexis-wrong {
  color: var(--correction-error);
  text-decoration: none;
  font-weight: 600;
}

.lesson__lexis-correct {
  color: var(--correction-ok);
  font-weight: 700;
}

.lesson__word-gloss {
  font-size: 0.8889em;
  color: var(--fg-muted);
}

.lesson__words .lesson__word-gloss::before {
  content: '—';
  margin-right: 0.35em;
  color: var(--fg-muted);
}

.lesson__words--consolidate .lesson__word-gloss::before {
  content: none;
  margin: 0;
}

.lesson__words--consolidate .lesson__word-head {
  gap: 0.35em 0.5em;
}

.lesson__words--consolidate .lesson__word {
  margin-bottom: 0.65em;
}

.lesson__word-why {
  margin-bottom: 0.35em;
  font-size: 0.8333em;
  line-height: 1.4;
  color: var(--fg-default);
  opacity: 0.88;
}

.lesson__word-example {
  margin-top: 0.15em;
}

.lesson__lexis-arrow {
  margin: 0 0.2em;
  opacity: 0.55;
  font-weight: 500;
}

.lesson__words--lexis .lesson__word-head {
  flex-wrap: nowrap;
  align-items: baseline;
  gap: 0;
}

.bubble .label {
  display: none;
}

.bubble.correction .label,
.bubble.system_lesson .label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 6px;
  color: var(--attention-fg);
  text-align: left;
}

.bubble.correction .label__icon,
.bubble.system_lesson .label__icon {
  flex: 0 0 auto;
  display: block;
  width: 24px;
  height: 24px;
}

.bubble.system_lesson .label__icon--lesson {
  color: #c99700;
  opacity: 0.95;
}

.bubble.correction .body,
.bubble.system_lesson .body {
  text-align: left;
}

.bubble.lesson-loader {
  align-self: center;
  width: auto;
  max-width: max-content;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(16, 35, 47, 0.16);
  color: rgba(255, 255, 255, 0.88);
  box-shadow: none;
  font-size: 0.8125rem;
  line-height: 1.3;
  text-align: center;
  animation: rise-reply 0.18s ease-out both;
}

.bubble.lesson-loader .body.lesson-loader__body {
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  gap: 0.45em;
  min-height: 0;
  color: inherit;
  font-size: inherit;
  white-space: nowrap;
  text-align: center;
}

.lesson-loader__text {
  display: inline;
}

.lesson-loader__dots {
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

.lesson-loader__dots i {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.35;
  animation: lesson-loader-dot 1.2s ease-in-out infinite;
}

.lesson-loader__dots i:nth-child(2) {
  animation-delay: 0.2s;
}

.lesson-loader__dots i:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes lesson-loader-dot {
  0%, 80%, 100% { opacity: 0.3; transform: translateY(0); }
  40% { opacity: 1; transform: translateY(-1px); }
}

.bubble.correction del {
  color: var(--correction-error);
  text-decoration: none;
}

.bubble.correction strong {
  color: var(--correction-ok);
  font-weight: 700;
}

.bubble.correction strong.correction-prompt {
  color: var(--fg-default);
  font-weight: 700;
}

.bubble .body {
  display: block;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.bubble .body.body--md {
  white-space: normal;
}

.bubble .body.body--md p {
  margin: 0 0 0.55em;
}

.bubble .body.body--md p:last-child {
  margin-bottom: 0;
}

.bubble .body.body--md ul {
  margin: 0.35em 0 0.55em;
  padding-left: 1.25em;
}

.bubble .body.body--md li {
  margin: 0.15em 0;
}

.bubble .body.body--md code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.92em;
  padding: 0.1em 0.35em;
  border-radius: 4px;
  background: rgba(15, 23, 42, 0.08);
}

.bubble.assistant .body.body--md code,
.bubble.correction .body.body--md code {
  background: rgba(15, 23, 42, 0.07);
}

.bubble__meta {
  position: absolute;
  right: var(--bubble-meta-inset-inline);
  bottom: var(--bubble-meta-inset-block);
  display: inline-flex;
  align-items: center;
  gap: 3px;
  color: rgba(31, 35, 40, 0.4);
  font-size: 0.75rem;
  line-height: 1;
  white-space: nowrap;
  pointer-events: none;
}

.bubble__time {
  font-size: inherit;
  color: inherit;
  line-height: 1;
}

.bubble.user .bubble__meta {
  color: var(--bubble-out-time);
}

.bubble.user .bubble__time {
  opacity: 0.75;
}

.bubble__ticks {
  display: inline-flex;
  width: 1.125rem;
  height: 0.7rem;
  flex-shrink: 0;
  color: inherit;
  opacity: 0.85;
}

.bubble__ticks[data-receipt="pending"] {
  width: 0.75rem;
  height: 0.75rem;
}

.bubble__ticks svg {
  display: block;
  width: 100%;
  height: 100%;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.bubble.user[data-receipt="read"] .bubble__ticks {
  color: var(--bubble-read-tick);
  opacity: 1;
}

.bubble:has(.bubble__ru-btn:not([hidden])),
.bubble.has-speak {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  column-gap: 6px;
  align-items: stretch;
  min-width: 8.5rem;
  padding: 6px 6px 8px 10px;
}

.bubble:has(.bubble__ru-btn:not([hidden])) .body,
.bubble.has-speak .body {
  grid-column: 1;
  min-width: 0;
}

.bubble:has(.bubble__ru-btn:not([hidden])) .bubble__meta,
.bubble.has-speak .bubble__meta,
.hint-balloon .bubble__meta {
  position: static;
  grid-column: 2;
  align-self: stretch;
  flex-direction: column;
  justify-content: flex-start;
  align-items: center;
  gap: 4px;
}

.bubble:has(.bubble__ru-btn:not([hidden])) .bubble__time,
.bubble.has-speak .bubble__time {
  margin-top: auto;
}

.bubble__ru-btn,
.bubble__speak {
  position: static;
  z-index: 1;
  width: 2.25rem;
  height: 2.25rem;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  border: 0;
  border-radius: 999px;
  background: var(--accent-subtle);
  color: var(--accent-fg);
  font: inherit;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  line-height: 1;
  padding: 0;
  cursor: pointer;
  pointer-events: auto;
  -webkit-tap-highlight-color: transparent;
}

.bubble__ru-btn[hidden],
.bubble__speak[hidden] {
  display: none;
}

.bubble__ru-btn[aria-pressed="true"],
.bubble__speak.is-playing {
  background: var(--send-fg);
  color: var(--fg-on-emphasis);
}

.bubble__speak.is-loading {
  opacity: 0.55;
}

.bubble__speak svg {
  display: block;
  width: 18px;
  height: 18px;
}

.bubble.is-translated .body,
.hint-balloon.is-translated .body {
  color: var(--fg-default);
}

.hint-anchor {
  --hint-bulb: 40px;
  --hint-gap: 8px;
  display: flex;
  flex-direction: row;
  align-items: flex-end;
  gap: var(--hint-gap);
  width: 100%;
  box-sizing: border-box;
  padding: 8px 8px 10px;
  margin-top: auto;
  flex-shrink: 0;
  position: sticky;
  bottom: 0;
  z-index: 2;
}

.hint-anchor[hidden] {
  display: none;
}

.hint-bulb {
  flex: 0 0 auto;
  width: var(--hint-bulb);
  height: var(--hint-bulb);
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.88);
  color: var(--fg-muted);
  padding: 0;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.hint-bulb:hover,
.hint-anchor.is-open .hint-bulb {
  background: #fff;
  color: var(--attention-fg);
}

.hint-balloon {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  column-gap: 6px;
  align-items: stretch;
  flex: 1 1 auto;
  min-width: 0;
  margin-right: calc(var(--hint-bulb) + var(--hint-gap));
  box-sizing: border-box;
  background: var(--attention-subtle);
  border: 1px dashed color-mix(in srgb, var(--attention-fg) 35%, transparent);
  border-radius: 12px;
  padding: 1.55rem 6px 10px 12px;
  box-shadow: none;
  animation: rise 0.16s ease-out both;
  font-size: 0.9375rem;
  line-height: 1.35;
}

.hint-balloon[hidden] {
  display: none !important;
}

.hint-balloon__label {
  position: absolute;
  top: 7px;
  left: 12px;
  max-width: calc(100% - 3.5rem);
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  line-height: 1.2;
  color: var(--attention-fg);
  pointer-events: none;
}

.hint-balloon .body {
  display: block;
  grid-column: 1;
  min-width: 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: break-word;
  font-weight: 550;
}

.hint-balloon .bubble__meta {
  grid-column: 2;
}

.vocab-chip-bar {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 6px 8px 0;
  background: var(--chat-chrome);
}

/* RU→EN chips: Companion only */
body:not([data-channel="companion"]) .vocab-chip-bar {
  display: none !important;
}

.vocab-chip-bar[hidden] {
  display: none !important;
}

.vocab-chip-bar__scroll {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 2px 0;
  width: 100%;
  box-sizing: border-box;
  align-items: center;
}

.vocab-chip-bar__hints[hidden] {
  display: none !important;
}

.vocab-word-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  appearance: none;
  border: 0;
  border-radius: 999px;
  padding: 6px 12px 6px 10px;
  margin: 0;
  font: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1.2;
  color: var(--fg-default);
  background: var(--canvas-default);
  box-shadow: 0 1px 2px rgba(16, 35, 47, 0.12);
  text-decoration: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  max-width: 100%;
}

.vocab-word-btn:hover,
.vocab-word-btn:focus-visible {
  background: #fff;
  color: var(--fg-default);
  box-shadow: 0 1px 3px rgba(16, 35, 47, 0.18);
}

.vocab-word-btn.is-active {
  background: #fff;
  color: var(--fg-default);
  box-shadow: 0 0 0 2px var(--send-fg);
}

.vocab-word-btn:focus-visible {
  outline: 2px solid var(--accent-fg, var(--send-fg));
  outline-offset: 2px;
}

.vocab-word-btn__text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.vocab-tr-icon {
  flex: 0 0 auto;
  display: block;
  color: var(--send-fg);
}

.vocab-chip {
  flex: 0 1 auto;
  border: 0;
  border-radius: 16px;
  padding: 8px 14px;
  background: var(--canvas-default);
  color: var(--fg-default);
  box-shadow: 0 1px 2px rgba(16, 35, 47, 0.12);
  font: inherit;
  font-size: 0.9375rem;
  line-height: 1.3;
  cursor: pointer;
  white-space: nowrap;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  -webkit-tap-highlight-color: transparent;
}

.vocab-chip:hover,
.vocab-chip:focus-visible {
  background: #fff;
}

.vocab-chip.is-selected {
  background: #fff;
  box-shadow: 0 0 0 2px var(--send-fg);
}

.vocab-chip:focus-visible {
  outline: 2px solid var(--accent-fg, var(--send-fg));
  outline-offset: 2px;
}

.vocab-chip__en {
  font-weight: 600;
  color: var(--send-fg);
}

.vocab-chip__sep {
  color: var(--fg-muted);
  margin: 0 0.35em;
}

.vocab-chip__ru {
  color: var(--fg-muted);
}

.vocab-chip--loading,
.vocab-chip--empty {
  color: var(--fg-muted);
  font-weight: 400;
  cursor: default;
  box-shadow: none;
  background: transparent;
}

.composer-dock {
  display: flex;
  flex-direction: column;
  background: var(--chat-chrome);
  box-shadow: 0 -1px 0 rgba(28, 48, 58, 0.12);
}

.composer {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  padding: 8px 8px calc(10px + env(safe-area-inset-bottom, 0px));
  background: transparent;
  box-shadow: none;
}

.composer textarea {
  flex: 1 1 auto;
  resize: none;
  overflow: hidden;
  border: 0;
  border-radius: 22px;
  padding: 10px 16px;
  background: var(--canvas-default);
  color: var(--fg-default);
  font: inherit;
  font-size: 1.125rem;
  line-height: 1.35;
  min-height: 48px;
  max-height: 7.5rem;
}

.composer textarea:focus-visible,
.composer button:focus-visible,
.vocab-chip:focus-visible,
.top__icon:focus-visible,
.settings__done:focus-visible,
.wallpaper-pick:focus-visible,
.bubble__ru-btn:focus-visible,
.bubble__speak:focus-visible,
.hint-bulb:focus-visible,
.toast button:focus-visible {
  outline: 2px solid var(--accent-fg);
  outline-offset: 2px;
}

.composer button#send {
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: var(--send-fg);
  color: var(--fg-on-emphasis);
  padding: 0;
  cursor: pointer;
}

.composer button#send:hover {
  background: var(--send-emphasis);
}

.composer button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.settings {
  position: absolute;
  inset: 0;
  z-index: 6;
  display: grid;
  align-items: end;
}

.settings[hidden] {
  display: none;
}

.settings__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(16, 35, 47, 0.32);
}

.settings__sheet {
  position: relative;
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 100%;
  max-height: min(92dvh, 100%);
  overflow: hidden;
  background: var(--canvas-default);
  border-radius: 16px 16px 0 0;
  padding: 12px 16px calc(16px + env(safe-area-inset-bottom, 0px));
  box-shadow: 0 -8px 28px rgba(16, 35, 47, 0.18);
}

.settings__head {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 0;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-default);
}

.settings__head-main {
  min-width: 0;
}

.settings__head h2 {
  margin: 0;
  font-size: 1.125rem;
  font-weight: 600;
}

.settings__head-actions {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 8px;
}

.bonuses-status {
  min-height: 0;
  margin-top: 4px;
}

.bonuses-wallet {
  position: relative;
  overflow: hidden;
  margin-bottom: 4px;
  padding: 18px 20px;
  border-radius: 16px;
  background: linear-gradient(135deg, var(--accent-fg) 0%, var(--accent-emphasis) 100%);
  color: #fff;
  box-shadow: 0 6px 20px rgba(51, 144, 236, 0.28);
}

.bonuses-wallet::before,
.bonuses-wallet::after {
  content: '';
  position: absolute;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  pointer-events: none;
}

.bonuses-wallet::before {
  width: 120px;
  height: 120px;
  top: -48px;
  right: -24px;
}

.bonuses-wallet::after {
  width: 64px;
  height: 64px;
  bottom: -20px;
  left: -12px;
  background: rgba(255, 255, 255, 0.06);
}

.bonuses-wallet__eyebrow {
  position: relative;
  margin: 0;
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  opacity: 0.88;
}

.bonuses-wallet__balance {
  position: relative;
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin: 8px 0 0;
}

.bonuses-wallet__amount {
  font-size: 2.5rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  letter-spacing: -0.03em;
}

.bonuses-wallet__unit {
  font-size: 1.0625rem;
  font-weight: 500;
  opacity: 0.92;
}

.bonuses-wallet__hold {
  position: relative;
  margin: 8px 0 0;
  font-size: 0.8125rem;
  line-height: 1.35;
  opacity: 0.92;
}

.bonuses-wallet__hint {
  position: relative;
  margin: 10px 0 0;
  font-size: 0.8125rem;
  line-height: 1.35;
  opacity: 0.9;
}

.bonuses-wallet + .btn {
  margin-top: 12px;
  margin-bottom: 18px;
}

.points-history {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.points-history__empty {
  margin: 0;
  padding: 18px 4px;
  text-align: center;
  color: var(--fg-muted);
  font-size: 0.9375rem;
  line-height: 1.45;
}

.points-history__row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 4px 12px;
  padding: 12px 14px;
  border: 1px solid var(--border-default);
  border-radius: 12px;
  background: var(--canvas-default);
}

.points-history__title {
  margin: 0;
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--fg-default);
  line-height: 1.3;
}

.points-history__meta {
  margin: 0;
  grid-column: 1;
  font-size: 0.75rem;
  color: var(--fg-muted);
  line-height: 1.35;
}

.points-history__amount {
  margin: 0;
  font-size: 0.9375rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  line-height: 1.3;
  text-align: right;
}

.points-history__amount.is-plus {
  color: var(--correction-ok);
}

.points-history__amount.is-minus {
  color: var(--danger-fg);
}

.points-history__badge {
  grid-column: 2;
  justify-self: end;
  align-self: start;
  margin: 0;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.6875rem;
  font-weight: 600;
  color: var(--accent-fg);
  background: color-mix(in srgb, var(--accent-fg) 12%, transparent);
}

.settings__done {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 5.5rem;
  min-height: 44px;
  padding: 0 14px;
  border: 1px solid color-mix(in srgb, var(--accent-fg) 28%, transparent);
  border-radius: 10px;
  background: var(--accent-subtle);
  color: var(--accent-emphasis);
  font: inherit;
  font-size: 0.9375rem;
  font-weight: 600;
  line-height: 1.2;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.settings__done:hover {
  border-color: var(--accent-fg);
  background: color-mix(in srgb, var(--accent-fg) 16%, #fff);
  color: var(--accent-emphasis);
}

.settings__done:active {
  background: color-mix(in srgb, var(--accent-fg) 16%, #fff);
}

.sheet-body--wallpapers {
  padding-top: 12px;
}

.wallpaper-picks {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.wallpaper-pick {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  border: 0;
  background: transparent;
  padding: 0;
  color: var(--fg-default);
  font: inherit;
  font-size: 0.8125rem;
  cursor: pointer;
}

.wallpaper-pick__swatch {
  display: block;
  width: 100%;
  aspect-ratio: 3 / 4;
  border-radius: 14px;
  background-size: 140px 140px;
  box-shadow: 0 1px 2px rgba(16, 35, 47, 0.12);
}

.wallpaper-pick__swatch--grove {
  background-color: #a8c8b4;
  background-image: url("/chats/chat-wallpaper-grove.svg");
}
.wallpaper-pick__swatch--ash {
  background-color: #a8b4c0;
  background-image: url("/chats/chat-wallpaper-ash.svg");
}
.wallpaper-pick__swatch--sky {
  background-color: #9ed4e8;
  background-image: url("/chats/chat-wallpaper-sky.svg");
}
.wallpaper-pick__swatch--figures {
  background-color: #e8a8b8;
  background-image: url("/chats/chat-wallpaper-figures.svg?v=20260930k");
}
.wallpaper-pick__swatch--magic {
  background-color: #c4b8d4;
  background-image: url("/chats/chat-wallpaper-magic.svg?v=20260930k");
}
.wallpaper-pick__swatch--desert {
  background-color: #e0c8a0;
  background-image: url("/chats/chat-wallpaper-desert.svg");
}

.wallpaper-pick[aria-pressed="true"] .wallpaper-pick__swatch {
  outline: 2px solid var(--send-fg);
  outline-offset: 2px;
}

.tts-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 12px;
  font-size: 0.9375rem;
  color: var(--fg-default);
  cursor: pointer;
}

.tts-toggle input {
  width: 1.1rem;
  height: 1.1rem;
  accent-color: var(--send-fg);
}

.tts-voices-label {
  margin: 8px 0 8px;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--fg-muted);
}

.tts-voices {
  display: flex;
  gap: 8px;
}

.tts-voices__col {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}

.tts-voice {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  border: 0;
  border-radius: 12px;
  background: var(--canvas-subtle, rgba(16, 35, 47, 0.06));
  color: var(--fg-default);
  font: inherit;
  text-align: left;
  padding: 10px 12px;
  cursor: pointer;
}

.tts-voice strong {
  font-size: 0.9375rem;
  font-weight: 600;
}

.tts-voice span {
  font-size: 0.75rem;
  color: var(--fg-muted);
}

.tts-voice[aria-pressed="true"] {
  outline: 2px solid var(--send-fg);
  outline-offset: 1px;
  background: var(--accent-subtle);
}

.toast {
  position: absolute;
  left: 8px;
  right: 8px;
  bottom: 4.75rem;
  display: flex;
  gap: 0.75rem;
  align-items: center;
  background: var(--canvas-default);
  border-radius: 12px;
  padding: 0.65rem 0.85rem;
  box-shadow: 0 4px 16px rgba(16, 35, 47, 0.18);
  z-index: 2;
  cursor: pointer;
}

.toast button {
  border: 0;
  border-radius: 16px;
  background: var(--send-fg);
  color: var(--fg-on-emphasis);
  font-weight: 600;
  padding: 0.35rem 0.8rem;
  cursor: pointer;
}

.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

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

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

@keyframes finalize {
  0%   { opacity: 1; }
  40%  { opacity: 0.7; }
  100% { opacity: 1; }
}

@media (max-width: 640px) {
  .peer__status { max-width: 42vw; }
}

@media (max-width: 480px) {
  .chat-shell { box-shadow: none; }
}

/* Sheet forms — structured, service-grade UI */
.sheet-body {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
  min-height: 0;
  padding: 16px 4px 8px;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.sheet-body::-webkit-scrollbar {
  display: none;
}

.sheet-body > * {
  flex-shrink: 0;
}

.form-stack {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
}

.form-stack[hidden],
.auth-panel[hidden] {
  display: none;
}

.auth-panel {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.account-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 14px 16px;
  border: 1px solid var(--border-default);
  border-radius: 12px;
  background: var(--canvas-subtle);
}

.account-row--field {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 6px;
}

.account-row--field .account-label {
  margin: 0;
}

.account-timezone {
  width: 100%;
}

.account-card--common {
  margin-bottom: 12px;
}

.progress-panel[hidden] {
  display: none;
}

.progress-panel {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.progress-metric {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 14px 16px;
  border: 1px solid var(--border-default);
  border-radius: 12px;
  background: var(--canvas-subtle);
}

.progress-metric__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.progress-metric__title {
  margin: 0;
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--fg-default);
}

.progress-metric__value {
  font-variant-numeric: tabular-nums;
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--accent-fg);
}

.progress-metric__note {
  margin: 0;
  font-size: 0.8125rem;
  line-height: 1.4;
  color: var(--fg-muted);
}

.progress-level {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px 16px;
  border: 1px solid var(--border-default);
  border-radius: 12px;
  background: var(--canvas-subtle);
}

.progress-level__title {
  margin: 0;
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--fg-default);
}

.progress-cefr {
  list-style: none;
  display: flex;
  flex-wrap: nowrap;
  gap: 6px;
  margin: 0;
  padding: 0;
}

.progress-cefr__item {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 8px 4px;
  border: 1px solid var(--border-default);
  border-radius: 10px;
  background: var(--canvas-default);
  color: var(--fg-muted);
  text-align: center;
}

.progress-cefr__code {
  font-size: 0.875rem;
  font-weight: 700;
  line-height: 1.2;
  color: inherit;
}

.progress-cefr__name {
  font-size: 0.5625rem;
  font-weight: 500;
  line-height: 1.15;
  opacity: 0.9;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.progress-cefr__item.is-active {
  border-color: color-mix(in srgb, var(--accent-fg) 45%, transparent);
  background: var(--accent-subtle);
  color: var(--accent-emphasis);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent-fg) 18%, transparent);
}

.progress-cefr__item.is-active .progress-cefr__code {
  color: var(--accent-emphasis);
}

@media (max-width: 480px) {
  .progress-cefr {
    gap: 4px;
  }

  .progress-cefr__item {
    padding: 8px 2px;
  }

  .progress-cefr__name {
    display: none;
  }
}

.account-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.account-toggle {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
}

.account-toggle input {
  width: 1.1rem;
  height: 1.1rem;
  accent-color: var(--brand, #3390ec);
}

.account-row[hidden] {
  display: none;
}

.account-label {
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--fg-muted);
}

.account-value {
  font-size: 1rem;
  font-weight: 600;
  color: var(--fg-default);
  word-break: break-word;
}

.account-value--email {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
}

.account-email-check {
  display: inline-flex;
  width: 1rem;
  height: 0.9rem;
  flex-shrink: 0;
  color: var(--correction-ok);
}

.account-email-check svg {
  display: block;
  width: 100%;
  height: 100%;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.account-email-check[hidden] {
  display: none;
}

.account-note {
  margin: 0;
  font-size: 0.8125rem;
  color: var(--attention-fg);
}

.account-note[hidden] {
  display: none;
}

.account-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.account-actions .btn[hidden] {
  display: none !important;
}

.is-invisible {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.is-invisible-input {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.auth-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.password-field {
  position: relative;
}

.password-field .control {
  padding-right: 44px;
}

.password-toggle {
  position: absolute;
  top: 50%;
  right: 4px;
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  transform: translateY(-50%);
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--fg-muted);
  cursor: pointer;
}

.password-toggle:hover {
  color: var(--fg-default);
}

.password-toggle .eye-off {
  display: none;
}

.password-toggle.is-on .eye-on {
  display: none;
}

.password-toggle.is-on .eye-off {
  display: block;
}

.auth-captcha {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.auth-captcha[hidden] {
  display: none !important;
}

.auth-captcha > label {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--fg-default);
}

.auth-captcha-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.auth-captcha-row .control {
  width: 7rem;
  flex: 0 0 auto;
}

.auth-captcha-refresh {
  width: auto;
  min-width: 44px;
  padding-inline: 12px;
}

.auth-switch {
  margin: 4px 0 0;
  font-size: 0.875rem;
  color: var(--fg-muted);
}

.auth-switch button {
  border: 0;
  background: none;
  color: var(--accent-fg);
  font: inherit;
  font-weight: 600;
  padding: 0;
  cursor: pointer;
}

.auth-switch[hidden] {
  display: none !important;
}

.form-section {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
}

.form-section + .form-section {
  padding-top: 16px;
  border-top: 1px solid var(--border-default);
}

.form-lead {
  margin: 0;
  font-size: 0.875rem;
  line-height: 1.5;
  color: var(--fg-muted);
}

.form-lead strong {
  color: var(--fg-default);
  font-weight: 600;
}

.form-card {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 14px 16px;
  border: 1px solid var(--border-default);
  border-radius: 12px;
  background: var(--canvas-subtle);
}

.form-card[hidden] {
  display: none;
}

.form-card__label {
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--fg-muted);
}

.form-card__value {
  margin: 0;
  font-size: 1.375rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--fg-default);
}

.form-card__note {
  margin: 2px 0 0;
  font-size: 0.8125rem;
  color: var(--fg-muted);
}

.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}

.field__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.field > label,
.field__head > label {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--fg-default);
}

.field__meta {
  font-size: 0.75rem;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  color: var(--fg-muted);
}

.field__hint {
  margin: 0;
  font-size: 0.8125rem;
  line-height: 1.45;
  color: var(--fg-muted);
}

.field__hint.is-error {
  color: var(--danger-fg);
}

.control {
  width: 100%;
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid var(--border-default);
  border-radius: 10px;
  font: inherit;
  font-size: 16px;
  background: var(--canvas-default);
  color: var(--fg-default);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.control:read-only {
  color: var(--fg-muted);
  background: var(--canvas-subtle);
  cursor: default;
}

.control::placeholder {
  color: #8b949e;
}

.control:hover:not(:disabled):not(:focus) {
  border-color: #afb8c1;
}

.control:focus {
  outline: none;
  border-color: var(--accent-fg);
  box-shadow: 0 0 0 3px var(--accent-subtle);
}

.control:disabled {
  background: var(--canvas-subtle);
  color: var(--fg-muted);
  cursor: not-allowed;
}

.control--mono,
.control--code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 15px;
  letter-spacing: 0.02em;
  overflow: hidden;
  text-overflow: ellipsis;
}

.control--area {
  min-height: 120px;
  padding: 12px;
  line-height: 1.45;
  resize: vertical;
}

.input-row {
  display: flex;
  align-items: stretch;
  gap: 8px;
  min-width: 0;
  max-width: 100%;
}

.input-row .control {
  flex: 1 1 0;
  min-width: 0;
  width: auto;
}

.input-row .btn {
  flex-shrink: 0;
}

.input-row__icon-btn {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  min-height: 44px;
  border: 1px solid var(--border-default);
  border-radius: 10px;
  background: var(--canvas-subtle);
  color: var(--accent-fg);
  cursor: pointer;
}

.input-row__icon-btn:hover:not(:disabled) {
  background: var(--accent-subtle);
}

.input-row__icon-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.input-row__icon-btn.is-copied {
  color: var(--correction-ok);
  border-color: rgba(46, 125, 50, 0.35);
  background: rgba(46, 125, 50, 0.08);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 16px;
  border: 1px solid transparent;
  border-radius: 10px;
  font: inherit;
  font-size: 0.9375rem;
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, opacity 0.15s ease;
}

.btn--primary {
  background: var(--accent-fg);
  color: var(--fg-on-emphasis);
}

.btn--primary:hover:not(:disabled) {
  background: var(--accent-emphasis);
}

.btn--secondary {
  background: var(--accent-subtle);
  border-color: color-mix(in srgb, var(--accent-fg) 28%, transparent);
  color: var(--accent-emphasis);
}

.btn--secondary:hover:not(:disabled) {
  border-color: var(--accent-fg);
  background: color-mix(in srgb, var(--accent-fg) 16%, #fff);
  color: var(--accent-emphasis);
}

.btn--with-icon {
  gap: 8px;
}

.btn--with-icon svg {
  flex: 0 0 auto;
}

.btn--ghost {
  min-height: auto;
  padding: 6px 0;
  background: transparent;
  color: var(--accent-fg);
}

.btn--ghost:hover:not(:disabled) {
  color: var(--accent-emphasis);
}

.btn--block {
  width: 100%;
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.form-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.form-status {
  margin: 0;
  min-height: 1.25rem;
  font-size: 0.8125rem;
  line-height: 1.45;
  color: var(--fg-muted);
}

.form-status.is-error {
  color: var(--danger-fg);
}

.form-status.is-ok {
  color: var(--correction-ok);
}

.btn:focus-visible,
.control:focus-visible,
.settings__done:focus-visible {
  outline: 2px solid var(--accent-fg);
  outline-offset: 2px;
}

.bonuses-progress {
  padding: 12px 14px;
  border: 1px solid var(--border-default);
  border-radius: 12px;
  background: var(--canvas-default);
}

.bonuses-progress__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
  font-size: 0.8125rem;
  color: var(--fg-muted);
}

.bonuses-progress__head span:last-child {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  color: var(--fg-default);
}

.bonuses-progress__bar {
  height: 6px;
  border-radius: 3px;
  background: var(--canvas-inset);
  overflow: hidden;
}

.bonuses-progress__fill {
  height: 100%;
  width: 0;
  background: var(--accent-fg);
  border-radius: 3px;
  transition: width 0.2s ease;
}

.bonuses-section {
  margin: 0;
}

.bonuses-section__title {
  margin: 0 0 10px;
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--fg-muted);
}

.bonuses-section + .bonuses-section {
  margin-top: 22px;
}

.bonus-challenges {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.bonus-challenge {
  padding: 14px 16px;
  border: 1px solid var(--border-default);
  border-radius: 14px;
  background: var(--canvas-default);
}

.bonus-challenge.is-complete {
  border-color: #b7dfba;
  background: #f6fcf7;
}

.bonus-challenge__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.bonus-challenge__title {
  margin: 0;
  flex: 1;
  min-width: 0;
  font-size: 0.9375rem;
  font-weight: 600;
  line-height: 1.35;
}

.bonus-challenge__reward {
  flex-shrink: 0;
  max-width: 42%;
  font-size: 0.8125rem;
  font-weight: 600;
  line-height: 1.35;
  color: var(--correction-ok);
  text-align: right;
}

.bonus-challenge__reward-note {
  color: var(--fg-muted);
  font-weight: 500;
}

.bonus-challenge__content {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 6px;
}

.bonus-challenge__subtitle {
  margin: 0;
  font-size: 0.8125rem;
  line-height: 1.45;
  color: var(--fg-muted);
}

.bonus-challenge__renewal {
  margin: 0;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--accent-fg);
}

.bonus-challenge__progress {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border-default);
}

.bonus-challenge__progress-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.bonus-challenge__progress-label {
  font-size: 0.75rem;
  line-height: 1.3;
  color: var(--fg-muted);
}

.bonus-challenge__progress-value {
  display: inline-flex;
  align-items: baseline;
  gap: 2px;
  font-size: 0.875rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--fg-default);
  white-space: nowrap;
}

.bonus-challenge__progress-sep {
  margin: 0 1px;
  color: var(--fg-muted);
  font-weight: 500;
}

.bonus-challenge__progress-current {
  color: var(--accent-fg);
}

.bonus-challenge .bonuses-progress__bar {
  margin-top: 0;
}

.bonus-challenge__subtitle .bonus-challenge__code {
  font-weight: 700;
  color: var(--accent-fg);
  letter-spacing: 0.04em;
}

.bonus-challenge__code {
  font-weight: 600;
  color: var(--fg-default);
  letter-spacing: 0.02em;
}

.bonus-challenge__action {
  display: inline-flex;
  align-items: center;
  margin-top: 10px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--accent-fg);
  font: inherit;
  font-size: 0.8125rem;
  font-weight: 600;
  cursor: pointer;
}

.bonus-challenge__action:hover {
  text-decoration: underline;
}

.bonus-challenge--referral .promo-card__link {
  margin-top: 0;
}

.promo-card__link {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-width: 0;
  margin-top: 0;
  padding: 8px 10px;
  border-radius: 10px;
  background: var(--canvas-subtle);
  box-sizing: border-box;
}

.bonus-challenge--promo {
  padding: 16px;
  border-color: rgba(51, 144, 236, 0.22);
  background: linear-gradient(180deg, #f8fbfe 0%, var(--canvas-default) 100%);
  box-shadow: 0 1px 2px rgba(51, 144, 236, 0.08);
}

.bonus-challenge__head--solo {
  margin-bottom: 0;
}

.bonus-challenge__head--solo .bonus-challenge__title {
  font-size: 1rem;
}

.bonus-challenge--promo .bonus-challenge__subtitle {
  margin: 4px 0 0;
}

.promo-card__code {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  margin-top: 14px;
  padding: 14px 16px;
  border: 1px dashed rgba(51, 144, 236, 0.35);
  border-radius: 12px;
  background: var(--canvas-default);
}

.promo-card__code-label {
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--fg-muted);
}

.promo-card__code-value--copy {
  flex: 1;
  min-width: 0;
  border: 0;
  padding: 0;
  background: transparent;
  font: inherit;
  font-size: 1.375rem;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: 0.08em;
  font-variant-numeric: tabular-nums;
  color: var(--accent-fg);
  cursor: pointer;
}

.promo-card__code-value--copy:hover,
.promo-card__code-value--copy.is-copied {
  color: var(--correction-ok);
}

.promo-card__link--code-large {
  width: 100%;
  margin-top: 2px;
  padding: 0;
  background: transparent;
}

.promo-card__link-url--code {
  font-size: 0.875rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--accent-fg);
}

.promo-card__link-url--code:hover,
.promo-card__link-url--code.is-copied {
  color: var(--correction-ok);
}

.promo-card__copy-icon.is-copied {
  color: var(--correction-ok);
  background: rgba(34, 158, 87, 0.12);
}

.promo-card__code-value {
  font-size: 1.375rem;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: 0.08em;
  font-variant-numeric: tabular-nums;
  color: var(--accent-fg);
}

.promo-card__link-url {
  flex: 1;
  min-width: 0;
  border: 0;
  padding: 0;
  background: transparent;
  font: inherit;
  font-size: 0.75rem;
  line-height: 1.3;
  color: var(--fg-muted);
  text-align: left;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: pointer;
}

.promo-card__link-url:hover {
  color: var(--accent-fg);
}

.promo-card__link-actions {
  display: inline-flex;
  flex-shrink: 0;
  align-items: center;
  gap: 6px;
}

.promo-card__icon-btn,
.promo-card__copy-icon {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 8px;
  background: var(--accent-subtle);
  color: var(--accent-fg);
  cursor: pointer;
}

.promo-card__icon-btn:hover,
.promo-card__copy-icon:hover {
  background: #d6ebfa;
}

.promo-card__icon-btn.is-copied,
.promo-card__copy-icon.is-copied,
.promo-card__link-url.is-copied {
  color: var(--correction-ok);
}

.promo-card__copy {
  flex-shrink: 0;
  border: 0;
  border-radius: 8px;
  padding: 6px 10px;
  background: var(--accent-subtle);
  color: var(--accent-fg);
  font: inherit;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
}

.promo-card__copy:hover {
  background: #d6ebfa;
}

.promo-card__copy:disabled {
  opacity: 0.7;
  cursor: default;
}

.promo-card__manage {
  width: 100%;
  margin-top: 12px;
  border: 0;
  border-radius: 10px;
  padding: 11px 14px;
  background: var(--accent-fg);
  color: #fff;
  font: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
}

.promo-card__manage:hover {
  background: var(--accent-emphasis);
}

.bonus-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.bonus-rule {
  padding: 14px 16px;
  border: 1px solid var(--border-default);
  border-radius: 12px;
  background: var(--canvas-default);
}

.bonus-rule.is-planned {
  background: var(--canvas-subtle);
}

.bonus-rule__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 6px;
}

.bonus-rule__title {
  margin: 0;
  font-size: 0.9375rem;
  font-weight: 600;
  line-height: 1.35;
}

.bonus-rule__reward {
  flex-shrink: 0;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--correction-ok);
  text-align: right;
}

.bonus-rule.is-planned .bonus-rule__reward {
  color: var(--fg-muted);
}

.bonus-rule__limit {
  margin: 0 0 4px;
  font-size: 0.8125rem;
  color: var(--fg-default);
}

.bonus-rule__note {
  margin: 0;
  font-size: 0.75rem;
  line-height: 1.45;
  color: var(--fg-muted);
}
