/* ARPI 30 — голосовые, присутствие, статусы, темы, QR, доска, стрики */

/* ---------- запись голосового «как на видео» ---------- */
.composer .voice-rec {
  left: 8px;
  right: 8px;
  bottom: calc(100% + 6px);
  gap: 8px;
  padding: 7px 9px 7px 8px;
  border-radius: 26px;
  color: #fff;
  background: linear-gradient(110deg, #3d5bff 0%, #8b3dff 42%, #26a7ff 78%, #3d5bff 100%);
  background-size: 260% 100%;
  animation: voice-shimmer 4s linear infinite;
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, .22),
    0 16px 40px rgba(52, 72, 255, .42),
    0 0 30px rgba(90, 120, 255, .35);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
}
@keyframes voice-shimmer {
  0% { background-position: 0% 50%; }
  100% { background-position: 260% 50%; }
}
.voice-trash,
.voice-ctrl,
.voice-send {
  flex: none;
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, .16);
  color: #fff;
  cursor: pointer;
  transition: background .18s var(--ease), transform .18s var(--ease);
}
.voice-trash:hover,
.voice-ctrl:hover { background: rgba(255, 255, 255, .3); }
.voice-send {
  background: #fff;
  color: #3d5bff;
  box-shadow: 0 6px 18px rgba(10, 20, 80, .35);
}
.voice-send:hover { transform: scale(1.06); }
.voice-trash .ico,
.voice-ctrl .ico,
.voice-send .ico { width: 19px; height: 19px; }
.voice-live {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  overflow: hidden;
}
.voice-viz {
  flex: none;
  width: 104px;
  height: 30px;
  opacity: .95;
}
.voice-label {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .2px;
  background: linear-gradient(90deg, #fff 0%, #cfe0ff 45%, #fff 90%);
  background-size: 220% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: voice-shimmer 2.4s linear infinite;
}
.voice-time {
  flex: none;
  font-variant-numeric: tabular-nums;
  font-size: 12px;
  font-weight: 700;
  opacity: .9;
  padding: 0 2px;
}
.voice-dot, .voice-wave { display: none !important; }

/* ---------- пузырь голосового сообщения ---------- */
.msg-voice {
  min-width: 240px;
  max-width: 330px;
  padding: 2px 0;
}
.voice-player {
  display: flex;
  align-items: center;
  gap: 9px;
}
.voice-play {
  flex: none;
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: var(--primary);
  color: var(--on-primary);
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(0, 0, 0, .18);
  transition: transform .16s var(--ease), background-color .16s var(--ease);
}
.voice-play:hover { transform: scale(1.05); }
.voice-play .ico { width: 19px; height: 19px; }
.msg-row.own .voice-play { background: var(--on-primary); color: var(--primary); }
.voice-bars {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 2px;
  height: 32px;
  cursor: pointer;
  touch-action: none;
}
.voice-bars i {
  flex: 1;
  min-width: 2px;
  max-width: 4px;
  height: calc(5px + var(--h, .4) * 23px);
  border-radius: 2px;
  background: currentColor;
  opacity: .32;
  transition: opacity .12s linear, background-color .12s linear;
}
.voice-bars i.is-on { opacity: 1; background: var(--primary); }
.msg-row.own .voice-bars i.is-on { background: var(--on-primary); }
.voice-meta {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-top: 3px;
  padding-left: 49px;
}
.voice-dur {
  font-size: 11.5px;
  font-variant-numeric: tabular-nums;
  opacity: .8;
}
.voice-rate {
  margin-left: auto;
  border: 0;
  border-radius: 999px;
  padding: 2px 8px;
  background: color-mix(in srgb, currentColor 14%, transparent);
  color: inherit;
  font: inherit;
  font-size: 10.5px;
  font-weight: 700;
  cursor: pointer;
}

/* ---------- присутствие, настроение, стрик ---------- */
.presence-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-right: 5px;
  border-radius: 50%;
  background: #25d366;
  box-shadow: 0 0 8px rgba(37, 211, 102, .75);
  vertical-align: middle;
}
.presence-dot.off {
  background: var(--on-surface-variant);
  box-shadow: none;
  opacity: .5;
}
.chat-sub-line {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
}
.mood-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 1px 9px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--primary) 18%, transparent);
  color: var(--on-surface-variant);
  font-size: 10.5px;
  font-weight: 600;
  max-width: 190px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.streak-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 1px 9px;
  border-radius: 999px;
  background: linear-gradient(120deg, rgba(255, 122, 24, .22), rgba(255, 61, 61, .2));
  color: #ffb066;
  font-size: 10.5px;
  font-weight: 700;
  white-space: nowrap;
}
.streak-chip .ico { width: 12px; height: 12px; fill: currentColor; stroke: none; }
.mood-line {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 10px;
  margin-top: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .16);
  color: #fff;
  font-size: 11.5px;
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}
.pf-presence {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 6px;
  padding: 3px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .16);
  color: #fff;
  font-size: 11.5px;
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}

/* «Избранное» — личный чат */
.dm-self .avatar,
.dm-self .feed-story-av { box-shadow: 0 0 0 2px var(--primary), 0 0 14px color-mix(in srgb, var(--primary) 55%, transparent); }

