/* LibOTP live chat — ~80% viewport sheet + Messenger-style bubble */
.lc-sheet {
  position: fixed;
  inset: 0;
  z-index: 12050;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem;
  background: rgba(10, 20, 30, 0.48);
  backdrop-filter: blur(4px);
}

.lc-sheet.hidden {
  display: none !important;
}

.lc-panel {
  width: min(520px, 100%);
  height: min(80vh, 720px);
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  border-radius: 20px;
  overflow: hidden;
  background: var(--panel, #10202a);
  color: var(--text, #e8f1f5);
  border: 1px solid color-mix(in srgb, var(--mint, #3dffc5) 28%, var(--line, #2a3d4a));
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.28);
  font-family: var(--font, 'Manrope', system-ui, sans-serif);
}

html[data-theme='light'] .lc-panel {
  background: #fff;
  color: #12202a;
}

.lc-head {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.85rem 0.75rem 0.85rem 0.95rem;
  border-bottom: 1px solid var(--line, rgba(255, 255, 255, 0.08));
  background:
    linear-gradient(120deg, color-mix(in srgb, var(--mint, #3dffc5) 16%, transparent), transparent 60%);
  flex-shrink: 0;
}

.lc-avatar {
  width: 2.35rem;
  height: 2.35rem;
  border-radius: 12px;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-family: var(--font-display, 'Space Grotesk', system-ui, sans-serif);
  color: #041018;
  background: linear-gradient(135deg, var(--mint, #3dffc5), #2ad0ff);
  flex-shrink: 0;
}

.lc-head-meta {
  flex: 1;
  min-width: 0;
}

.lc-head-meta strong {
  display: block;
  font-family: var(--font-display, 'Space Grotesk', system-ui, sans-serif);
  font-size: 1.02rem;
  letter-spacing: -0.02em;
}

.lc-status {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin-top: 0.15rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--muted, #8aa0ad);
}

.lc-dot {
  width: 0.45rem;
  height: 0.45rem;
  border-radius: 50%;
  background: #94a3b8;
}

.lc-dot.is-ai { background: #22c55e; }
.lc-dot.is-queued { background: #f59e0b; }
.lc-dot.is-human { background: #38bdf8; }
.lc-dot.is-closed { background: #94a3b8; }

.lc-close {
  border: 0;
  background: transparent;
  color: var(--muted, #8aa0ad);
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
  padding: 0.25rem 0.4rem;
  border-radius: 8px;
  flex-shrink: 0;
}

.lc-close:hover {
  color: inherit;
  background: rgba(127, 127, 127, 0.12);
}

.lc-win-btn {
  width: 2.35rem;
  height: 2.35rem;
  border: 0;
  border-radius: 10px;
  display: grid;
  place-items: center;
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
  flex-shrink: 0;
  font-weight: 700;
}
.lc-win-btn.lc-min {
  background: rgba(127, 127, 127, 0.14);
  color: inherit;
}
.lc-win-btn.lc-min:hover {
  background: rgba(127, 127, 127, 0.28);
}
.lc-win-btn.lc-x {
  background: #e81123;
  color: #fff;
}
.lc-win-btn.lc-x:hover {
  background: #c50f1f;
}
.lc-win-btn.lc-x:active {
  background: #a80d1a;
}

.lc-chips {
  display: flex;
  flex-wrap: nowrap;
  gap: 0.4rem;
  padding: 0.55rem 0.85rem 0.35rem;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  flex-shrink: 0;
  scrollbar-width: none;
}

.lc-chips::-webkit-scrollbar {
  display: none;
}

.lc-chip {
  border: 1px solid var(--line, rgba(255, 255, 255, 0.12));
  background: color-mix(in srgb, var(--mint, #3dffc5) 8%, transparent);
  color: inherit;
  border-radius: 999px;
  padding: 0.35rem 0.7rem;
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  white-space: nowrap;
  flex-shrink: 0;
}

.lc-chip:hover {
  border-color: color-mix(in srgb, var(--mint, #3dffc5) 45%, var(--line));
}

.lc-msgs {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  padding: 0.65rem 0.85rem 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  touch-action: pan-y;
}

.lc-bubble {
  max-width: 88%;
  padding: 0.65rem 0.8rem;
  border-radius: 14px;
  font-size: 0.9rem;
  line-height: 1.4;
  white-space: pre-wrap;
  word-break: break-word;
}

.lc-bubble.is-user {
  align-self: flex-end;
  background: linear-gradient(135deg, color-mix(in srgb, var(--mint, #3dffc5) 70%, #0a8f6c), #0a8f6c);
  color: #041018;
  border-bottom-right-radius: 5px;
}

.lc-bubble.is-assistant,
.lc-bubble.is-agent {
  align-self: flex-start;
  background: color-mix(in srgb, var(--panel, #183040) 70%, #000);
  border: 1px solid var(--line, rgba(255, 255, 255, 0.08));
  border-bottom-left-radius: 5px;
}

html[data-theme='light'] .lc-bubble.is-assistant,
html[data-theme='light'] .lc-bubble.is-agent {
  background: #f3f7fa;
}

.lc-bubble.is-system {
  align-self: center;
  max-width: 94%;
  background: transparent;
  color: var(--muted, #8aa0ad);
  font-size: 0.78rem;
  text-align: center;
  padding: 0.25rem 0.5rem;
}

.lc-bubble-role {
  display: block;
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  opacity: 0.7;
  margin-bottom: 0.2rem;
}

.lc-foot {
  border-top: 1px solid var(--line, rgba(255, 255, 255, 0.08));
  padding: 0.65rem 0.75rem calc(0.75rem + env(safe-area-inset-bottom, 0px));
  display: grid;
  gap: 0.45rem;
  flex-shrink: 0;
  background: inherit;
  position: relative;
  z-index: 2;
}

.lc-actions {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.lc-actions button {
  border: 1px solid var(--line, rgba(255, 255, 255, 0.12));
  background: transparent;
  color: inherit;
  border-radius: 999px;
  padding: 0.35rem 0.7rem;
  font-size: 0.74rem;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
}

.lc-actions button.primary {
  background: color-mix(in srgb, var(--mint, #3dffc5) 18%, transparent);
  border-color: color-mix(in srgb, var(--mint, #3dffc5) 40%, var(--line));
}

.lc-compose {
  display: flex;
  gap: 0.4rem;
  align-items: flex-end;
}

.lc-back {
  width: 2.1rem;
  height: 2.1rem;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: inherit;
  font-size: 1.15rem;
  cursor: pointer;
  flex-shrink: 0;
}
.lc-back.hidden { display: none !important; }

.lc-inbox {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--mint, #3dffc5) 6%, transparent), transparent 28%);
}
.lc-inbox.hidden { display: none !important; }

.lc-new-chat {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 0.75rem 0.85rem 0.35rem;
  padding: 0.8rem 0.9rem;
  border: 1px solid color-mix(in srgb, var(--mint, #3dffc5) 35%, var(--line, #2a3d4a));
  border-radius: 16px;
  background: color-mix(in srgb, var(--mint, #3dffc5) 12%, transparent);
  color: inherit;
  text-align: left;
  cursor: pointer;
  font: inherit;
  flex-shrink: 0;
}
.lc-new-ico {
  width: 2.4rem;
  height: 2.4rem;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 1.25rem;
  font-weight: 800;
  background: var(--mint, #3dffc5);
  color: #041018;
  flex-shrink: 0;
}
.lc-new-chat strong { display: block; font-size: 0.95rem; }
.lc-new-chat em {
  display: block;
  font-style: normal;
  font-size: 0.75rem;
  color: var(--muted, #8aa0ad);
  margin-top: 0.1rem;
}

.lc-inbox-list {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 0.25rem 0 0.75rem;
}
.lc-inbox-empty {
  margin: 2rem 1.25rem;
  text-align: center;
  color: var(--muted, #8aa0ad);
  font-size: 0.88rem;
  line-height: 1.4;
}
.lc-inbox-row {
  width: 100%;
  display: grid;
  grid-template-columns: 48px 1fr;
  gap: 0.7rem;
  align-items: center;
  padding: 0.75rem 0.95rem;
  border: 0;
  border-bottom: 1px solid color-mix(in srgb, var(--line, #2a3d4a) 70%, transparent);
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
  font: inherit;
}
.lc-inbox-row:active,
.lc-inbox-row:hover {
  background: color-mix(in srgb, var(--mint, #3dffc5) 8%, transparent);
}
.lc-inbox-row.is-active {
  background: color-mix(in srgb, var(--mint, #3dffc5) 10%, transparent);
  box-shadow: inset 3px 0 0 var(--mint, #3dffc5);
}
.lc-inbox-row.is-active .lc-inbox-avatar {
  background: linear-gradient(135deg, var(--mint, #3dffc5), #2ad0ff);
}
.lc-inbox-row.is-closed {
  opacity: 0.72;
  background: color-mix(in srgb, #94a3b8 8%, transparent);
  box-shadow: inset 3px 0 0 #94a3b8;
}
.lc-inbox-row.is-closed .lc-inbox-avatar {
  background: #64748b;
  color: #e2e8f0;
}
.lc-inbox-row.is-closed .lc-inbox-ticket {
  color: #94a3b8;
}
.lc-inbox-row.is-closed .lc-inbox-preview {
  font-style: italic;
}
.lc-inbox-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-weight: 800;
  color: #041018;
  background: linear-gradient(135deg, var(--mint, #3dffc5), #2ad0ff);
}
.lc-inbox-main { min-width: 0; }
.lc-inbox-top {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  align-items: baseline;
}
.lc-inbox-top strong {
  font-size: 0.95rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.lc-inbox-time {
  color: var(--muted, #8aa0ad);
  font-size: 0.7rem;
  flex-shrink: 0;
}
.lc-inbox-ticket {
  display: block;
  margin-top: 0.12rem;
  color: var(--mint, #3dffc5);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.02em;
}
.lc-inbox-preview {
  display: block;
  margin-top: 0.12rem;
  color: var(--muted, #8aa0ad);
  font-size: 0.78rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lc-attach {
  width: 2.5rem;
  height: 2.5rem;
  border: 0;
  border-radius: 50%;
  background: color-mix(in srgb, var(--mint, #3dffc5) 14%, transparent);
  color: inherit;
  font-size: 1.05rem;
  cursor: pointer;
  flex-shrink: 0;
}
.lc-attach:disabled { opacity: 0.4; cursor: not-allowed; }

.lc-attach-preview {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0 0 0.4rem;
  padding: 0.35rem 0.5rem;
  border-radius: 12px;
  background: color-mix(in srgb, var(--mint, #3dffc5) 10%, transparent);
  border: 1px solid color-mix(in srgb, var(--mint, #3dffc5) 25%, var(--line));
  font-size: 0.75rem;
}
.lc-attach-preview.hidden { display: none !important; }
.lc-attach-preview img {
  width: 42px;
  height: 42px;
  object-fit: cover;
  border-radius: 8px;
}
.lc-attach-preview button {
  margin-left: auto;
  border: 0;
  background: transparent;
  color: #f87171;
  font-weight: 800;
  cursor: pointer;
}

.lc-bubble img.lc-att {
  display: block;
  max-width: min(220px, 68vw);
  border-radius: 10px;
  margin: 0.2rem 0 0.35rem;
}

.lc-compose textarea {
  flex: 1;
  min-height: 2.6rem;
  max-height: 6.5rem;
  resize: none;
  border-radius: 14px;
  border: 1px solid var(--line, rgba(255, 255, 255, 0.12));
  background: color-mix(in srgb, var(--bg, #0b1520) 40%, transparent);
  color: inherit;
  padding: 0.65rem 0.75rem;
  font: inherit;
  font-size: 0.9rem;
}

html[data-theme='light'] .lc-compose textarea {
  background: #f6faf8;
}

.lc-send {
  border: 0;
  border-radius: 14px;
  padding: 0.7rem 0.95rem;
  font-weight: 800;
  font-family: var(--font-display, 'Space Grotesk', system-ui, sans-serif);
  cursor: pointer;
  color: #041018;
  background: linear-gradient(135deg, var(--mint, #3dffc5), #2ad0ff);
  flex-shrink: 0;
}

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

.lc-err {
  color: #f87171;
  font-size: 0.78rem;
  min-height: 1rem;
}

/* Messenger-style minimized bubble — draggable anywhere; cut to end chat */
.lc-launcher {
  position: fixed;
  left: max(0.85rem, env(safe-area-inset-left));
  bottom: max(1rem, calc(env(safe-area-inset-bottom, 0px) + 0.85rem));
  z-index: 11050;
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  padding: 0.2rem 0.2rem 0.2rem 0.2rem;
  border: 0;
  border-radius: 999px;
  color: #041018;
  font-family: var(--font-display, 'Space Grotesk', system-ui, sans-serif);
  font-weight: 800;
  font-size: 0.88rem;
  background: linear-gradient(135deg, var(--mint, #3dffc5), #2ad0ff);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.28);
  transform: translateY(140%);
  opacity: 0;
  pointer-events: none;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.25s ease, box-shadow 0.2s ease;
}

.lc-launcher.hidden {
  display: none !important;
}

.lc-launcher.is-on {
  transform: translateY(0);
  opacity: 1;
  pointer-events: auto;
}

.lc-launcher.is-placed {
  /* left/top set by JS after drag */
}

.lc-launcher.is-dragging {
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.38);
  cursor: grabbing;
  z-index: 12060;
}

.lc-launcher-main {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 0.65rem 0.4rem 0.4rem;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: inherit;
  font: inherit;
  cursor: grab;
  touch-action: none;
}

.lc-launcher.is-dragging .lc-launcher-main {
  cursor: grabbing;
}

.lc-launcher-ico {
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(4, 16, 24, 0.18);
  font-size: 0.95rem;
  flex-shrink: 0;
}

.lc-launcher-cut {
  width: 1.65rem;
  height: 1.65rem;
  margin-right: 0.25rem;
  border: 0;
  border-radius: 50%;
  display: grid;
  place-items: center;
  cursor: pointer;
  flex-shrink: 0;
  font-size: 1.05rem;
  line-height: 1;
  color: #041018;
  background: rgba(4, 16, 24, 0.16);
  font-family: inherit;
  font-weight: 700;
  touch-action: manipulation;
}

.lc-launcher-cut:hover {
  background: rgba(4, 16, 24, 0.28);
}

.lc-launcher-pulse {
  position: absolute;
  inset: -3px;
  border-radius: inherit;
  border: 2px solid color-mix(in srgb, var(--mint, #3dffc5) 70%, #fff);
  animation: lcPulse 1.8s ease-out infinite;
  pointer-events: none;
}

@keyframes lcPulse {
  0% { opacity: 0.7; transform: scale(1); }
  100% { opacity: 0; transform: scale(1.18); }
}

/* Hide site Telegram FAB while live chat sheet/session bubble is active */
body.lc-chat-open .libotp-tg-fab {
  opacity: 0 !important;
  pointer-events: none !important;
  transform: translateY(140%) !important;
}

.lc-lang {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 1.5rem 1.1rem max(1.5rem, env(safe-area-inset-bottom));
  text-align: center;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  touch-action: manipulation;
}

.lc-lang.hidden,
.lc-main.hidden {
  display: none !important;
}

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

.lc-lang-title {
  margin: 0;
  font-family: var(--font-display, 'Space Grotesk', system-ui, sans-serif);
  font-size: 1.12rem;
  font-weight: 700;
}

.lc-lang-sub {
  margin: 0;
  color: var(--muted, #8aa0ad);
  font-size: 0.84rem;
  line-height: 1.35;
}

.lc-lang-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.55rem;
  width: min(300px, 100%);
  margin-top: 0.45rem;
}

.lc-lang-btn {
  border: 1.5px solid color-mix(in srgb, var(--mint, #3dffc5) 40%, var(--line));
  background: color-mix(in srgb, var(--mint, #3dffc5) 14%, transparent);
  color: inherit;
  border-radius: 16px;
  padding: 0.95rem 1rem;
  min-height: 3.1rem;
  font: inherit;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.15s ease, background 0.15s ease;
}

.lc-lang-btn:active {
  transform: scale(0.98);
  background: color-mix(in srgb, var(--mint, #3dffc5) 26%, transparent);
}

.lc-lang-btn:hover {
  transform: translateY(-1px);
  background: color-mix(in srgb, var(--mint, #3dffc5) 20%, transparent);
}

.lc-wallet {
  margin: 0.45rem 0.75rem 0.15rem;
  padding: 0.55rem 0.7rem;
  border-radius: 12px;
  border: 1px solid color-mix(in srgb, var(--mint, #3dffc5) 28%, var(--line));
  background: color-mix(in srgb, var(--mint, #3dffc5) 8%, transparent);
  display: grid;
  gap: 0.28rem;
  flex-shrink: 0;
}

.lc-wallet-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  min-width: 0;
}

.lc-wallet-label {
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted, #8aa0ad);
}

.lc-wallet-row strong {
  font-family: var(--font-mono, 'JetBrains Mono', monospace);
  font-size: 0.78rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 65%;
}

.lc-wallet-bal {
  color: var(--mint, #3dffc5) !important;
  font-weight: 800 !important;
}

@media (max-width: 820px) {
  .lc-sheet {
    align-items: stretch;
    justify-content: flex-end;
    padding: 0;
  }
  .lc-panel {
    width: 100%;
    height: 100%;
    max-height: 100%;
    border-radius: 18px 18px 0 0;
  }
  .lc-compose textarea {
    font-size: 16px; /* prevent iOS zoom on focus (breaks keyboard fit) */
  }
  .lc-foot {
    flex-shrink: 0;
    position: sticky;
    bottom: 0;
    z-index: 3;
    background: inherit;
  }
  .lc-sheet.lc-kb-open .lc-panel,
  .lc-sheet.lc-input-focus .lc-panel {
    border-radius: 12px 12px 0 0;
  }
  /* Free vertical space so the typing box stays on-screen above the keyboard */
  .lc-sheet.lc-kb-open .lc-chips,
  .lc-sheet.lc-kb-open .lc-wallet,
  .lc-sheet.lc-input-focus .lc-chips,
  .lc-sheet.lc-input-focus .lc-wallet,
  .lc-sheet.lc-kb-open .lc-mode-row,
  .lc-sheet.lc-input-focus .lc-mode-row {
    display: none !important;
  }
  .lc-sheet.lc-kb-open .lc-actions,
  .lc-sheet.lc-input-focus .lc-actions {
    display: none !important;
  }
  .lc-sheet.lc-kb-open .lc-foot,
  .lc-sheet.lc-input-focus .lc-foot {
    padding: 0.45rem 0.65rem calc(0.45rem + env(safe-area-inset-bottom, 0px));
  }
  .lc-launcher {
    bottom: max(1.1rem, calc(env(safe-area-inset-bottom, 0px) + 1rem));
  }
}

@media (max-width: 720px) {
  .lc-sheet {
    align-items: stretch;
    justify-content: flex-end;
    padding: 0;
  }
  .lc-panel {
    width: 100%;
    height: 100%;
    max-height: 100%;
    border-radius: 18px 18px 0 0;
  }
}

@media (max-width: 520px) {
  .lc-sheet {
    align-items: stretch;
    padding: 0;
  }
  .lc-panel {
    width: 100%;
    height: 100%;
    max-height: 100%;
    border-radius: 18px 18px 0 0;
  }
}

.lc-mode-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.45rem;
  padding: 0.45rem 0.75rem 0.2rem;
  flex-shrink: 0;
}
.lc-mode-btn {
  border: 1px solid color-mix(in srgb, var(--mint, #3dffc5) 28%, var(--line, #2a3d4a));
  background: transparent;
  color: inherit;
  border-radius: 999px;
  padding: 0.55rem 0.7rem;
  font: inherit;
  font-size: 0.82rem;
  font-weight: 800;
  cursor: pointer;
}
.lc-mode-btn.is-on {
  background: color-mix(in srgb, var(--mint, #3dffc5) 22%, transparent);
  border-color: color-mix(in srgb, var(--mint, #3dffc5) 55%, var(--line));
  color: var(--mint, #3dffc5);
}
.lc-mode-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
.lc-chips,
.lc-actions {
  display: none !important;
}

/* Desktop / laptop: always centered card — never phone keyboard reflow */
@media (min-width: 821px) {
  .lc-sheet {
    align-items: center !important;
    justify-content: center !important;
    padding: 0.75rem !important;
  }
  .lc-panel {
    width: min(520px, 100%) !important;
    height: min(80vh, 720px) !important;
    max-height: 80vh !important;
    border-radius: 20px !important;
    margin: 0 auto;
  }
  .lc-sheet.lc-kb-open .lc-mode-row,
  .lc-sheet.lc-input-focus .lc-mode-row,
  .lc-sheet.lc-kb-open .lc-wallet,
  .lc-sheet.lc-input-focus .lc-wallet {
    display: grid !important;
  }
  .lc-foot {
    position: static !important;
    box-shadow: none !important;
  }
}

/* Agent rating after chat closed */
.lc-rate-card {
  margin: 0.75rem 0.85rem 1rem;
  padding: 0.9rem 1rem;
  border-radius: 16px;
  background: color-mix(in srgb, var(--mint, #3dffc5) 12%, #0f1c22);
  border: 1px solid color-mix(in srgb, var(--mint, #3dffc5) 35%, transparent);
}
.lc-rate-head {
  display: flex;
  gap: 0.65rem;
  align-items: center;
  margin-bottom: 0.65rem;
}
.lc-rate-head img,
.lc-rate-head span {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  background: #1a2a32;
  display: grid;
  place-items: center;
  font-weight: 800;
  flex-shrink: 0;
}
.lc-rate-head strong {
  display: block;
  font-size: 0.95rem;
}
.lc-rate-head em {
  font-style: normal;
  color: var(--muted, #8aa0ad);
  font-size: 0.8rem;
}
.lc-rate-stars {
  display: flex;
  gap: 0.25rem;
  margin-bottom: 0.55rem;
}
.lc-star {
  border: 0;
  background: transparent;
  color: #6b7c86;
  font-size: 1.55rem;
  line-height: 1;
  cursor: pointer;
  padding: 0.1rem;
}
.lc-star.is-on {
  color: #f5b301;
}
.lc-rate-card textarea {
  width: 100%;
  border-radius: 12px;
  border: 1px solid var(--line, #24343c);
  background: #0b141a;
  color: inherit;
  padding: 0.55rem 0.7rem;
  font: inherit;
  resize: vertical;
  min-height: 2.6rem;
}
.lc-rate-actions {
  display: flex;
  gap: 0.5rem;
  justify-content: flex-end;
  margin-top: 0.55rem;
}
.lc-rate-skip,
.lc-rate-submit {
  border: 0;
  border-radius: 999px;
  padding: 0.45rem 0.95rem;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}
.lc-rate-skip {
  background: transparent;
  color: var(--muted, #8aa0ad);
}
.lc-rate-submit {
  background: linear-gradient(135deg, #00a884, #25d366);
  color: #fff;
}
.lc-rate-submit:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.lc-rate-err {
  margin: 0.4rem 0 0;
  color: #ff8a8a;
  font-size: 0.8rem;
}
.lc-rate-done {
  font-size: 1.05rem;
  font-weight: 700;
  color: #f5b301;
  letter-spacing: 0.04em;
}