/* ---------- магазин тем ---------- */
.theme-list {
  display: grid;
  gap: 8px;
  max-height: 44vh;
  overflow-y: auto;
  padding: 2px;
  margin: 4px 0 10px;
}
.theme-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 11px;
  border-radius: 16px;
  background: var(--surface-container);
  border: 1px solid var(--outline-variant);
}
.theme-swatches {
  flex: none;
  display: flex;
  gap: 3px;
}
.theme-swatches i {
  width: 15px;
  height: 26px;
  border-radius: 6px;
}
.theme-body { flex: 1; min-width: 0; }
.theme-body b { display: block; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.theme-body small { color: var(--on-surface-variant); font-size: 10.5px; }
.theme-card .btn { flex: none; }
.theme-publish { margin-top: 6px; }
.theme-publish .field { margin-bottom: 8px; }
.theme-empty { padding: 24px 8px; text-align: center; color: var(--on-surface-variant); }

/* ---------- QR-вход ---------- */
.qr-box {
  display: grid;
  place-items: center;
  min-height: 224px;
  margin: 8px 0;
  padding: 12px;
  border-radius: 18px;
  background: #fff;
}
.qr-box canvas, .qr-box img { width: 200px; height: 200px; image-rendering: pixelated; }
.qr-box .qr-fallback { color: #333; font-size: 12px; text-align: center; }
.qr-token {
  display: block;
  padding: 10px 12px;
  border-radius: 12px;
  background: var(--surface-container-high);
  font-size: 12.5px;
  letter-spacing: 1px;
  text-align: center;
  overflow-wrap: anywhere;
}
.qr-actions { display: flex; gap: 8px; margin-top: 10px; }
.qr-actions .btn { flex: 1; }
.auth-code { margin-top: 6px; }

/* ---------- общая доска ---------- */
.dialog-board { max-width: 780px; }
.board-tools {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 4px 0 8px;
  flex-wrap: wrap;
}
.board-tools input[type="color"] {
  width: 36px;
  height: 30px;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  cursor: pointer;
}
.board-tools input[type="range"] { width: 100px; accent-color: var(--primary); }
.board-status { margin-left: auto; font-size: 11px; color: var(--on-surface-variant); }
#board-canvas {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 660 / 430;
  border-radius: 14px;
  background: #fff;
  box-shadow: inset 0 0 0 1px var(--outline-variant);
  touch-action: none;
  cursor: crosshair;
}

@media (max-width: 560px) {
  .composer .voice-rec { left: 6px; right: 6px; bottom: calc(100% + 4px); padding: 6px 7px; }
  .voice-viz { width: 64px; }
  .voice-time { display: none; }
  .voice-label { font-size: 12px; }
  .msg-voice { min-width: 210px; }
  .dialog-board { padding: 14px; }
}

/* ---------- строка статуса под именем чата ---------- */
.chat-sub-line {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
  min-height: 18px;
}
.chat-sub-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
}
.presence-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11.5px;
  color: var(--on-surface-variant);
  white-space: nowrap;
}
.presence-chip .presence-dot { margin-right: 0; }
.item-top .streak-chip { margin-left: 7px; flex: none; }
.item-bottom .mood-chip { margin-left: 7px; flex: none; max-width: 130px; }
.avatar.has-presence { position: relative; }
.avatar.has-presence .presence-dot {
  position: absolute;
  right: -1px;
  bottom: -1px;
  width: 11px;
  height: 11px;
  border: 2px solid var(--surface, #fff);
}
.chat-actions .icon-btn .ico { width: 20px; height: 20px; }

/* ---------- реклама ARPI ---------- */
.dialog-invite { max-width: 460px; }
.invite-qr {
  display: grid;
  place-items: center;
  min-height: 184px;
  margin: 6px 0 10px;
  padding: 10px;
  border-radius: 18px;
  background: #fff;
}
.invite-qr canvas, .invite-qr img { width: 168px; height: 168px; image-rendering: pixelated; }
.invite-qr .qr-fallback { color: #333; font-size: 12px; text-align: center; overflow-wrap: anywhere; }
.invite-ad {
  margin: 8px 0;
  padding: 10px 12px;
  border-radius: 14px;
  background: var(--surface-container);
  color: var(--on-surface-variant);
  font-size: 12.5px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}
.invite-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.invite-actions .btn { flex: 1 1 auto; min-width: 92px; }

.auth-promo {
  display: grid;
  gap: 4px;
  margin: 12px 0 4px;
  padding: 12px 14px;
  border-radius: 18px;
  background: linear-gradient(120deg, rgba(103, 80, 164, .16), rgba(38, 167, 255, .14));
  border: 1px solid rgba(103, 80, 164, .28);
  text-align: center;
}
.auth-promo strong { font-size: 13px; line-height: 1.35; }
.auth-promo span { font-size: 11.5px; color: var(--on-surface-variant); }
.auth-promo .btn { margin-top: 4px; }

.theme-card .btn-sm { flex: none; height: 32px; padding: 0 12px; }
.theme-card .icon-btn { flex: none; }
.dialog-themes { max-width: 480px; }
.dialog-qr { max-width: 400px; }
.qr-fallback { color: var(--on-surface-variant); font-size: 12px; text-align: center; }
