.unicon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  vertical-align: middle;
  flex-shrink: 0;
}

/* Chatbase-inspired tokens — aliases into globals.css (single source of truth) */
:root {
  --color-black: #000000;
  --color-white: #ffffff;
  --color-gray-brand: var(--gray-brand, #b2aeb9);
  --color-text-primary: var(--foreground, #0a0a0a);
  --color-text-secondary: var(--text-secondary, #52525b);
  --color-text-muted: var(--muted-foreground, #71717a);
  --color-border-subtle: var(--border, #e7e7ea);
  --color-surface-subtle: var(--surface-subtle, #fafafa);
  --radius-card: 0.75rem;
  --radius-button: var(--radius, 0.625rem);
  --font-sans: YekanBakh, sans-serif;
  --font-weight-light: 300;
  --font-weight-regular: 400;
  --font-weight-medium: 500;
  --font-weight-bold: 700;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 15px;
  font-weight: var(--font-weight-regular);
  color: var(--color-text-primary);
  background: var(--color-surface-subtle);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}



.mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

.small {
  font-size: 14px;
}

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

.page-center {
  min-height: 60vh;
  display: grid;
  place-items: center;
  justify-content: center;
}

.page-loading {
  padding: 48px;
}

.eyebrow {
  margin: 0;
  color: var(--color-text-secondary);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-weight: var(--font-weight-medium);
  font-size: 11px;
}

h1 {
  margin: 8px 0 12px;
  font-size: 32px;
  font-weight: var(--font-weight-bold);
  line-height: 1.25;
}

.dashboard-page-title {
  margin: 0;
  font-size: 32px;
  font-weight: var(--font-weight-bold);
  line-height: 1.25;
  letter-spacing: -0.02em;
}

.dashboard-page-header {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 30px;
}

.dashboard-page-header--default {
  margin-bottom: 20px;
}

.dashboard-page-description {
  margin: 0;
  font-size: 14px;
  line-height: 1.5;
  color: var(--color-text-muted, #64748b);
}

h2 {
  font-size: 20px;
  font-weight: var(--font-weight-bold);
  line-height: 1.35;
}

h3 {
  font-size: 17px;
  font-weight: var(--font-weight-medium);
  line-height: 1.4;
}

.stack {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

.row.wrap {
  margin-top: 8px;
}

.max-w {
  max-width: 720px;
}

.label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 14px;
  font-weight: var(--font-weight-medium);
  color: var(--color-text-secondary);
}

.row-inline {
  flex-direction: row;
  align-items: center;
  gap: 12px;
}

.input,
.textarea {
  font: inherit;
  padding: var(--space-2_5) var(--space-3);
  border-radius: var(--radius-input);
  border: 1px solid var(--color-border-subtle);
  background: var(--card);
  color: var(--color-text-primary);
}

.textarea {
  width: 100%;
  resize: vertical;
  min-height: 160px;
}

/* Legacy button aliases — mirror shadcn Button tokens for leftover markup */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font: inherit;
  font-size: 0.875rem;
  font-weight: var(--font-weight-medium);
  cursor: pointer;
  padding: 0.625rem 1.125rem;
  min-height: 2.5rem;
  border-radius: var(--radius-button);
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--secondary-foreground);
  transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.btn:hover:not(:disabled) {
  background: var(--muted);
  color: var(--foreground);
  border-color: var(--border);
}

.btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--ring) 50%, transparent);
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  pointer-events: none;
}

.btn-primary {
  background: var(--primary);
  color: var(--primary-foreground);
  border-color: var(--primary);
}

.btn-primary:hover:not(:disabled) {
  background: var(--primary-hover);
  border-color: var(--primary-hover);
  color: var(--primary-foreground);
}

.btn-secondary {
  background: var(--card);
  border-color: var(--border);
  color: var(--secondary-foreground);
}

.btn-ghost {
  background: transparent;
  border-color: transparent;
  color: var(--muted-foreground);
}

.btn-ghost:hover:not(:disabled) {
  background: var(--muted);
  color: var(--foreground);
}

.btn-link {
  background: transparent;
  border-color: transparent;
  color: var(--muted-foreground);
  padding: 0;
  height: auto;
  min-height: 0;
  font-size: 13px;
}

.btn-link:hover:not(:disabled) {
  color: var(--foreground);
  text-decoration: underline;
}

.btn-destructive {
  background: var(--card);
  border-color: color-mix(in srgb, var(--destructive) 30%, transparent);
  color: var(--destructive);
}

.btn-destructive:hover:not(:disabled) {
  background: color-mix(in srgb, var(--destructive) 12%, transparent);
  border-color: color-mix(in srgb, var(--destructive) 50%, transparent);
  color: #991b1b;
}

.btn--send {
  border: none;
  color: #fff;
  flex-shrink: 0;
}

.btn-icon {
  padding: 0;
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn-icon-sm {
  width: 30px;
  height: 30px;
}

.btn-icon svg {
  width: 18px;
  height: 18px;
}

.btn-icon-sm svg {
  width: 15px;
  height: 15px;
}

.error-inline {
  color: #b42318;
  font-size: 14px;
}

.success-inline {
  color: #027a48;
  font-size: 14px;
}

.auth-page {
  flex: 1;
  min-height: 0;
  height: 100%;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px;
  gap: 24px;
}

.auth-brand {
  display: flex;
  justify-content: center;
  width: 100%;
}

.auth-brand__link {
  display: inline-flex;
  line-height: 0;
  text-decoration: none;
  color: inherit;
}

.auth-brand__logo {
  display: block;
  width: 125px;
  height: auto;
  max-width: 125px;
}

.auth-card {
  width: 100%;
  max-width: 440px;
  padding: 40px 60px;
  border-radius: var(--radius-card);
  border: 1px solid var(--color-border-subtle);
  background: var(--color-white);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

@media (max-width: 640px) {
  .auth-page {
    padding: 16px;
    gap: 20px;
  }

  .auth-card {
    padding: 24px 20px;
  }

  .auth-card .auth-title {
    font-size: 1.5rem;
  }
}

.auth-card--rtl {
  direction: rtl;
  text-align: right;
}

.auth-card .auth-title {
  margin: 0 0 12px;
  font-size: 30px;
  font-weight: var(--font-weight-bold);
  line-height: 1.25;
}

.auth-lead {
  margin: 0 0 30px;
}

.store-setup-progress-card {
  max-width: 420px;
  padding: 36px 40px;
}

.store-setup-progress {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.store-setup-progress__header {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  text-align: center;
}

.store-setup-progress__logo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: #ecfdf3;
  color: #15803d;
}

.store-setup-progress__title {
  margin: 0;
  font-size: 24px;
  font-weight: var(--font-weight-bold);
  line-height: 1.3;
}

.store-setup-progress__subtitle {
  margin: 0;
}

.store-setup-progress__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.store-setup-progress__item {
  display: flex;
  align-items: center;
  gap: 12px;
}

.store-setup-progress__indicator {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  flex-shrink: 0;
}

.store-setup-progress__indicator--done {
  background: #16a34a;
  color: #fff;
}

.store-setup-progress__indicator--active {
  border: 2px solid #16a34a;
  color: #16a34a;
}

.store-setup-progress__indicator--pending {
  border: 2px solid #d4d4d8;
}

.store-setup-progress__indicator--error {
  border: 2px solid var(--destructive);
  background: #fef2f2;
}

.store-setup-progress__spinner {
  animation: store-setup-spin 0.9s linear infinite;
}

.store-setup-progress__label {
  font-size: 15px;
  line-height: 1.45;
}

.store-setup-progress__item--done .store-setup-progress__label {
  color: var(--color-text-muted);
}

.store-setup-progress__item--active .store-setup-progress__label {
  color: var(--color-text-primary);
  font-weight: var(--font-weight-medium);
}

.store-setup-progress__item--pending .store-setup-progress__label {
  color: var(--color-text-muted);
}

.store-setup-progress__item--error .store-setup-progress__label {
  color: var(--destructive);
}

.store-setup-progress__footer {
  padding-top: 8px;
  border-top: 1px dashed var(--color-border-subtle);
}

@keyframes store-setup-spin {
  to {
    transform: rotate(360deg);
  }
}

.auth-card__footer-links {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  margin-top: 8px;
}

.auth-input--ltr {
  direction: ltr;
  text-align: left;
}

.label--ltr-en {
  direction: ltr;
  text-align: left;
}

.text-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0;
  margin: 0;
  border: none;
  background: none;
  font: inherit;
  font-size: 14px;
  color: var(--color-text-secondary);
  cursor: pointer;
  text-decoration: none;
  width: fit-content;
}

.text-link--center {
  align-self: center;
  margin-inline: auto;
}

.text-link:hover:not(:disabled) {
  color: var(--color-text-primary);
  text-decoration: underline;
}

.text-link:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.text-link__arrow {
  font-size: 15px;
  line-height: 1;
}

.otp-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.otp-inputs {
  display: flex;
  gap: 12px;
  justify-content: center;
}

.otp-input {
  width: 56px;
  height: 56px;
  padding: 0;
  border-radius: 10px;
  border: 1px solid var(--color-border-subtle);
  background: var(--color-white);
  font: inherit;
  font-size: 22px;
  font-weight: var(--font-weight-medium);
  text-align: center;
  color: var(--color-text-primary);
  transition: border-color 0.14s ease, box-shadow 0.14s ease;
}

.otp-input:focus {
  outline: none;
  border-color: var(--ring);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--ring) 35%, transparent);
}

.otp-inputs--error .otp-input {
  border-color: #f04438;
}

.otp-inputs--error .otp-input:focus {
  box-shadow: 0 0 0 3px rgba(240, 68, 56, 0.18);
}

.otp-field__error {
  margin: 0;
  color: #b42318;
  font-size: 13px;
  text-align: center;
}

.onboarding-key-help__toggle {
  margin-bottom: 8px;
}

.auth-toast {
  margin: 0 0 10px;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 14px;
}

.auth-toast--success {
  color: #1f5131;
  background: #e8f5ea;
  border: 1px solid #aacdad;
}

.auth-toast--warn {
  color: #7a4b00;
  background: #fff8e6;
  border: 1px solid #e8d49a;
}

.auth-toast--error {
  color: #7a271a;
  background: #fef3f2;
  border: 1px solid #fecdca;
}

.sync-bg-toast {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 12px;
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 13px;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  color: #1e40af;
}
.sync-bg-toast button {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
  color: inherit;
  padding: 0;
  flex-shrink: 0;
}

.footer-note {
  margin-top: 24px;
  font-size: 13px;
  color: var(--color-text-muted);
}

.onboarding-spinner {
  width: 36px;
  height: 36px;
  border: 3px solid var(--color-border-subtle);
  border-top-color: var(--color-primary, #3b81f6);
  border-radius: 50%;
  animation: onboarding-spin 0.8s linear infinite;
}

.onboarding-spinner--centered {
  margin: 8px auto;
}

/* URL prefix input group (https:// static prefix + domain input) */
.url-input-group {
  display: flex;
  direction: ltr;
  align-items: stretch;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--background);
  transition: box-shadow 0.15s;
}

.url-input-group:focus-within {
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--ring) 40%, transparent);
}

.url-input-prefix {
  display: flex;
  align-items: center;
  padding: 0 10px;
  font-size: 14px;
  color: var(--color-text-muted);
  background: var(--color-surface-subtle);
  border-right: 1px solid var(--border);
  white-space: nowrap;
  user-select: none;
  flex-shrink: 0;
}

.url-input-group .input {
  border: none;
  border-radius: 0;
  flex: 1;
  min-width: 0;
  box-shadow: none !important;
  outline: none !important;
}

.wc-capability-demo {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.wc-capability-demo__title {
  font-weight: var(--font-weight-medium, 500);
}

.wc-capability-demo__list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.wc-capability-demo__item {
  margin: 0;
}

.wc-capability-demo__label {
  display: inline-block;
  font-size: 12px;
  line-height: 1.4;
  color: var(--color-text-secondary, #4b5563);
  background: #f4f4f5;
  border: 1px solid #e4e4e7;
  border-radius: 8px;
  padding: 4px 8px;
}

.wc-capability-demo__stage {
  position: relative;
  min-height: 92px;
  overflow: hidden;
}

.wc-capability-demo__scene {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  opacity: 0;
  transform: translateY(6px);
  animation: wc-capability-scene 9.6s ease-in-out infinite;
  pointer-events: none;
}

.wc-capability-demo__bubble {
  max-width: 92%;
  padding: 8px 10px;
  border-radius: 10px;
  font-size: 12px;
  line-height: 1.5;
}

.wc-capability-demo__bubble--user {
  align-self: flex-end;
  background: var(--color-primary, #2563eb);
  border: 1px solid var(--color-primary, #2563eb);
  color: #fff;
}

.wc-capability-demo__bubble--bot {
  align-self: flex-start;
  background: #f4f4f5;
  border: 1px solid #e5e7eb;
  color: var(--color-text-primary, #111827);
}

@keyframes wc-capability-scene {
  0%,
  4% {
    opacity: 0;
    transform: translateY(6px);
  }
  8%,
  28% {
    opacity: 1;
    transform: translateY(0);
  }
  34%,
  100% {
    opacity: 0;
    transform: translateY(-4px);
  }
}

@media (max-width: 480px) {
  .wc-capability-demo__stage {
    min-height: 108px;
  }

  .wc-capability-demo__bubble {
    max-width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .wc-capability-demo__scene {
    position: static;
    opacity: 1;
    transform: none;
    animation: none;
  }

  .wc-capability-demo__scene + .wc-capability-demo__scene {
    display: none;
  }
}

.onboarding-key-help {
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 12px 14px;
}

.onboarding-key-help ol {
  margin: 6px 0 0;
  padding-right: 18px;
  list-style: decimal;
  list-style-position: outside;
}

.onboarding-key-help li {
  padding-right: 4px;
}

.onboarding-sync-message {
  max-width: 520px;
  margin: 0;
  color: var(--color-text-primary);
  font-size: 20px;
  font-weight: var(--font-weight-medium);
  line-height: 1.8;
}

.onboarding-knowledge-form {
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 14px;
}

@keyframes onboarding-spin {
  to {
    transform: rotate(360deg);
  }
}

/* Sync page — bouncing dots */
@keyframes sync-bounce {
  0%, 80%, 100% { transform: translateY(0); opacity: 0.5; }
  40% { transform: translateY(-8px); opacity: 1; }
}

.sync-dots {
  display: flex;
  gap: 6px;
  justify-content: center;
  margin: 6px 0;
}

.sync-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #3b81f6;
  display: inline-block;
}

.sync-dot:nth-child(1) { animation: sync-bounce 1.2s ease-in-out 0s infinite; }
.sync-dot:nth-child(2) { animation: sync-bounce 1.2s ease-in-out 0.2s infinite; }
.sync-dot:nth-child(3) { animation: sync-bounce 1.2s ease-in-out 0.4s infinite; }

.sync-success-card {
  background: #f0fdf4;
  border: 1.5px solid #bbf7d0;
  border-radius: 12px;
  padding: 16px;
  text-align: center;
}

.sync-success-count {
  margin: 0;
  font-size: 36px;
  font-weight: 800;
  color: #16a34a;
}

.sync-success-label {
  margin: 2px 0 0;
  font-size: 13px;
  color: #15803d;
}

/* Typing indicator dots */
@keyframes chat-typing-dot {
  0%, 60%, 100% {
    opacity: 0.35;
    transform: translateY(0);
  }

  30% {
    opacity: 1;
    transform: translateY(-4px);
  }
}

/* Sync step spinner dot */
.sync-step-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
  display: inline-block;
  animation: chat-typing-dot 0.9s ease-in-out infinite;
}

/* Typing indicator bubble */
.chat-widget__bubble--typing {
  padding: 12px 16px;
  min-width: 52px;
}

.chat-typing-dots {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 14px;
}

.chat-typing-dots__dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #a1a1aa;
  animation: chat-typing-dot 1.2s ease-in-out infinite;
}

.chat-typing-dots__dot:nth-child(1) {
  animation-delay: 0s;
}

.chat-typing-dots__dot:nth-child(2) {
  animation-delay: 0.2s;
}

.chat-typing-dots__dot:nth-child(3) {
  animation-delay: 0.4s;
}

.chat-widget--dark .chat-typing-dots__dot {
  background: #71717a;
}

/* Tool status chip — sit on assistant side (left). Children are RTL, so
   without an LTR layout group the chip lands on the user/right edge. */
.chat-widget__msg-group--tool-status {
  direction: ltr;
  align-items: flex-start;
  align-self: flex-start;
  max-width: 80%;
}

.chat-tool-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  background: #f4f4f5;
  color: #52525b;
  font-size: 12px;
  line-height: 1.4;
  direction: rtl;
}

.chat-tool-status__spinner {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 2px solid #d4d4d8;
  border-top-color: #71717a;
  animation: chat-tool-status-spin 0.7s linear infinite;
  flex-shrink: 0;
}

@keyframes chat-tool-status-spin {
  to {
    transform: rotate(360deg);
  }
}

.chat-widget--dark .chat-tool-status {
  background: #3f3f46;
  color: #a1a1aa;
}

.chat-widget--dark .chat-tool-status__spinner {
  border-color: #52525b;
  border-top-color: #a1a1aa;
}

/* Shaped skeletons while waiting for a widget to paint (after prose idles) */
.chat-widget-skeleton {
  width: 100%;
  padding: 4px 0 8px;
}

.chat-widget-skeleton__shimmer {
  background: linear-gradient(90deg, #f4f4f5 0%, #e4e4e7 50%, #f4f4f5 100%);
  background-size: 200% 100%;
  animation: chat-widget-skeleton-shimmer 1.2s ease-in-out infinite;
  border-radius: 6px;
}

.chat-widget--dark .chat-widget-skeleton__shimmer {
  background: linear-gradient(90deg, #3f3f46 0%, #52525b 50%, #3f3f46 100%);
  background-size: 200% 100%;
}

@keyframes chat-widget-skeleton-shimmer {
  0% {
    background-position: 100% 0;
  }
  100% {
    background-position: -100% 0;
  }
}

/* Products — horizontal cards matching ProductCard */
.chat-widget-skeleton--products {
  display: flex;
  gap: 10px;
  overflow: hidden;
}

.chat-widget-skeleton__product {
  flex: 0 0 calc((100% - 20px) / 2.5);
  border: 1px solid #e4e4e7;
  border-radius: 12px;
  background: #fff;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.chat-widget--dark .chat-widget-skeleton__product {
  border-color: #3f3f46;
  background: #18181b;
}

.chat-widget-skeleton__product-media {
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: 0;
}

.chat-widget-skeleton__product-body {
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 88px;
}

.chat-widget-skeleton__line--title {
  height: 12px;
  width: 88%;
}

.chat-widget-skeleton__line--meta {
  height: 10px;
  width: 52%;
}

.chat-widget-skeleton__line--price {
  height: 14px;
  width: 40%;
  margin-top: 4px;
}

.chat-widget-skeleton__cta {
  height: 32px;
  width: 100%;
  border-radius: 8px;
  margin-top: auto;
}

.chat-widget-skeleton__cta--wide {
  height: 40px;
  border-radius: 10px;
}

/* Order status — mirrors OrderCard; pin to assistant/left (messages children are RTL). */
.chat-widget-skeleton--order {
  display: flex;
  justify-content: flex-start;
  direction: ltr;
}

.chat-widget-skeleton__order-card {
  border: 1px solid #e4e4e7;
  border-radius: 14px;
  padding: 14px 16px;
  background: #fff;
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: min(340px, 100%);
  min-width: 240px;
}

.chat-widget--dark .chat-widget-skeleton__order-card {
  border-color: #3f3f46;
  background: #18181b;
}

.chat-widget-skeleton__order-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.chat-widget-skeleton__badge {
  height: 22px;
  width: 72px;
  border-radius: 999px;
}

.chat-widget-skeleton__badge--chip {
  height: 24px;
  width: 110px;
  margin: 12px 14px 8px;
}

.chat-widget-skeleton__line--id {
  height: 14px;
  width: 96px;
}

.chat-widget-skeleton__divider {
  height: 1px;
  width: 100%;
  background: #e4e4e7;
}

.chat-widget--dark .chat-widget-skeleton__divider {
  background: #3f3f46;
}

.chat-widget-skeleton__line--total {
  height: 20px;
  width: 120px;
}

/* Order list — mirrors OrderListBlock */
.chat-widget-skeleton--order-list {
  max-width: 100%;
}

.chat-widget-skeleton__order-list-card {
  border: 1px solid #e4e4e7;
  border-radius: 14px;
  background: #fff;
  overflow: hidden;
  padding-bottom: 4px;
}

.chat-widget--dark .chat-widget-skeleton__order-list-card {
  border-color: #3f3f46;
  background: #18181b;
}

.chat-widget-skeleton__line--list-title {
  height: 14px;
  width: 120px;
  margin: 14px 14px 10px;
}

.chat-widget-skeleton__order-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 14px;
  border-top: 1px solid #f4f4f5;
}

.chat-widget--dark .chat-widget-skeleton__order-row {
  border-top-color: #27272a;
}

.chat-widget-skeleton__order-row-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.chat-widget-skeleton__order-row-top {
  display: flex;
  align-items: center;
  gap: 8px;
}

.chat-widget-skeleton__line--row-id {
  height: 12px;
  width: 64px;
}

.chat-widget-skeleton__line--row-meta {
  height: 10px;
  width: 140px;
}

.chat-widget-skeleton__row-btn {
  height: 28px;
  width: 56px;
  border-radius: 8px;
  flex-shrink: 0;
}

/* Cart — mirrors CartBlock */
.chat-widget-skeleton--cart {
  max-width: 100%;
}

.chat-widget-skeleton__cart-card {
  border: 1px solid #e4e4e7;
  border-radius: 14px;
  background: #fff;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.chat-widget--dark .chat-widget-skeleton__cart-card {
  border-color: #3f3f46;
  background: #18181b;
}

.chat-widget-skeleton__cart-row {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) 48px;
  gap: 10px;
  align-items: start;
  padding: 4px 14px 10px;
}

.chat-widget-skeleton__thumb {
  width: 44px;
  height: 44px;
  border-radius: 8px;
}

.chat-widget-skeleton__cart-details {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
  padding-top: 2px;
}

.chat-widget-skeleton__cart-footer {
  border-top: 1px solid #f4f4f5;
  padding: 12px 14px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.chat-widget--dark .chat-widget-skeleton__cart-footer {
  border-top-color: #3f3f46;
}

.onboarding-header {
  margin-bottom: 28px;
}

.appearance-layout {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) minmax(320px, 1fr);
  gap: 32px;
  max-width: 1100px;
  margin: 0 auto;
  padding: 40px 24px 80px;
  align-items: start;
}

@media (max-width: 900px) {
  .appearance-layout {
    grid-template-columns: 1fr;
  }
}

.appearance-panel {
  padding-right: 8px;
}

.appearance-preview {
  position: sticky;
  top: 24px;
}

.preview-stage {
  background: radial-gradient(circle at 1px 1px, rgba(0, 0, 0, 0.06) 1px, transparent 0);
  background-size: 20px 20px;
  border-radius: 16px;
  border: 1px solid var(--color-border-subtle);
  padding: 24px;
  min-height: 420px;
  display: flex;  
  align-items: flex-start;
  justify-content: center;
}

/* Chat widget */
.chat-widget {
  width: 100%;
  max-width: 25rem;
  max-height: 801px;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid var(--color-border-subtle);
  background: var(--color-white);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.08);
  display: flex;
  flex-direction: column;
  font-family: Vazirmatn, sans-serif;
}

.chat-widget--embed {
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  border: none;
  border-radius: 0;
  box-shadow: none;
  margin: 0;
}

.chat-widget--embed.chat-widget--dark {
  border: none;
}

.chat-widget__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  font-weight: var(--font-weight-medium);
  font-size: 15px;
}

.chat-widget__header-main {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.chat-widget__avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  border: 2px solid rgba(255, 255, 255, 0.35);
}

.chat-widget__title {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-widget--dark {
  /* Widget-scoped tokens so alias vars stop leaking light theme */
  --color-text-primary: #fafafa;
  --color-text-secondary: #a1a1aa;
  --color-text-muted: #71717a;
  --color-border-subtle: #3f3f46;
  --color-white: #18181b;
  --color-surface-subtle: #18181b;
  --invert: #27272a;
  --invert-foreground: #fafafa;
  --card: #18181b;
  --foreground: #fafafa;
  --background: #18181b;
  --shadow-sm: 0 1px 4px rgba(0, 0, 0, 0.28);
  --shadow-lg: 0 12px 40px rgba(0, 0, 0, 0.45);
  color: #fafafa;
  background: #18181b;
}

.chat-widget:not(.chat-widget--embed).chat-widget--dark {
  border-color: #3f3f46;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
}

.chat-widget--dark .chat-widget__body {
  background: #18181b;
}

.chat-widget--dark .chat-widget__bubble--assistant {
  background: #3f3f46;
  color: #fafafa;
}

.chat-widget--dark .chat-widget__agent-label {
  color: #a1a1aa;
}

.chat-widget--dark .chat-widget__composer {
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.28);
  border-color: rgba(255, 255, 255, 0.14);
  background: rgba(39, 39, 42, 0.88);
}

.chat-widget--dark .chat-widget__composer-input {
  color: #fafafa;
}

.chat-widget--dark .chat-widget__composer-input::placeholder {
  color: #71717a;
}

.chat-widget--dark .chat-widget__powered {
  color: #a1a1aa;
  background: transparent;
  border: none;
  box-shadow: none;
}

.chat-widget--dark .chat-widget__powered:hover {
  color: #e4e4e7;
}

.chat-widget--dark .chat-widget__powered-legal {
  color: #a1a1aa;
}

.chat-widget--dark .chat-widget__powered-legal a:hover {
  color: #e4e4e7;
}

.chat-widget--dark .chat-widget__suggestion-chip {
  background: #27272a;
  color: #e4e4e7;
  border-color: #3f3f46;
  font-size: 15px;
}

.chat-widget--dark .chat-widget__suggestion-chip:hover:not(:disabled) {
  background: #3f3f46;
  border-color: #52525b;
}

.chat-widget--dark .chat-block--error {
  background: #450a0a;
  border-color: #7f1d1d;
  color: #fecaca;
}

.chat-widget--dark .chat-product-card {
  background: #27272a;
  border-color: #3f3f46;
  color: #fafafa;
}

.chat-widget--dark .chat-product-card--link:hover {
  border-color: #71717a;
}

.chat-widget--dark .chat-product-card__media {
  background: #3f3f46;
}

.chat-widget--dark .chat-product-card__name {
  color: #fafafa;
}

.chat-widget--dark .chat-product-card__price {
  color: #f4f4f5;
}

.chat-widget--dark .chat-product-card__regular-price {
  color: #71717a;
}

.chat-widget--dark .chat-product-card__placeholder {
  background: linear-gradient(145deg, #3f3f46 0%, #27272a 100%);
}

.chat-widget--dark .chat-product-card__stock.no {
  background: rgba(127, 29, 29, 0.35);
  color: #fca5a5;
}

.chat-widget--dark .chat-product-card__stock.low {
  background: rgba(154, 52, 18, 0.35);
  color: #fdba74;
}

.chat-widget--dark .chat-order-card {
  background: #27272a;
  border-color: #3f3f46;
  color: #fafafa;
}

.chat-widget--dark .chat-order-card__id-label {
  color: #a1a1aa;
}

.chat-widget--dark .chat-order-card__id-value,
.chat-widget--dark .chat-order-card__price-value {
  color: #fafafa;
}

.chat-widget--dark .chat-order-card__price-currency {
  color: #a1a1aa;
}

.chat-widget--dark .chat-order-card__divider {
  background: #3f3f46;
}

.chat-widget--dark .chat-order-card__toggle {
  color: #a1a1aa;
}

.chat-widget--dark .chat-order-card__toggle:hover {
  color: #fafafa;
}

.chat-widget--dark .chat-order-card__item-name,
.chat-widget--dark .chat-order-card__item-price {
  color: #fafafa;
}

.chat-widget--dark .chat-order-card__item-meta {
  color: #a1a1aa;
}

.chat-widget--dark .chat-order-card__item-thumb {
  background: #18181b;
}

.chat-widget--dark .chat-order-card__item-placeholder {
  background: linear-gradient(135deg, #3f3f46, #18181b);
}

.chat-widget--dark .chat-order-card--error {
  background: #450a0a;
  border-color: #7f1d1d;
  color: #fecaca;
}

.chat-widget--dark .chat-order-card__badge--pending {
  background: rgba(254, 243, 199, 0.16);
  color: #fcd34d;
}

.chat-widget--dark .chat-order-card__badge--processing {
  background: rgba(219, 234, 254, 0.14);
  color: #93c5fd;
}

.chat-widget--dark .chat-order-card__badge--hold {
  background: rgba(255, 237, 213, 0.14);
  color: #fdba74;
}

.chat-widget--dark .chat-order-card__badge--completed {
  background: rgba(220, 252, 231, 0.12);
  color: #86efac;
}

.chat-widget--dark .chat-order-card__badge--cancelled,
.chat-widget--dark .chat-order-card__badge--default {
  background: #3f3f46;
  color: #d4d4d8;
}

.chat-widget--dark .chat-order-card__badge--refunded {
  background: rgba(237, 233, 254, 0.14);
  color: #c4b5fd;
}

.chat-widget--dark .chat-order-card__badge--failed {
  background: rgba(254, 226, 226, 0.12);
  color: #fca5a5;
}

.chat-widget__menu-wrap {
  position: relative;
}

.chat-widget__header-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.chat-widget__menu-btn,
.chat-widget__close-btn,
.chat-widget__cart-btn {
  border: none;
  background: transparent;
  color: inherit;
  opacity: 0.85;
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
  letter-spacing: 2px;
  padding: 4px 8px;
  border-radius: 6px;
  transition: opacity 0.14s ease, background 0.14s ease, transform 0.14s ease;
  touch-action: manipulation;
}

.chat-widget__cart-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  letter-spacing: 0;
}

.chat-widget__cart-badge {
  position: absolute;
  top: 0;
  inset-inline-end: 0;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 999px;
  background: #b91c1c;
  color: #fff;
  font-size: 10px;
  font-weight: var(--font-weight-bold);
  line-height: 16px;
  text-align: center;
}

.chat-widget__close-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  letter-spacing: 0;
}

.chat-widget__menu-btn:hover:not(:disabled),
.chat-widget__close-btn:hover:not(:disabled) {
  opacity: 1;
  background: rgba(255, 255, 255, 0.15);
}

.chat-widget__menu-btn:active:not(:disabled),
.chat-widget__close-btn:active:not(:disabled) {
  opacity: 1;
  background: rgba(255, 255, 255, 0.22);
  transform: scale(0.92);
}

.chat-widget__menu-btn:disabled,
.chat-widget__close-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.chat-widget__menu-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  min-width: 180px;
  padding: 6px;
  border-radius: 10px;
  background: #fff;
  color: #18181b;
  border: 1px solid #e4e4e7;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  z-index: 20;
}

.chat-widget--dark .chat-widget__menu-dropdown {
  background: #27272a;
  color: #fafafa;
  border-color: #3f3f46;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

.chat-widget__menu-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  border: none;
  background: transparent;
  color: #18181b;
  font: inherit;
  font-size: 13px;
  padding: 8px 10px;
  border-radius: 8px;
  cursor: pointer;
  text-align: right;
}

.chat-widget--dark .chat-widget__menu-item {
  color: #fafafa;
}

.chat-widget__menu-item:hover:not(:disabled) {
  background: rgba(0, 0, 0, 0.06);
}

.chat-widget--dark .chat-widget__menu-item:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.08);
}

.chat-widget__menu-item:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.chat-widget__history {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  padding: 12px 14px;
  overflow: hidden;
}

.chat-widget__history-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  justify-content: space-between;
  direction: ltr;
}

.chat-widget__history-back {
  border: none;
  background: none;
  color: var(--color-primary, #2563eb);
  font-size: 13px;
  cursor: pointer;
  padding: 0;
}

.chat-widget__history-title {
  margin: 0;
  font-size: 15px;
  font-weight: var(--font-weight-medium);
}

.chat-widget__history-empty {
  margin: 16px 0 0;
  text-align: center;
}

.chat-widget__history-list {
  list-style: none;
  margin: 0;
  padding: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.chat-widget__history-item {
  width: 100%;
  border: 1px solid var(--color-border-subtle);
  border-radius: 10px;
  background: #fff;
  padding: 10px 12px;
  text-align: right;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.chat-widget__history-item:hover {
  border-color: var(--color-primary, #2563eb);
  background: #f8fafc;
}

.chat-widget--dark .chat-widget__history-item {
  background: #27272a;
  border-color: rgba(255, 255, 255, 0.12);
}

.chat-widget--dark .chat-widget__history-item:hover {
  background: #3f3f46;
}

.chat-widget__history-preview {
  font-size: 13px;
  line-height: 1.5;
  color: inherit;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-widget__history-time {
  font-size: 11px;
}

.chat-widget__menu {
  opacity: 0.5;
  letter-spacing: 2px;
}

.chat-widget__body {
  position: relative;
  display: flex;
  flex-direction: column;
  background: #ffffff;
  min-height: 0;
  flex: 1;
  overflow: hidden;
}

.chat-widget__body::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 96px;
  background: linear-gradient(to top, rgba(255, 255, 255, 0.92) 35%, transparent);
  pointer-events: none;
  z-index: 1;
}

.chat-widget--dark .chat-widget__body::after {
  background: linear-gradient(to top, rgba(24, 24, 27, 0.92) 35%, transparent);
}

.chat-widget--embed .chat-widget__body {
  min-height: 0;
}

.chat-widget__messages {
  flex: 1;
  padding: 14px 10px 120px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow-y: auto;
  min-height: 0;
  direction: ltr;
  scrollbar-width: thin;
  scrollbar-color: rgba(0, 0, 0, 0.22) transparent;
}

.chat-widget__messages > * {
  direction: rtl;
}

.chat-widget__messages::-webkit-scrollbar {
  width: 6px;
}

.chat-widget__messages::-webkit-scrollbar-track {
  background: transparent;
}

.chat-widget__messages::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.22);
  border-radius: 999px;
}

.chat-widget--dark .chat-widget__messages {
  scrollbar-color: rgba(255, 255, 255, 0.22) transparent;
}

.chat-widget--dark .chat-widget__messages::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.22);
}

.chat-widget__msg-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.chat-widget__msg-group--user {
  align-items: flex-end;
  align-self: flex-end;
  max-width: 80%;
}

.chat-widget__msg-group--assistant {
  align-items: flex-start;
  align-self: flex-start;
  max-width: 80%;
}

/* Full-bleed visual rows (product carousel, orders, cart) — not capped like text bubbles. */
.chat-widget__msg-group--assistant.chat-widget__msg-group--full,
.chat-widget__msg-group--assistant:has(> .chat-widget__blocks--standalone),
.chat-widget__msg-group--assistant:has(> .chat-widget__blocks:not(.chat-widget__blocks--standalone)),
.chat-widget__msg-group--assistant:has(.chat-products-scroll) {
  align-self: stretch;
  max-width: 100%;
  width: 100%;
}

.chat-widget--embed .chat-widget__messages {
  max-height: none;
}

.chat-widget__bubble {
  box-sizing: border-box;
  width: fit-content;
  max-width: 100%;
  min-width: 0;
  padding: 10px 14px;
  border-radius: 18px;
  font-size: 14px;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.chat-widget__bubble--assistant {
  align-self: flex-start;
  background: #f4f4f5;
  color: var(--color-text-primary);
}

.chat-widget__blocks--standalone {
  width: 100%;
  /* Own msg-group sibling of the text bubble — messages gap handles spacing. */
  margin-top: 0;
}

.chat-widget__blocks--standalone .chat-block--order {
  align-self: flex-end;
  width: auto;
  max-width: 100%;
}

/* Product carousel — cards size against the chat scrollport (full message width). */
.chat-products-scroll {
  position: relative;
  width: 100%;
}

.chat-products-carousel {
  display: block;
  position: relative;
  width: 100%;
}

.chat-products-carousel__scroll {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: stretch;
  gap: 10px;
  width: 100%;
  min-width: 0;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  overscroll-behavior-x: contain;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  /* Both axes: browser axis-locks so horizontal swipe moves cards, vertical scrolls chat */
  touch-action: pan-x pan-y;
  cursor: grab;
  /* Match RTL widget so swipe/drag starts from the right (natural FA browsing). */
  direction: rtl;
}

.chat-products-carousel__scroll--dragging {
  cursor: grabbing;
  scroll-snap-type: none;
  user-select: none;
}

.chat-products-carousel--static .chat-products-carousel__scroll {
  cursor: default;
}

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

.chat-products-carousel__btn {
  position: absolute;
  top: 50%;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  margin: 0;
  padding: 0;
  border: 1px solid color-mix(in srgb, var(--color-primary, #111827) 18%, rgba(24, 24, 27, 0.08));
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.96);
  color: var(--color-primary, #3f3f46);
  box-shadow: 0 2px 8px rgba(24, 24, 27, 0.12);
  transform: translateY(-50%);
  cursor: pointer;
  transition: opacity 0.15s ease, background-color 0.15s ease, color 0.15s ease;
}

.chat-products-carousel__btn:hover:not(:disabled) {
  background: color-mix(in srgb, var(--color-primary, #111827) 8%, #fff);
  color: var(--color-primary, #18181b);
}

.chat-products-carousel__btn:disabled {
  opacity: 0.35;
  cursor: default;
}

/* RTL: prev (بازگشت به ابتدای لیست) sits on the right; next (بیشتر) on the left — Chatbase overlay style. */
.chat-products-carousel__btn--prev {
  right: 6px;
}

.chat-products-carousel__btn--next {
  left: 6px;
}

.chat-widget--dark .chat-products-carousel__btn {
  border-color: color-mix(in srgb, var(--color-primary, #111827) 35%, rgba(255, 255, 255, 0.1));
  background: rgba(39, 39, 42, 0.95);
  color: color-mix(in srgb, var(--color-primary, #111827) 45%, #e4e4e7);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.35);
}

.chat-widget--dark .chat-products-carousel__btn:hover:not(:disabled) {
  background: #3f3f46;
  color: color-mix(in srgb, var(--color-primary, #111827) 35%, #fafafa);
}

/* display:contents → cards are flex children of the scrollport; % = chat width. */
.chat-block--products {
  display: contents;
}

.chat-products-carousel__scroll > .chat-product-card,
.chat-block--products > .chat-product-card {
  box-sizing: border-box;
  flex: 0 0 calc((100% - 10px) / 2.5);
  width: calc((100% - 10px) / 2.5);
  max-width: 10rem;
  min-width: 0;
  scroll-snap-align: start;
  direction: rtl;
}

/* One product: use the full strip. */
.chat-products-carousel--static .chat-product-card:only-child {
  flex: 0 0 100%;
  width: 100%;
}

.chat-widget__bubble--visual > p {
  font-size: 12px;
  color: #71717a;
  margin-bottom: 6px;
}

.chat-widget--dark .chat-widget__bubble--visual > p {
  color: #a1a1aa;
}

.chat-widget__bubble--user {
  align-self: flex-end;
  background: var(--color-primary, #111827);
  color: #fff;
}

.chat-widget__bubble .chat-md {
  min-width: 0;
  max-width: 100%;
}

.chat-widget__messages-end-spacer {
  flex-shrink: 0;
  height: 0;
  max-height: 6rem;
}

.chat-widget__bubble p {
  margin: 0;
  white-space: pre-line;
}

/* Word split target for GSAP stream enter (React Bits / Motion recipe). */
.chat-widget .chat-md-word {
  display: inline-block;
  will-change: transform, opacity;
}

@media (prefers-reduced-motion: reduce) {
  .chat-widget .chat-md-word {
    will-change: auto;
  }
}

.chat-widget__blocks {
  margin-top: 8px;
}

.chat-block {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.chat-product-card {
  border: 1px solid #e4e4e7;
  border-radius: 12px;
  background: #fff;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
  transition: border-color 0.15s ease;
}

.chat-product-card--link {
  cursor: pointer;
}

.chat-product-card--link:hover {
  border-color: #a1a1aa;
}

.chat-product-card__media {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  background: #f4f4f5;
  overflow: hidden;
  flex-shrink: 0;
  -webkit-user-drag: none;
  user-select: none;
}

.chat-product-card__image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  pointer-events: none;
  -webkit-user-drag: none;
  user-select: none;
}

.chat-product-card__placeholder {
  width: 100%;
  height: 100%;
  background: linear-gradient(145deg, #f0f0f2 0%, #e4e4e7 100%);
}

.chat-product-card__body {
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
  min-height: 88px;
}

.chat-product-card__name {
  font-size: 12px;
  font-weight: var(--font-weight-medium);
  line-height: 1.4;
  color: #18181b;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.chat-product-card__footer {
  display: flex;
  align-items: flex-end;
  justify-content: left;
  gap: 6px;
  margin-top: auto;
}

.chat-product-card__pricing {
  display: flex;
  flex-direction: column;
  flex-wrap: wrap;
  align-items: baseline;
  direction: ltr;
  text-align: left;
}

.chat-product-card__stock {
  font-size: 10px;
  border-radius: 999px;
  padding: 2px 7px;
  flex-shrink: 0;
  margin-inline-start: auto;
}

.chat-product-card__price {
  font-size: 14px;
  font-weight: var(--font-weight-bold);
  color: #09090b;
  letter-spacing: -0.01em;
}

.chat-product-card__regular-price {
  font-size: 11px;
  color: #a1a1aa;
  text-decoration: line-through;
  letter-spacing: -0.01em;
}

.chat-product-card__stock.no {
  background: #fef2f2;
  color: #b91c1c;
}

.chat-product-card__stock.low {
  background: #fff7ed;
  color: #c2410c;
}

.chat-product-card__discount {
  position: absolute;
  top: 8px;
  inset-inline-start: 8px;
  z-index: 1;
  padding: 2px 7px;
  border-radius: 999px;
  background: #b91c1c;
  color: #fff;
  font-size: 11px;
  font-weight: var(--font-weight-bold);
  line-height: 1.3;
  letter-spacing: -0.01em;
}

.chat-order-card {
  border: 1px solid #e4e4e7;
  border-radius: 14px;
  padding: 14px 16px;
  background: #fff;
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: min(340px, 100%);
  min-width: 240px;
  max-width: 100%;
}

.chat-block--order {
  width: auto;
  max-width: 100%;
  direction: ltr;
}

.chat-order-card--error {
  color: #991b1b;
  background: #fef2f2;
  border-color: #fecaca;
  font-size: 13px;
  line-height: 1.5;
  text-align: center;
  padding: 14px 16px;
  min-width: 0;
  width: min(340px, 100%);
  max-width: 100%;
}

.chat-order-card__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.chat-order-card__header--badge-only {
  justify-content: flex-end;
}

.chat-order-card__id {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  min-width: 0;
}

.chat-order-card__id-label {
  font-size: 12px;
  color: #71717a;
  flex-shrink: 0;
}

.chat-order-card__id-value {
  font-size: 14px;
  font-weight: var(--font-weight-medium);
  color: #18181b;
  letter-spacing: -0.01em;
}

.chat-order-card__badge {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: var(--font-weight-medium);
  line-height: 1.3;
  white-space: nowrap;
}

.chat-order-card__badge--pending {
  background: #fef3c7;
  color: #92400e;
}

.chat-order-card__badge--processing {
  background: #dbeafe;
  color: #1d4ed8;
}

.chat-order-card__badge--hold {
  background: #ffedd5;
  color: #c2410c;
}

.chat-order-card__badge--completed {
  background: #dcfce7;
  color: #15803d;
}

.chat-order-card__badge--cancelled {
  background: #f4f4f5;
  color: #52525b;
}

.chat-order-card__badge--refunded {
  background: #ede9fe;
  color: #6d28d9;
}

.chat-order-card__badge--failed {
  background: #fee2e2;
  color: #b91c1c;
}

.chat-order-card__badge--default {
  background: #f4f4f5;
  color: #52525b;
}

.chat-order-card__divider {
  height: 1px;
  width: 100%;
  background: #e4e4e7;
  flex-shrink: 0;
}

.chat-order-card__price {
  display: flex;
  align-items: baseline;
  justify-content: flex-start;
  gap: 6px;
  direction: ltr;
  width: 100%;
}

.chat-order-card__price-currency {
  font-size: 12px;
  font-weight: 400;
  color: #71717a;
  line-height: 1.2;
}

.chat-order-card__price-value {
  font-size: 20px;
  font-weight: var(--font-weight-medium);
  color: #18181b;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.chat-order-card__toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  width: 100%;
  border: none;
  border-radius: 6px;
  background: transparent;
  padding: 2px 0;
  font-size: 12px;
  font-weight: var(--font-weight-medium);
  color: #52525b;
  cursor: pointer;
  direction: rtl;
  transition: color 150ms ease;
}

.chat-order-card__toggle:hover {
  color: #18181b;
}

.chat-order-card__toggle:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--color-primary, #111827) 60%, transparent);
  outline-offset: 1px;
}

.chat-order-card__toggle-chevron {
  flex-shrink: 0;
  transition: transform 200ms ease;
}

.chat-order-card__toggle[aria-expanded="true"] .chat-order-card__toggle-chevron {
  transform: rotate(180deg);
}

.chat-order-card__items {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 240ms ease;
}

.chat-order-card__items--open {
  grid-template-rows: 1fr;
}

.chat-order-card__items-clip {
  min-height: 0;
  overflow: hidden;
}

.chat-order-card__items-scroll {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 224px;
  overflow-y: auto;
  padding-top: 12px;
  direction: rtl;
}

.chat-order-card__item {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: start;
}

.chat-order-card__item-thumb {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  overflow: hidden;
  background: #f4f4f5;
  flex-shrink: 0;
}

.chat-order-card__item-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.chat-order-card__item-placeholder {
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #f4f4f5, #e4e4e7);
}

.chat-order-card__item-details {
  min-width: 0;
}

.chat-order-card__item-name {
  font-size: 13px;
  font-weight: var(--font-weight-medium);
  color: #18181b;
  line-height: 1.35;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.chat-order-card__item-meta {
  margin-top: 2px;
  font-size: 11px;
  color: #71717a;
  line-height: 1.35;
}

.chat-order-card__item-price {
  font-size: 12px;
  font-weight: var(--font-weight-medium);
  color: #18181b;
  white-space: nowrap;
  padding-top: 2px;
}

.chat-widget__agent-label {
  font-size: 11px;
  font-weight: var(--font-weight-medium);
  color: var(--color-text-secondary);
  margin-bottom: 4px;
}

.chat-widget__footer {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 2;
  padding: 0 12px 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  pointer-events: none;
}

.chat-widget__footer > * {
  pointer-events: auto;
}

.chat-widget__powered {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 0;
  border-radius: 0;
  font-size: 11px;
  line-height: 1.3;
  color: #71717a;
  text-decoration: none;
  background: transparent;
  border: none;
  box-shadow: none;
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.28s ease, transform 0.28s ease, color 0.14s ease;
}

.chat-widget__powered-row {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.28s ease, transform 0.28s ease;
}

.chat-widget__powered-row.chat-widget__powered--hidden {
  opacity: 0;
  transform: translateY(6px);
  pointer-events: none;
}

.chat-widget__powered-legal {
  font-size: 10px;
  color: #a1a1aa;
}

.chat-widget__powered-legal a {
  color: inherit;
  text-decoration: none;
}

.chat-widget__powered-legal a:hover {
  color: #52525b;
  text-decoration: underline;
}

.chat-widget__powered--hidden {
  opacity: 0;
  transform: translateY(6px);
  pointer-events: none;
}

.chat-widget__powered:hover {
  color: #3f3f46;
}

.chat-widget__powered-logo {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.chat-widget__composer-wrap {
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 100%;
}

.chat-widget__composer-count {
  align-self: flex-start;
  font-size: 11px;
  line-height: 1.2;
  color: var(--color-text-muted, #71717a);
  padding-inline: 4px;
}

.chat-widget__composer-count--limit {
  color: #b42318;
  font-weight: 600;
}

.chat-widget--dark .chat-widget__composer-count {
  color: #a1a1aa;
}

.chat-widget--dark .chat-widget__composer-count--limit {
  color: #f97066;
}

.chat-widget__composer {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  width: 100%;
  min-height: 45px;
  padding: 7px 18px 7px 8px;
  border-radius: 22px;
  border: 1px solid #e4e4e7;
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.05);
  box-sizing: border-box;
}

.chat-widget__composer-input {
  flex: 1;
  min-width: 0;
  border: none;
  background: transparent;
  padding: 4px 0;
  margin: 0;
  font: inherit;
  font-size: 14px;
  line-height: 1.4;
  /* Safety net if an inline height:0px slips through before layout. */
  min-height: calc(1.4em + 8px);
  color: var(--color-text-primary);
  outline: none;
  direction: rtl;
  text-align: right;
  resize: none;
  max-height: 120px;
  overflow-y: auto;
  field-sizing: content;
}

.chat-widget__composer-input::placeholder {
  color: var(--color-text-muted);
}

.chat-widget__composer-send {
  width: 30px;
  height: 30px;
  border: none;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--color-primary, #111827);
  color: #fff;
  cursor: pointer;
  flex-shrink: 0;
  align-self: flex-end;
  transition: opacity 0.14s ease, transform 0.14s ease;
  touch-action: manipulation;
}

.chat-widget__composer-send:hover:not(:disabled) {
  opacity: 0.92;
  transform: scale(1.03);
}

.chat-widget__composer-send:active:not(:disabled) {
  opacity: 0.88;
  transform: scale(0.94);
}

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

/* Dashboard shell */
.dash-shell {
  display: grid;
  grid-template-columns: 220px 1fr;
  grid-template-rows: auto 1fr;
  flex: 1;
  width: 100%;
  min-height: 0;
  height: 100%;
  max-height: 100%;
  overflow: hidden;
}

.dash-shell--rtl {
  direction: rtl;
  grid-template-columns: 260px 1fr;
}

.dash-shell__sidebar {
  grid-row: 2;
}

.dash-shell__main {
  grid-row: 2;
}

.dash-shell__sidebar {
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--color-border-subtle);
  background: var(--color-surface-subtle);
  padding: 14px 10px;
}

.dash-shell--rtl .dash-shell__sidebar {
  border-right: none;
  border-left: 1px solid var(--color-border-subtle);
}

.dash-shell__brand {
  font-weight: var(--font-weight-bold);
  font-size: 18px;
  margin-bottom: 28px;
}

.dash-shell__nav {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.dash-shell__nav a {
  text-decoration: none;
  display: block;
  min-height: 40px;
  padding: 8px 10px;
  border-radius: 10px;
  color: var(--muted-foreground);
  font-size: 14px;
  font-weight: var(--font-weight-regular);
  transition:
    background-color 0.15s ease,
    color 0.15s ease,
    box-shadow 0.15s ease;
}

.dash-shell__nav a:focus-visible,
.dash-nav-group__toggle:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px var(--background), 0 0 0 4px var(--ring);
}

.dash-shell--rtl .dash-shell__nav a,
.dash-shell--rtl .dash-shell__muted,
.dash-shell--rtl .dash-logout {
  text-align: right;
}

.dash-nav-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-height: 24px;
}

.dash-nav-icon {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--muted-foreground);
  background: transparent;
  flex-shrink: 0;
  transition: color 0.15s ease;
}

.dash-shell__nav a:hover {
  background: var(--accent);
  color: var(--foreground);
}

.dash-shell__nav a:hover .dash-nav-icon {
  color: var(--foreground);
}

.dash-shell__nav a.active {
  background: var(--secondary);
  color: var(--foreground);
  font-weight: var(--font-weight-medium);
}

.dash-shell__nav a.active .dash-nav-icon {
  color: var(--foreground);
}

.dash-nav-group {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.dash-nav-group__toggle {
  width: 100%;
  border: none;
  background: transparent;
  min-height: 40px;
  padding: 8px 10px;
  border-radius: 10px;
  color: var(--muted-foreground);
  font-size: 14px;
  font-weight: var(--font-weight-regular);
  cursor: pointer;
  text-align: right;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.dash-nav-group__toggle:hover {
  background: var(--accent);
  color: var(--foreground);
}

.dash-nav-group__toggle:hover .dash-nav-icon {
  color: var(--foreground);
}

.dash-nav-group__toggle.active {
  background: var(--secondary);
  color: var(--foreground);
  font-weight: var(--font-weight-medium);
}

.dash-nav-group__toggle.active .dash-nav-icon {
  color: var(--foreground);
}

.dash-nav-group__toggle .dash-nav-item {
  justify-content: flex-start;
}

.dash-nav-chevron {
  margin-inline-start: auto;
  color: var(--muted-foreground);
  opacity: 0.75;
  transition: transform 0.2s ease, color 0.15s ease;
}

.dash-nav-group__toggle:hover .dash-nav-chevron,
.dash-nav-group__toggle.active .dash-nav-chevron {
  color: var(--foreground);
  opacity: 1;
}

.dash-nav-chevron--open {
  transform: rotate(180deg);
}

.dash-nav-sub {
  display: flex;
  flex-direction: column;
  gap: 2px;
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  padding-inline-start: 14px;
  margin-bottom: 0;
  transform: translateY(-4px);
  transition:
    max-height 0.22s ease,
    opacity 0.18s ease,
    transform 0.22s ease,
    margin-bottom 0.22s ease;
}

.dash-nav-sub--open {
  max-height: 280px;
  opacity: 1;
  margin-bottom: 4px;
  transform: translateY(0);
}

.dash-nav-item--sub {
  font-size: 13px;
}

.dash-shell__nav a .dash-nav-item--sub {
  font-weight: var(--font-weight-regular);
}

.dash-shell__nav a.active .dash-nav-item--sub {
  font-weight: var(--font-weight-medium);
}

.dash-shell__nav .dash-nav-sub a {
  min-height: 36px;
  padding: 6px 10px;
  color: var(--muted-foreground);
}

.dash-shell__nav .dash-nav-sub a.active {
  background: color-mix(in srgb, var(--secondary) 70%, transparent);
  font-weight: var(--font-weight-medium);
}

.dash-shell__muted {
  font-size: 12px !important;
  opacity: 0.75;
}

.dash-logout {
  margin-top: auto;
  padding: 5px 6px;
  margin-left: 0;
  font: inherit;
  font-size: 15px;
  background: transparent;
  border: none;
  color: var(--color-text-muted);
  cursor: pointer;
  text-align: left;
}

.dash-shell__main {
  padding: 24px 24px 40px;
  background: var(--color-white);
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

@media (min-width: 1024px) {
  .dash-shell__main:not(.dash-shell__main--bleed) {
    padding: 28px 32px 48px;
  }
}

.dash-shell__content {
  width: 100%;
  flex: 1;
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.dash-shell__content > * {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
}

.dash-shell__content--bleed > * {
  overflow: hidden;
}

.dash-topbar {
  grid-column: 1 / -1;
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  box-sizing: border-box;
  height: 56px;
  min-height: 56px;
  padding: 0 20px;
  border: none;
  border-bottom: 1px solid #e5e7eb;
  border-radius: 0;
  background: #ffffff;
  box-shadow: none;
  /* Own RTL so agents hub + dashboard never mirror each other */
  direction: rtl;
}

.dash-topbar.card-surface {
  border-radius: 0;
  box-shadow: none;
  border: none;
  border-bottom: 1px solid #e5e7eb;
}

.dash-topbar__brand {
  display: flex;
  align-items: center;
  min-width: 0;
}

.dash-topbar__start,
.dash-topbar__end,
.dash-topbar__profile {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 8px;
  min-width: 0;
  margin: 0;
  padding: 0;
  align-self: stretch;
  height: auto;
  min-height: 100%;
  box-sizing: border-box;
}

.dash-topbar__end,
.dash-topbar__profile {
  flex-shrink: 0;
  gap: 12px;
  min-width: unset;
}

.dash-topbar__brand-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  height: 32px;
  margin: 0;
  padding: 0;
  line-height: 0;
  text-decoration: none;
  color: inherit;
}

.dash-topbar__mark {
  display: block;
  width: 22px;
  height: 22px;
  object-fit: contain;
}

.dash-topbar__slash {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  height: 32px;
  margin: 0;
  padding: 0;
  font-size: 15px;
  font-weight: 400;
  line-height: 1;
  color: #a1a1aa;
  user-select: none;
}

.dash-topbar__logotype {
  display: block;
  height: 22px;
  width: auto;
  max-width: min(140px, 36vw);
  object-fit: contain;
}

.dash-topbar__phone {
  display: inline-flex;
  align-items: center;
  align-self: center;
  box-sizing: border-box;
  height: 32px;
  margin: 0;
  padding: 0;
  border: 0;
  font-size: 13px;
  font-weight: 400;
  line-height: 1;
  color: #71717a;
  direction: ltr;
  unicode-bidi: plaintext;
  white-space: nowrap;
}

.dash-topbar__divider {
  display: block;
  width: 1px;
  height: 20px;
  background: #e5e7eb;
  flex-shrink: 0;
  align-self: center;
}

.dash-topbar__profile-btn {
  appearance: none;
  border: none;
  background: transparent;
  color: #71717a;
  width: 32px;
  height: 32px;
  min-width: 32px;
  min-height: 32px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  align-self: center;
  cursor: pointer;
  padding: 0;
  margin: 0;
  flex-shrink: 0;
  line-height: 0;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.dash-topbar__profile-btn .unicon {
  display: block;
  flex-shrink: 0;
}

.dash-topbar__profile-btn:hover {
  background: #f4f4f5;
  color: #0a0a0a;
}

.dash-topbar__profile-btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px #ffffff, 0 0 0 4px var(--ring);
}

.dash-topbar__menu {
  min-width: 180px;
  direction: rtl;
  text-align: right;
}

.dash-topbar__logout-item {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 8px;
  justify-content: flex-start;
}

.dash-topbar__menu-phone {
  padding: 8px 10px;
  font-size: 13px;
  color: var(--color-text-primary);
  direction: ltr;
  unicode-bidi: plaintext;
  text-align: left;
}

.dash-topbar__nav-toggle {
  display: none;
  appearance: none;
  border: none;
  background: transparent;
  color: #71717a;
  width: 36px;
  height: 36px;
  min-width: 36px;
  min-height: 36px;
  border-radius: 8px;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  margin: 0;
  flex-shrink: 0;
  line-height: 0;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.dash-topbar__nav-toggle:hover {
  background: #f4f4f5;
  color: #0a0a0a;
}

.dash-topbar__nav-toggle:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px #ffffff, 0 0 0 4px var(--ring);
}

.dash-shell__backdrop {
  display: none;
}

@media (max-width: 1023px) {
  .dash-shell,
  .dash-shell--rtl {
    display: flex;
    flex-direction: column;
    grid-template-columns: none;
    grid-template-rows: none;
  }

  .dash-topbar {
    position: sticky;
    top: 0;
    /* Above drawer + backdrop so hamburger/X stays tappable on iOS */
    z-index: 80;
    padding: 0 12px;
    gap: 10px;
    isolation: isolate;
  }

  .dash-topbar__nav-toggle {
    display: inline-flex;
    position: relative;
    z-index: 1;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
  }

  .dash-topbar__phone {
    display: none;
  }

  .dash-topbar__logotype {
    max-width: min(112px, 30vw);
  }

  .dash-shell__backdrop {
    display: block;
    position: fixed;
    inset: 56px 0 0;
    z-index: 45;
    border: none;
    padding: 0;
    margin: 0;
    background: rgb(15 23 42 / 40%);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
  }

  .dash-shell--nav-open .dash-shell__backdrop {
    opacity: 1;
    pointer-events: auto;
  }

  /*
   * Mobile drawer: dock to inline-start (right in RTL).
   * Keep opacity+visibility — transform alone was flaky on some mobile WebKits.
   * Do NOT mix physical left/right with inset-inline-* here: in RTL,
   * inset-inline-end maps to left and would pin the drawer to the wrong side.
   */
  .dash-shell__sidebar {
    position: fixed;
    top: 56px;
    bottom: 0;
    inset-inline-start: 0;
    inset-inline-end: auto;
    z-index: 50;
    width: min(280px, 86vw);
    max-width: 86vw;
    padding: 12px 10px 16px;
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    background: var(--color-surface-subtle);
    border-left: none;
    border-right: none;
    border-inline-end: 1px solid var(--color-border-subtle);
    box-shadow: -8px 0 24px rgb(15 23 42 / 12%);
    /* LTR fallback: hide off the left edge */
    transform: translate3d(-110%, 0, 0);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition:
      transform 0.22s ease,
      opacity 0.18s ease,
      visibility 0s linear 0.22s;
  }

  .dash-shell--rtl .dash-shell__sidebar {
    border-left: none;
    border-right: none;
    border-inline-end: 1px solid var(--color-border-subtle);
    box-shadow: -8px 0 24px rgb(15 23 42 / 12%);
    /* RTL: inline-start is right — hide further off the right edge */
    transform: translate3d(110%, 0, 0);
  }

  .dash-shell--nav-open .dash-shell__sidebar {
    transform: translate3d(0, 0, 0);
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transition:
      transform 0.22s ease,
      opacity 0.18s ease,
      visibility 0s;
  }

  .dash-shell__main {
    flex: 1;
    min-height: 0;
    width: 100%;
    padding: 16px 14px 28px;
  }

  /* Backdrop already blocks page taps — do not disable main pointer-events
     (can confuse iOS hit-testing with sticky topbar siblings). */

  .dash-shell__main--bleed {
    padding: 0;
  }

  .dash-shell__credits {
    padding-top: 12px;
  }
}

@media (max-width: 1023px) and (prefers-reduced-motion: reduce) {
  .dash-shell__sidebar,
  .dash-shell__backdrop {
    transition: none;
  }
}

.pad-inline {
  padding: 16px;
}

.tiny {
  font-size: 14px;
}

.warn-text {
  color: #b45309;
}

.card-surface {
  border-radius: var(--radius-card);
  border: none;
  background: var(--card);
  box-shadow: 0 0 0 1px var(--border);
}

.select-compact {
  max-width: 220px;
}

.ui-status {
  display: inline-block;
  font-size: 11px;
  font-weight: var(--font-weight-medium);
  padding: 2px 8px;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.ui-status--inline {
  margin-left: 8px;
}

.ui-status--active {
  background: var(--success-muted);
  color: var(--success-muted-foreground);
}

.ui-status--needs_human {
  background: var(--warning-muted);
  color: var(--warning-muted-foreground);
}

.ui-status--resolved {
  background: var(--muted);
  color: var(--text-secondary);
}

.chats-page {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

.dash-shell__main:has(.chats-page) {
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 0;
  padding-bottom: 16px;
}

.dash-shell__content:has(.chats-page) {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.chats-workspace {
  display: grid;
  grid-template-columns: minmax(280px, 400px) minmax(0, 1fr);
  flex: 1;
  min-height: 0;
  height: 100%;
  max-height: 100%;
  overflow: hidden;
  padding: 0;
}

@media (max-width: 960px) {
  .chats-workspace {
    grid-template-columns: 1fr;
    height: 100%;
    max-height: 100%;
    min-height: 0;
  }

  .dash-shell__main:has(.chats-page) {
    overflow: hidden;
    padding-bottom: 0;
  }

  .chats-page:not(.chats-page--has-thread) .chats-thread {
    display: none;
  }

  .chats-page--has-thread .chats-inbox {
    display: none;
  }

  .chats-inbox,
  .chats-thread {
    height: 100%;
    min-height: 0;
    border-left: none;
  }

  .chats-thread__back {
    display: inline-flex;
  }

  .chats-thread__playground-title {
    display: none;
  }

  .chats-thread__header {
    padding: 10px 12px;
    flex-wrap: wrap;
  }

  .chats-thread__header-actions {
    flex-wrap: wrap;
  }
}

.chats-inbox {
  display: flex;
  flex-direction: column;
  min-height: 0;
  height: 100%;
  overflow: hidden;
  border-left: 1px solid var(--color-border-subtle);
  font-family: var(--font-sans);
}

.chats-inbox__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 14px;
  border-bottom: 1px solid var(--color-border-subtle);
  flex-shrink: 0;
}

.chats-inbox__title {
  margin: 0;
  font-size: 18px;
  font-weight: var(--font-weight-bold);
}

.chats-inbox__tools {
  display: flex;
  align-items: center;
  gap: 8px;
}

.chats-inbox__filter {
  min-width: 0;
  max-width: 140px;
  padding: 6px 8px;
  font-size: 13px;
}

.chats-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border: 1px solid var(--color-border-subtle);
  border-radius: 8px;
  background: #fff;
  color: #6b7280;
  cursor: pointer;
}

.chats-icon-btn:hover {
  background: #f3f4f6;
  color: #111827;
}

.chats-inbox__list {
  list-style: none;
  margin: 0;
  padding: 0;
  overflow-y: auto;
  flex: 1;
}

.chats-inbox__row {
  width: 100%;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  text-align: right;
  padding: 12px 14px;
  border: none;
  border-bottom: 1px solid var(--color-border-subtle);
  background: transparent;
  cursor: pointer;
}

.chats-inbox__row:hover {
  background: #fafafa;
}

.chats-inbox__row.active {
  background: #f3f4f6;
  box-shadow: inset -3px 0 0 #111827;
}

.chats-inbox__avatar {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #f3f4f6;
  color: #6b7280;
  margin-top: 2px;
}

.chats-inbox__row-main {
  flex: 1;
  min-width: 0;
}

.chats-inbox__row-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.chats-inbox__row-user {
  margin: 4px 0 0;
  font-size: 12px;
  color: #9ca3af;
  line-height: 1.35;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
}

.chats-icon-btn--active {
  background: #111827;
  color: #fff;
  border-color: #111827;
}

.chats-workspace {
  position: relative;
}

.chats-page--improve .chats-workspace {
  grid-template-columns: minmax(300px, 380px) minmax(0, 1fr) minmax(300px, 360px);
}

.chats-thread__details {
  padding: 20px 18px;
  overflow-y: auto;
  flex: 1;
}

.chats-details {
  margin: 0;
  display: grid;
  gap: 14px;
}

.chats-details > div {
  display: grid;
  gap: 4px;
}

.chats-details dt {
  font-size: 12px;
  color: #9ca3af;
}

.chats-details dd {
  margin: 0;
  font-size: 14px;
  color: #111827;
}

.chats-msg__agent-name {
  font-size: 12px;
  font-weight: 600;
  color: #6b7280;
  margin-bottom: 2px;
}

.chats-msg-group--name-only {
  margin-bottom: -6px;
}

.chats-msg__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 2px;
}

.chats-msg__confidence {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  background: #374151;
  color: #f9fafb;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.chats-msg__confidence svg {
  flex-shrink: 0;
  opacity: 0.9;
}

.chats-msg__feedback {
  display: none;
}

.chats-msg__revise {
  padding: 5px 12px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  background: #fff;
  font-size: 13px;
  color: #111827;
  cursor: pointer;
}

.chats-msg__revise:hover {
  background: #f9fafb;
}

.chats-msg__revised {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: #059669;
  font-weight: 600;
}

.chats-thread__header--playground {
  flex-wrap: wrap;
  align-items: flex-start;
}

.chats-thread__heading {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
}

.chats-thread__playground-title {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  color: #111827;
}

.chats-icon-spin {
  animation: chats-spin 0.8s linear infinite;
}

@keyframes chats-spin {
  to {
    transform: rotate(360deg);
  }
}

.chats-filter-range-hint {
  margin: 4px 0 0;
  font-size: 12px;
}

.chats-filter-sentiment {
  display: grid;
  gap: 8px;
  font-size: 13px;
}

.chats-filter-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chats-filter-chip {
  padding: 6px 12px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #fff;
  font-size: 13px;
  color: #374151;
  cursor: pointer;
}

.chats-filter-chip.active {
  border-color: #111827;
  background: #111827;
  color: #fff;
}

.improve-answer-panel__submit {
  background: #111827 !important;
  color: #fff !important;
}

.improve-answer-panel {
  display: flex;
  flex-direction: column;
  min-height: 0;
  height: 100%;
  border-right: 1px solid var(--color-border-subtle);
  background: #fff;
}

.improve-answer-panel__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--color-border-subtle);
  flex-shrink: 0;
}

.improve-answer-panel__title {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
}

.improve-answer-panel__body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.improve-answer-panel__field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
  color: #374151;
}

.improve-answer-panel__ro {
  background: #f9fafb;
  color: #4b5563;
  resize: vertical;
}

.improve-answer-panel__footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 12px 16px;
  border-top: 1px solid var(--color-border-subtle);
  flex-shrink: 0;
}

.chats-filter-form {
  display: grid;
  gap: 12px;
}

.chats-filter-form label {
  display: grid;
  gap: 6px;
  font-size: 13px;
}

.chats-filter-dates {
  display: flex;
  align-items: center;
  gap: 8px;
}

.chats-filter-dates .input {
  flex: 1;
  min-width: 0;
}

.chats-filter-footer {
  justify-content: space-between !important;
  align-items: center;
}

.chats-filter-clear {
  border: none;
  background: transparent;
  color: #dc2626;
  font-size: 13px;
  cursor: pointer;
  padding: 0;
}

.leads-page__top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.leads-page__tools {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  padding-top: 4px;
}

@media (max-width: 1100px) {
  .chats-page--improve .chats-workspace {
    grid-template-columns: 1fr;
  }

  .improve-answer-panel {
    border-right: none;
    border-top: 1px solid var(--color-border-subtle);
    max-height: 50vh;
  }
}

.chats-inbox__row-title {
  font-size: 14px;
  font-weight: var(--font-weight-medium);
  color: #111827;
  line-height: 1.4;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  flex: 1;
  min-width: 0;
}

.chats-inbox__row-time {
  font-size: 12px;
  color: #9ca3af;
  white-space: nowrap;
  flex-shrink: 0;
}

.chats-inbox__empty {
  padding: 16px 14px;
  font-size: 14px;
}

.chats-thread {
  display: flex;
  flex-direction: column;
  min-height: 0;
  min-width: 0;
  height: 100%;
  overflow: hidden;
}

.chats-thread__body {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

.chats-thread__body.chat-widget {
  max-width: none;
  max-height: none;
  border: none;
  border-radius: 0;
  box-shadow: none;
  background: transparent;
  font-family: inherit;
}

.chats-thread__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--color-border-subtle);
  flex-shrink: 0;
}

.chats-thread__back {
  display: none;
  align-items: center;
  gap: 4px;
  padding: 4px 2px;
  margin: 0 0 2px;
  border: none;
  background: transparent;
  color: var(--color-text-secondary, #64748b);
  font: inherit;
  font-size: 13px;
  font-weight: var(--font-weight-medium);
  cursor: pointer;
  border-radius: 6px;
}

.chats-thread__back:hover {
  color: var(--color-text-primary, #111827);
  background: #f4f4f5;
}

.chats-thread__back:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--ring);
}

.chats-thread__tabs {
  display: flex;
  gap: 16px;
}

.chats-thread__tab {
  font-size: 15px;
  font-weight: var(--font-weight-medium);
  color: #9ca3af;
  padding-bottom: 4px;
  border: none;
  border-bottom: 2px solid transparent;
  background: transparent;
  cursor: pointer;
}

.chats-thread__tab.active {
  color: #111827;
  border-bottom-color: #111827;
}

.activity-page {
  display: flex;
  flex-direction: column;
  min-height: 0;
  height: 100%;
}

.activity-page__tabs {
  display: flex;
  gap: 16px;
  flex-shrink: 0;
  padding: 14px 18px 0;
  border-bottom: 1px solid var(--color-border-subtle);
}

.activity-page__tabs a {
  font-size: 15px;
  font-weight: var(--font-weight-medium);
  color: var(--color-text-secondary);
  text-decoration: none;
  padding-bottom: 12px;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}

.activity-page__tabs a.active {
  color: #111827;
  border-bottom-color: #111827;
}

.chats-thread__placeholder {
  display: grid;
  place-items: center;
  flex: 1;
  padding: 48px 24px;
  text-align: center;
}

.chats-messages {
  list-style: none;
  margin: 0;
  padding: 20px 18px;
  overflow-y: auto;
  overflow-x: hidden;
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
  -webkit-overflow-scrolling: touch;
}

.chats-msg-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.chats-msg-group--user {
  align-items: flex-end;
}

.chats-msg-group--assistant,
.chats-msg-group--human_agent {
  align-items: flex-start;
}

.chats-msg {
  padding: 10px 14px;
  border-radius: 16px;
  max-width: min(78%, 520px);
  display: flex;
  flex-direction: column;
  gap: 6px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.chats-msg--user {
  margin-right: auto;
  margin-left: 0;
  background: #111827;
  color: #fff;
}

.chats-msg--assistant {
  margin-left: auto;
  margin-right: 0;
  background: #f3f4f6;
  color: #111827;
}

.chats-msg--with-blocks {
  max-width: min(92%, 560px);
}

.chats-msg--visual {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  padding: 4px 0 !important;
}

.chats-msg--visual > p {
  font-size: 12px;
  color: #71717a;
  margin-bottom: 6px;
}

.chats-msg--human_agent {
  margin-left: auto;
  margin-right: 0;
  background: #dbeafe;
  color: #1e3a8a;
}

.chats-msg__blocks {
  width: 100%;
}

.chats-msg__blocks .chat-product-card {
  background: #fff;
}

.chats-msg__blocks .chat-product-card--link:hover,
.playground-preview__frame .chat-product-card--link:hover {
  border-color: #a1a1aa;
  box-shadow: none;
  transform: none;
}

.chats-msg__blocks .chat-product-card__pricing,
.playground-preview__frame .chat-product-card__pricing {
  display: flex;
  flex-direction: column;
  margin-top: -1.25rem;
  flex-wrap: wrap;
  align-items: baseline;
  direction: ltr;
  text-align: left;
}

.chats-msg__blocks .chat-product-card__regular-price,
.playground-preview__frame .chat-product-card__regular-price {
  font-size: 11px;
  color: #a1a1aa;
  text-decoration: line-through;
}

.chats-msg--assistant .chats-msg__blocks .chat-order-card {
  background: #fff;
}

.chats-msg__blocks .chat-block--order {
  align-self: flex-end;
  width: auto;
  max-width: 100%;
}

.chats-msg p {
  margin: 0;
  white-space: pre-wrap;
  font-size: 14px;
  line-height: 1.5;
}

.chats-msg .chat-md {
  width: 100%;
  font-size: 14px;
  line-height: 1.5;
}

.chats-msg__time {
  font-size: 11px;
  opacity: 0.72;
}

.chats-msg__latency {
  font-size: 11px;
  color: #6b7280;
}

.textarea--code {
  font-family: YekanBakh, sans-serif;
  font-size: 12px;
}

  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 16px;
}

  margin-bottom: 24px;
}

  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 16px;
}

  margin: 0 0 4px;
  font-size: 18px;
}

  display: block;
  text-decoration: none;
  color: inherit;
  border: 1px solid var(--color-border-subtle);
  border-radius: 12px;
  padding: 20px;
  background: var(--color-white);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

  border-color: #d1d5db;
  box-shadow: 0 1px 2px rgba(17, 24, 39, 0.06);
}

  width: 40px;
  height: 40px;
  border-radius: 10px;
  border: 1px solid;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 14px;
}

  width: 20px;
  height: 20px;
  display: block;
}

  margin: 0 0 8px;
  font-size: 16px;
  font-weight: var(--font-weight-medium);
  color: var(--foreground, #111827);
  line-height: 1.35;
}

  margin: 0;
  font-size: 14px;
  line-height: 1.5;
  color: #6b7280;
}

  margin: 10px 0 0;
  font-size: 12px;
  color: #9ca3af;
}

.toggle-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  white-space: nowrap;
}

.toggle-switch {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  user-select: none;
}

.toggle-switch--disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.toggle-switch__input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-switch__track {
  position: relative;
  width: 40px;
  height: 22px;
  border-radius: 999px;
  background: var(--border);
  transition: background 0.2s ease;
  flex-shrink: 0;
  direction: ltr;
}

.toggle-switch__thumb {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--card);
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s ease;
}

.toggle-switch__input:checked + .toggle-switch__track {
  background: var(--success);
}

.toggle-switch__input:checked + .toggle-switch__track .toggle-switch__thumb {
  transform: translateX(18px);
}

.toggle-switch__label {
  font-size: 13px;
}

  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

  cursor: default;
}

.chat-block--error {
  padding: 10px 12px;
  border-radius: 8px;
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #991b1b;
  font-size: 13px;
  line-height: 1.5;
}

.chat-block--quota {
  padding: 12px 14px;
  border-radius: 12px;
  background: #fffbeb;
  border: 1px solid #fde68a;
  color: #92400e;
  font-size: 13px;
  line-height: 1.55;
  max-width: 88%;
  margin-inline-end: auto;
}

.chat-block--quota__title {
  margin: 0 0 4px;
  font-weight: var(--font-weight-semibold);
  font-size: 14px;
}

.chat-block--quota__detail {
  margin: 0;
}

.chat-block--quota__cta {
  display: inline-block;
  margin-top: 10px;
  padding: 6px 12px;
  border-radius: 8px;
  background: #f59e0b;
  color: #fff;
  font-size: 12px;
  font-weight: var(--font-weight-semibold);
  text-decoration: none;
}

.chat-block--quota__cta:hover {
  background: #d97706;
}

.chat-widget--dark .chat-block--quota {
  background: rgba(120, 53, 15, 0.35);
  border-color: rgba(245, 158, 11, 0.45);
  color: #fde68a;
}

.chat-widget--dark .chat-block--quota__cta {
  background: #d97706;
  color: #fff;
}

.collect-lead-fields {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 12px;
}

  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 12px;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid var(--color-border-subtle);
}

  font-size: 13px;
  font-weight: var(--font-weight-medium);
}

.lead-form {
  padding: 12px 14px;
  border-top: 1px solid var(--color-border-subtle);
  background: var(--color-white);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.lead-form__title {
  margin: 0;
  font-size: 14px;
  font-weight: var(--font-weight-medium);
}

.lead-form__submit {
  align-self: flex-start;
  border: none;
  color: #fff;
}

.table-wrap {
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.data-table th,
.data-table td {
  padding: 10px 12px;
  text-align: left;
  border-bottom: 1px solid var(--color-border-subtle);
}

.data-table th {
  font-size: 12px;
  color: var(--color-text-secondary);
  font-weight: var(--font-weight-medium);
}

.leads-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-bottom: 12px;
}

.deploy-header {
  /* legacy alias — use DashboardPageHeader */
}

.deploy-grid {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 20px;
  align-items: start;
}

@media (max-width: 900px) {
  .deploy-grid {
    grid-template-columns: 1fr;
  }
}

.deploy-card {
  border-radius: var(--radius-card);
  border: 1px solid var(--color-border-subtle);
  background: var(--color-white);
  padding: 20px;
}

.deploy-card--featured {
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.deploy-card--muted {
  opacity: 0.85;
}

.deploy-card__head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.embed-snippet {
  width: 100%;
  font-family: YekanBakh, sans-serif;
  font-size: 12px;
  margin: 12px 0;
  padding: 10px;
  border-radius: 8px;
  border: 1px solid var(--color-border-subtle);
}

.toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
}

.embed-full {
  width: 100%;
  min-height: 100vh;
  margin: 0;
  border: none;
  background: transparent;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

body.embed-route {
  background: transparent;
  overflow: hidden;
}

body.embed-route .chat-widget--embed {
  border-radius: 14px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.18);
}

body.embed-route .chat-widget--embed.chat-widget--dark {
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
}

.embed-full--error {
  text-align: center;
  gap: 12px;
  place-content: center;
  padding: 16px;
}

.embed-full--config-pending {
  position: relative;
}

.embed-config-pending {
  position: absolute;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  color: #374151;
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid #e5e7eb;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  pointer-events: none;
  white-space: nowrap;
}

body.standalone-chat-route {
  min-height: 100vh;
  background:
    radial-gradient(circle at top right, rgba(37, 99, 235, 0.08), transparent 32rem),
    #f6f7fb;
}

.standalone-chat-page {
  min-height: 100vh;
  padding: 20px;
  display: flex;
  align-items: stretch;
  justify-content: center;
}

.standalone-chat-page--state {
  align-items: center;
  text-align: center;
}

.standalone-chat-shell {
  width: min(100%, 960px);
  min-height: calc(100vh - 40px);
  overflow: hidden;
  border: 1px solid var(--color-border-subtle);
  border-radius: 18px;
  background: var(--color-white);
  box-shadow: 0 20px 70px rgba(15, 23, 42, 0.08);
}

.standalone-chat-shell .chat-widget--embed {
  height: 100%;
  min-height: calc(100vh - 40px);
  background: transparent;
}

.standalone-chat-shell .chat-widget__header {
  border-bottom: 1px solid var(--color-border-subtle);
}

.standalone-chat-shell .chat-widget__body {
  background: #f8fafc;
}

.standalone-chat-shell:has(.chat-widget--dark) {
  border-color: #3f3f46;
  background: #18181b;
  box-shadow: 0 20px 70px rgba(0, 0, 0, 0.45);
}

.standalone-chat-shell:has(.chat-widget--dark) .chat-widget__header {
  border-bottom-color: #3f3f46;
}

.standalone-chat-shell:has(.chat-widget--dark) .chat-widget__body {
  background: #18181b;
}

body.standalone-chat-route:has(.chat-widget--dark) {
  background:
    radial-gradient(circle at top right, rgba(63, 63, 70, 0.35), transparent 32rem),
    #0a0a0a;
}

.standalone-chat-shell .chat-widget__messages {
  max-width: 820px;
  width: 100%;
  margin: 0 auto;
  padding: 28px 20px 130px;
}

.standalone-chat-shell .chat-widget__footer {
  width: min(100%, 820px);
  margin: 0 auto;
  left: 50%;
  right: auto;
  transform: translateX(-50%);
  padding-inline: 20px;
}

@media (max-width: 640px) {
  .standalone-chat-page {
    padding: 0;
  }

  .standalone-chat-shell {
    width: 100%;
    min-height: 100vh;
    border: none;
    border-radius: 0;
  }

  .standalone-chat-shell .chat-widget--embed {
    min-height: 100vh;
  }

  .standalone-chat-shell .chat-widget__messages {
    padding-inline: 12px;
  }

  .standalone-chat-shell .chat-widget__footer {
    padding-inline: 12px;
  }
}

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

.sources-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 24px;
  align-items: stretch;
  height: 100%;
  min-height: 0;
  overflow: hidden;
}

.sources-main {
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
}

@media (max-width: 880px) {
  .sources-layout {
    grid-template-columns: 1fr;
  }
}

.sources-summary-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  font-size: 14px;
}

.sources-summary-list li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

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

.sources-list__row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
}

.sources-section {
  margin-bottom: 24px;
}

.sources-section__head {
  margin-bottom: 16px;
}

.sources-section__footer {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid rgba(0, 0, 0, 0.08);
}

.sources-list__row--nested {
  padding: 12px 14px;
  background: #fafafa;
}

.sources-wp-status-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 12px;
  margin-bottom: 12px;
}

.sources-wp-stat {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 13px;
}

.sources-wp-stat__label {
  color: #71717a;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.sources-status {
  display: inline-block;
  font-size: 12px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 999px;
}

.sources-status--ok {
  background: #ecfdf5;
  color: #047857;
}

.sources-status--warn {
  background: #fffbeb;
  color: #b45309;
}

.sources-status--err {
  background: #fef2f2;
  color: #b91c1c;
}

.sources-status--muted {
  background: #f4f4f5;
  color: #52525b;
}

.sources-wp-brief--nested {
  background: #fafafa;
  padding: 12px 14px;
}

.sources-wp-brief__stats {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 8px;
  font-size: 13px;
}

.sources-wp-brief__stats li {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.sources-wp-brief__stats span {
  color: #71717a;
  font-size: 11px;
}

.sources-wp-brief__preview {
  margin: 10px 0 0;
  max-height: 64px;
  overflow: hidden;
  line-height: 1.4;
}

.card-block {
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-card);
  padding: 16px;
  background: var(--color-white);
}

.snippet-form .label {
  display: block;
  margin-bottom: 12px;
}

.warn-banner {
  padding: 10px 12px;
  border-radius: 10px;
  background: #fffbeb;
  border: 1px solid #fcd34d;
  font-size: 13px;
  color: #92400e;
}

  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 20px;
}

  display: flex;
  gap: 14px;
  align-items: flex-start;
}

  margin: 0 0 6px;
}

  width: 48px;
  height: 48px;
  border-radius: 12px;
  margin-bottom: 0;
}

  width: 24px;
  height: 24px;
}

  display: block;
  margin-bottom: 14px;
}

.block {
  display: block;
}

.instructions-page {
  max-width: 720px;
}

.instructions-form .label {
  display: block;
}

.btn-small {
  padding: 6px 12px;
  font-size: 13px;
}

.dash-shell__main--bleed {
  padding: 0;
  overflow: hidden;
}

.dash-shell__content--bleed {
  height: 100%;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.dash-shell__content--bleed > .playground-page {
  flex: 1;
  min-height: 0;
  height: 100%;
}

.sources-knowledge-layout {
  flex: 1;
  min-height: 0;
  height: 100%;
  display: flex;
  overflow: hidden;
}

.sources-knowledge-main {
  display: flex;
  min-height: 0;
  min-width: 0;
  flex: 1;
  flex-direction: column;
  overflow-x: hidden;
  overflow-y: auto;
  background: var(--color-white);
  scrollbar-width: none;
}

.sources-knowledge-main::-webkit-scrollbar {
  display: none;
}

/* Knowledge section — layout structure only (FAQ / text snippets) */
.knowledge-section {
  display: flex;
  flex-direction: column;
}

.knowledge-section__header,
.knowledge-section__add-desktop,
.knowledge-section__add-mobile,
.knowledge-section__list {
  padding-inline: 16px;
}

@media (min-width: 640px) {
  .knowledge-section__header,
  .knowledge-section__add-desktop,
  .knowledge-section__add-mobile,
  .knowledge-section__list {
    padding-inline: 24px;
  }
}

.knowledge-section__header {
  padding-top: 8px;
  padding-bottom: 4px;
}

.knowledge-section__add-desktop {
  display: none;
  padding-top: 20px;
}

.knowledge-section__add-mobile {
  padding-top: 16px;
}

.knowledge-section__list {
  padding-top: 16px;
  padding-bottom: 24px;
}

@media (min-width: 1024px) {
  .knowledge-section__header,
  .knowledge-section__add-desktop,
  .knowledge-section__add-mobile,
  .knowledge-section__list {
    padding-inline: 32px;
  }

  .knowledge-section__add-desktop {
    display: block;
  }

  .knowledge-section__add-mobile {
    display: none;
  }
}

.knowledge-form {
  display: flex;
  flex-direction: column;
}

.knowledge-form__fields {
  display: flex;
  flex-direction: column;
  flex: 1;
}

.knowledge-form__field {
  display: flex;
  flex-direction: column;
  width: 100%;
}

.knowledge-form__field > * + * {
  margin-top: 8px;
}

.knowledge-form__field + .knowledge-form__field {
  margin-top: 20px;
}

.knowledge-form__field--grow {
  flex: 1;
}

.knowledge-form__actions {
  display: flex;
  flex-direction: column;
  margin-top: 20px;
}

@media (min-width: 1024px) {
  .knowledge-form__actions {
    align-items: flex-end;
  }
}

.knowledge-section__toolbar {
  display: flex;
  flex-direction: column;
}

.knowledge-section__toolbar--links .knowledge-toolbar__row + .knowledge-toolbar__row {
  margin-top: 10px;
}

.knowledge-section__toolbar--links > [data-slot="separator"] {
  margin-top: 10px;
}

.knowledge-toolbar__row {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
}

.knowledge-toolbar__row + .knowledge-toolbar__row {
  margin-top: 16px;
}

.knowledge-toolbar__row--title-search .knowledge-toolbar__search {
  display: flex;
  flex-direction: row;
  align-items: center;
  flex: 1;
  min-width: 0;
  justify-content: flex-end;
}

.knowledge-toolbar__bulk,
.knowledge-toolbar__sort {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
}

.knowledge-toolbar__bulk > * + *,
.knowledge-toolbar__sort > * + * {
  margin-inline-start: 8px;
}

.knowledge-list-item__title-row > * + * {
  margin-inline-start: 8px;
}

.knowledge-list-item__meta-row > * + * {
  margin-inline-start: 8px;
}

.knowledge-section__toolbar > [data-slot="separator"] {
  margin-top: 16px;
}

.knowledge-section__items {
  display: flex;
  flex-direction: column;
  margin-top: 16px;
}

.knowledge-list-item {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  padding: 12px 0;
  border-bottom: 1px solid var(--color-border-subtle);
}

.knowledge-list-item__checkbox {
  flex-shrink: 0;
}

.knowledge-list-item__body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  flex: 1;
  min-width: 0;
  margin-inline-start: 12px;
}

.knowledge-list-item__main {
  min-width: 0;
  cursor: pointer;
}

.knowledge-list-item__globe {
  flex-shrink: 0;
  color: var(--color-muted, #6b7280);
  margin-inline-end: 0.35rem;
}

.knowledge-list-item__title-row {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  font-size: 1rem;
  line-height: 1.55;
}

.knowledge-list-item__title-row > span[dir="ltr"] {
  font-size: inherit;
  line-height: inherit;
}

.knowledge-list-item__meta-row {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  margin-top: 4px;
  font-size: 0.75rem;
  color: var(--color-text-muted);
}

.knowledge-list-item__preview {
  margin-top: 8px;
  white-space: pre-wrap;
}

.knowledge-source-children {
  border-inline-start: 2px solid var(--color-border-subtle);
  margin-inline-start: 6px;
  padding-inline-start: 12px;
}

.knowledge-source-child {
  border: 1px solid var(--color-border-subtle);
  border-radius: 10px;
  background: var(--color-surface-subtle, rgba(0, 0, 0, 0.02));
  padding: 10px 12px;
}

.knowledge-source-child + .knowledge-source-child {
  margin-top: 8px;
}

.knowledge-list-item__actions {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: flex-end;
}
.knowledge-list-item__link-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 4px;
  color: var(--color-text-muted, #888);
  text-decoration: none;
  transition: background 0.15s;
}
.knowledge-list-item__link-btn:hover {
  background: var(--color-hover, rgba(0,0,0,0.06));
  color: var(--color-text);
}
.website-add-url-form .row {
  flex-direction: row;
  align-items: center;
}

.knowledge-list-item__chevron {
  flex-shrink: 0;
  width: 15px;
  height: 15px;
  color: var(--color-text-muted);
  opacity: 0.5;
  transition: transform 0.2s ease;
}

.knowledge-list-item__chevron[data-expanded] {
  transform: rotate(180deg);
}

[data-slot="checkbox"][data-state="indeterminate"] {
  border-color: var(--color-primary, #2563eb);
  background: var(--color-primary, #2563eb);
}

[data-slot="checkbox"][data-state="indeterminate"] [data-slot="checkbox-indicator"] {
  display: none;
}

[data-slot="checkbox"][data-state="indeterminate"]::after {
  content: "";
  position: absolute;
  width: 8px;
  height: 2px;
  border-radius: 1px;
  background: var(--color-white, #fff);
}

.playground-page {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 0;
  height: 100%;
  background: var(--color-white);
}

.playground-layout {
  display: flex;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

.playground-layout__settings {
  flex: 0 0 475px;
  width: 475px;
  max-width: 480px;
  flex-shrink: 0;
  border-inline-end: 2px solid var(--color-border-subtle);
  background: var(--color-white);
  position: relative;
  min-height: 0;
  height: 100%;
  overflow: hidden;
}

.playground-settings {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}

.playground-settings__scroll {
  flex: 1;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  padding: 0 24px 28px;
}

.playground-settings__scroll--pad-footer {
  padding-bottom: 148px;
}

.playground-sidebar-footer {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 50;
  flex-shrink: 0;
  padding: 16px;
  background: var(--color-white);
  border-top: 1px solid var(--color-border-subtle);
  border-radius: 12px 12px 0 0;
  box-shadow: 0 0 16px rgb(0 0 0 / 0.1);
}

.playground-sidebar-footer__text {
  margin: 0 0 14px;
  font-size: 14px;
  color: var(--color-text-secondary);
  line-height: 1.5;
}

.playground-sidebar-footer__actions {
  display: flex;
  gap: 12px;
}

.playground-sidebar-footer__actions > * {
  flex: 1;
}

.playground-layout__preview {
  flex: 1;
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.playground-settings__title,
.playground-settings__subtitle {
  /* legacy aliases — use DashboardPageHeader */
}

.dashboard-page-header--settings {
  padding: 20px 24px 16px;
  flex-shrink: 0;
}


.playground-status {
  border-radius: var(--radius-card);
  padding: 12px 14px;
  margin-bottom: 16px;
  background: #fafafa;
}

.playground-status--ok .playground-status__label {
  color: #15803d;
}

.playground-status--warn .playground-status__label {
  color: #b45309;
}

.playground-status--training .playground-status__label {
  color: #2563eb;
}

.playground-status__label {
  margin: 0 0 4px;
  font-weight: var(--font-weight-medium);
  font-size: 14px;
}

.playground-status__label::before {
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  margin-left: 6px;
  vertical-align: middle;
  background: currentColor;
}

.playground-status__meta {
  margin: 0;
}

.playground-section {
  margin-bottom: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--color-border-subtle);
}

.playground-section--last,
.playground-section:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 8px;
}

.playground-section__heading {
  margin: 0;
  font-size: 14px;
  font-weight: var(--font-weight-medium);
}

.playground-section__hint {
  margin: 6px 0 10px;
}

.playground-fields {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.playground-fields .label {
  margin: 0;
  gap: 6px;
}

.playground-avatar-field {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px;
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-card);
  background: #fafafa;
}

.playground-avatar-field__preview {
  width: 54px;
  height: 54px;
  flex: 0 0 54px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 18px;
  background: var(--color-white);
  border: 1px solid var(--color-border-subtle);
  color: var(--color-text-primary);
  font-size: 20px;
  font-weight: var(--font-weight-semibold);
}

.playground-avatar-field__preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.playground-avatar-field__body {
  min-width: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.playground-avatar-field__title {
  margin: 0 0 4px;
  font-size: 14px;
  font-weight: var(--font-weight-medium);
  color: var(--color-text-primary);
}

.playground-avatar-field__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.playground-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.playground-row__text {
  font-size: 14px;
  color: var(--color-text-primary);
}

.playground-row__label {
  flex: 1;
  margin: 0;
}

.playground-row__value {
  display: block;
  margin-top: 4px;
}

/* Primary color field (playground) */
.color-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.color-field__label {
  font-size: 14px;
  font-weight: var(--font-weight-medium);
  color: var(--color-text-primary);
  line-height: 1.2;
}

.color-field__row {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 12px;
}

.color-field__combo {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  padding: 6px 10px;
  border-radius: 8px;
  background: #f4f4f5;
  border: 1px solid transparent;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.color-field__combo:focus-within {
  border-color: #3b81f6;
  box-shadow: 0 0 0 1px #3b81f6;
}

.color-field__swatch-wrap {
  position: relative;
  width: 24px;
  height: 24px;
  flex-shrink: 0;
  border-radius: 6px;
  border: 2px solid #fff;
  box-shadow: 0 1px 3px rgb(0 0 0 / 0.18);
  overflow: hidden;
}

.color-field__native {
  position: absolute;
  left: -8px;
  top: -8px;
  width: 40px;
  height: 40px;
  padding: 0;
  border: none;
  cursor: pointer;
}

.color-field__hex {
  flex: 1;
  min-width: 0;
  border: none;
  background: transparent;
  font-family: YekanBakh, sans-serif;
  font-size: 14px;
  font-weight: var(--font-weight-medium);
  text-transform: uppercase;
  letter-spacing: 0.02em;
  color: var(--color-text-primary);
  outline: none;
}

.color-field__reset {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--color-border-subtle);
  border-radius: 8px;
  background: var(--color-white);
  color: var(--color-text-secondary);
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.color-field__reset:hover {
  background: #f4f4f5;
  color: var(--color-text-primary);
}

.playground-section__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

.playground-instructions {
  width: 100%;
  min-height: 200px;
  max-height: none;
  font-family: YekanBakh, sans-serif;
  font-size: 14px;
  line-height: 1.75;
  resize: vertical;
}

  border: 1px dashed var(--color-border-subtle);
  border-radius: var(--radius-card);
  padding: 14px;
  text-align: center;
  margin-bottom: 8px;
}

.playground-suggestions {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.playground-suggestions__row {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-top: 8px;
}

.playground-suggestions__row:first-child {
  margin-top: 0;
}

.playground-suggestions__row .input {
  flex: 1;
}

.playground-theme-toggle {
  display: flex;
  gap: 0;
  margin-top: 8px;
  border: 1px solid var(--color-border-subtle);
  border-radius: 10px;
  overflow: hidden;
  width: fit-content;
}

.playground-theme-toggle button {
  padding: 8px 16px;
  font-size: 13px;
  border: none;
  background: var(--color-white);
  color: var(--color-text-secondary);
  cursor: pointer;
}

.playground-theme-toggle button.active {
  background: var(--color-text-primary);
  color: var(--color-white);
}

.playground-deploy-tabs {
  margin-bottom: 8px;
}

.playground-preview {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 0;
  height: 100%;
  width: 100%;
}

.playground-preview__canvas {
  position: relative;
  flex: 1;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  box-sizing: border-box;
  background-color: #fff;
  background-image: radial-gradient(#ebebeb 2px, transparent 2px);
  background-size: 22px 22px;
  box-shadow: inset 0 0 24px rgba(0, 0, 0, 0.04);
}

.playground-sync-toast {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: min(444px, calc(100% - 32px));
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 13px;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid #e5e7eb;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
  color: #374151;
}

.playground-sync-toast button {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
  color: #6b7280;
  padding: 0;
  flex-shrink: 0;
}

.playground-sync-toast__content {
  flex: 1;
  min-width: 0;
}

.playground-onboarding-hint,
.playground-activation-nudge {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 10px 28px 10px 12px;
  border-radius: 10px;
  border: 1px solid #e5e7eb;
  background: #f8fafc;
}

.playground-activation-nudge__title {
  font-size: 0.8125rem;
  font-weight: 600;
  color: #111827;
}

.playground-activation-nudge__list {
  padding-inline-start: 1.1rem;
  line-height: 1.6;
}

.playground-onboarding-hint__link {
  background: none;
  border: none;
  padding: 0;
  color: var(--color-primary, #2563eb);
  cursor: pointer;
  font: inherit;
  text-decoration: underline;
}

.playground-onboarding-hint__dismiss {
  position: absolute;
  top: 6px;
  inset-inline-end: 8px;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
  color: #6b7280;
  padding: 2px;
}

.training-done-toast {
  position: fixed;
  top: 72px;
  inset-inline-end: 20px;
  z-index: 60;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  width: min(360px, calc(100% - 32px));
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.98);
  border: 1px solid #e5e7eb;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
  direction: rtl;
}
.training-done-toast__title {
  margin: 0;
  font-size: 13px;
  font-weight: 600;
}
.training-done-toast__text {
  margin: 4px 0 0;
  font-size: 12px;
  color: #6b7280;
}

.sync-progress-bar {
  height: 4px;
  border-radius: 4px;
  background: #e5e7eb;
  overflow: hidden;
  width: 100%;
}

.sync-progress-bar__fill {
  height: 100%;
  background: #111827;
  transition: width 0.4s ease;
}

.playground-settings-tabs {
  display: flex;
  gap: 4px;
  padding: 4px;
  border-radius: 10px;
  background: var(--muted);
  margin-bottom: 16px;
}

.playground-settings-tabs button {
  flex: 1;
  border: none;
  background: transparent;
  border-radius: 8px;
  padding: 8px 10px;
  font: inherit;
  font-size: 13px;
  font-weight: var(--font-weight-medium);
  color: var(--muted-foreground);
  cursor: pointer;
  transition: background-color 0.14s ease, color 0.14s ease, box-shadow 0.14s ease;
}

.playground-settings-tabs button:hover {
  color: var(--foreground);
}

.playground-settings-tabs button:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px var(--background), 0 0 0 4px var(--ring);
}

.playground-settings-tabs button.active {
  background: var(--card);
  color: var(--foreground);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
}

.playground-section__row--spaced {
  margin-top: 8px;
}

.playground-section__divider {
  margin: 14px 0 16px;
}

.playground-preview__frame {
  position: relative;
  width: 444px;
  max-width: calc(100% - 32px);
  height: 789px; /* 9:16 aspect ratio, width kept as the larger base dimension */
  max-height: calc(100% - 64px);
  display: flex;
  flex-shrink: 0;
  margin: 0 auto;
}

.playground-preview__status {
  position: absolute;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 3;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  line-height: 1.4;
  color: #374151;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid #e5e7eb;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  pointer-events: none;
  white-space: nowrap;
}

.playground-preview__status--saving {
  color: #1f2937;
  border-color: #d1d5db;
}

.playground-sources-debug-trigger {
  position: absolute;
  bottom: 12px;
  left: 12px;
  z-index: 2;
  padding: 4px 8px;
  border: none;
  background: transparent;
  color: #9ca3af;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.playground-sources-debug-trigger:hover {
  color: #6b7280;
}

.preview-sources {
  width: 444px;
  max-width: calc(100% - 32px);
  direction: rtl;
}

.preview-sources__toggle {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.96);
  color: #374151;
  font: inherit;
  font-size: 13px;
  font-weight: var(--font-weight-medium);
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
}

.preview-sources__toggle:disabled {
  cursor: default;
  color: #9ca3af;
}

.preview-sources__dialog-backdrop {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(15, 23, 42, 0.26);
  backdrop-filter: blur(2px);
}

.preview-sources__dialog {
  width: min(760px, 100%);
  max-height: min(760px, calc(100vh - 48px));
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid #e5e7eb;
  border-radius: 18px;
  background: #ffffff;
  box-shadow: 0 24px 80px rgba(15, 23, 42, 0.28);
  color: #374151;
}

.preview-sources__dialog-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 18px;
  border-bottom: 1px solid #f1f5f9;
}

.preview-sources__dialog-header h3 {
  margin: 0 0 4px;
  font-size: 15px;
  color: #111827;
}

.preview-sources__dialog-header p {
  margin: 0;
  font-size: 12px;
  color: #6b7280;
}

.preview-sources__dialog-header button {
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 999px;
  background: #f3f4f6;
  color: #4b5563;
  cursor: pointer;
  font-size: 20px;
  line-height: 1;
}

.preview-sources__panel {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 16px 18px 18px;
  font-size: 12px;
}

.preview-sources__section + .preview-sources__section {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid #f1f5f9;
}

.preview-sources__section h4 {
  margin: 0 0 8px;
  font-size: 12px;
  color: #111827;
}

.preview-sources__section ul {
  display: grid;
  gap: 8px;
  padding: 0;
  margin: 0;
  list-style: none;
}

.preview-sources__section li {
  display: grid;
  gap: 4px;
}

.preview-sources__section code,
.preview-sources__section pre {
  direction: ltr;
  text-align: left;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  margin: 0;
  font-size: 11px;
  color: #4b5563;
}

.preview-sources__section p {
  margin: 0;
  color: #6b7280;
  line-height: 1.6;
}

.preview-sources__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  color: #6b7280;
  direction: ltr;
}

.preview-sources__score {
  direction: ltr;
  unicode-bidi: plaintext;
}

.playground-preview__frame .chat-widget {
  width: 100%;
  height: 100%;
  max-width: none;
  display: flex;
  flex-direction: column;
  border-radius: 20px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
  border: 1px solid rgba(0, 0, 0, 0.06);
  overflow: hidden;
}

.playground-preview__frame .chat-widget.chat-widget--dark {
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.45);
  border-color: #3f3f46;
}

.playground-preview__frame .chat-widget.chat-widget--embed {
  border: none;
}

.playground-preview__frame .chat-widget__body {
  flex: 1;
  min-height: 0;
}

.playground-preview__frame .chat-widget__messages {
  max-height: none;
  flex: 1;
}

.playground-preview__frame .chat-widget__msg-group--user,
.playground-preview__frame .chat-widget__msg-group--assistant:has(> .chat-widget__bubble) {
  max-width: 80%;
}

/* Product/order rows use --full and never share a bubble group, so they stay 100%. */
.playground-preview__frame .chat-widget__msg-group--assistant.chat-widget__msg-group--full {
  max-width: 100%;
  width: 100%;
  align-self: stretch;
}

.playground-preview__frame .chat-widget__bubble {
  width: fit-content;
  max-width: 100%;
  min-width: 0;
}

.playground-error {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 40;
  padding: 8px 24px 16px;
  background: var(--color-white);
  border-top: 1px solid var(--color-border-subtle);
}

.playground-mobile-tabs {
  display: none;
}

.chat-widget__reset {
  border: none;
  background: transparent;
  color: inherit;
  opacity: 0.85;
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
  padding: 6px 8px;
  border-radius: 6px;
}

.chat-widget__reset:hover:not(:disabled) {
  opacity: 1;
  background: rgba(151, 151, 151, 0.2);
}

.chat-widget__suggestions {
  display: flex;
  flex-wrap: wrap-reverse;
  gap: 8px;
  align-self: stretch;
  width: 100%;
  padding: 0;
  margin: 0;
  border-top: none;
  justify-content: flex-start;
}

.chat-widget__footer .chat-widget__suggestion-chip {
  font-size: 15px;
  line-height: 1.4;
}

.chat-widget__suggestion-chip {
  border: 1px solid var(--color-border-subtle);
  background: var(--color-white);
  border-radius: 999px;
  padding: 6px 12px;
  font-family: inherit;
  cursor: pointer;
  color: var(--color-text-primary);
  max-width: 100%;
  text-align: right;
  transition: border-color 0.14s ease, background 0.14s ease, transform 0.14s ease;
  touch-action: manipulation;
}

.chat-widget__suggestion-chip:hover:not(:disabled) {
  border-color: color-mix(in srgb, var(--color-primary, #111827) 55%, var(--color-border-subtle, #e4e4e7));
  background: color-mix(in srgb, var(--color-primary, #111827) 6%, #fff);
}

.chat-widget__suggestion-chip:active:not(:disabled) {
  transform: scale(0.97);
}

@media (prefers-reduced-motion: reduce) {
  .chat-widget__composer-send,
  .chat-widget__menu-btn,
  .chat-widget__close-btn,
  .chat-widget__suggestion-chip {
    transition: none;
  }

  .chat-widget__composer-send:hover:not(:disabled),
  .chat-widget__composer-send:active:not(:disabled),
  .chat-widget__menu-btn:active:not(:disabled),
  .chat-widget__close-btn:active:not(:disabled),
  .chat-widget__suggestion-chip:active:not(:disabled) {
    transform: none;
  }
}

@media (max-width: 1024px) {
  .playground-layout {
    flex-direction: column;
  }

  .playground-layout__settings {
    flex: none;
    width: 100%;
    max-width: 100%;
    border-inline-end: none;
    border-bottom: 1px solid var(--color-border-subtle);
    max-height: 100vh;
  }

  .playground-layout__preview {
    flex: 1;
    min-height: 280px;
  }

  .playground-layout__pane--hidden-mobile {
    display: none;
  }

  .playground-mobile-tabs {
    display: flex;
    gap: 0;
    border-bottom: 1px solid var(--color-border-subtle);
    background: var(--color-white);
  }

  .playground-mobile-tabs button {
    flex: 1;
    padding: 14px;
    border: none;
    background: transparent;
    font-family: inherit;
    font-size: 14px;
    font-weight: var(--font-weight-medium);
    color: var(--color-text-muted);
    border-bottom: 2px solid transparent;
    cursor: pointer;
  }

  .playground-mobile-tabs button.active {
    color: var(--color-text-primary);
    border-bottom-color: #3b81f6;
  }

  .playground-preview__frame {
    width: min(444px, calc(100% - 32px));
    height: min(789px, 70vh);
  }
}

/* Debug lab */
.debug-lab__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

.debug-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 20px;
}

.debug-tabs__btn {
  padding: 8px 14px;
  border: 1px solid var(--color-border-subtle);
  border-radius: 8px;
  background: var(--color-white);
  font-family: inherit;
  font-size: 13px;
  cursor: pointer;
  color: var(--color-text-muted);
}

.debug-tabs__btn--active {
  border-color: #3b81f6;
  color: var(--color-text-primary);
  background: #eff6ff;
}

.debug-split {
  display: grid;
  grid-template-columns: minmax(240px, 320px) 1fr;
  gap: 16px;
  align-items: start;
}

@media (max-width: 900px) {
  .debug-split {
    grid-template-columns: 1fr;
  }
}

.debug-pre {
  margin: 0;
  padding: 12px;
  background: #0f172a;
  color: #e2e8f0;
  border-radius: 8px;
  font-size: 11px;
  line-height: 1.45;
  overflow: auto;
  max-height: 480px;
  direction: ltr;
  text-align: left;
  white-space: pre-wrap;
  word-break: break-word;
}

.debug-pre--sm {
  max-height: 200px;
  font-size: 10px;
}

.debug-block__title {
  margin: 0 0 8px;
  font-size: 13px;
  font-weight: 600;
}

.debug-trace-list {
  list-style: none;
  margin: 12px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.debug-trace-item {
  width: 100%;
  text-align: right;
  padding: 10px 12px;
  border: 1px solid var(--color-border-subtle);
  border-radius: 8px;
  background: var(--color-white);
  cursor: pointer;
  font-family: inherit;
}

.debug-trace-item__msg {
  display: block;
  font-size: 13px;
  margin-bottom: 4px;
}

.debug-form-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: flex-end;
}

.debug-form-row label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 160px;
}

.debug-textarea {
  width: 100%;
  min-height: 120px;
  font-family: inherit;
  font-size: 13px;
  padding: 10px;
  border-radius: 8px;
  border: 1px solid var(--color-border-subtle);
}

.debug-section-card {
  border: 1px solid var(--color-border-subtle);
  border-radius: 10px;
  padding: 12px;
  background: #fafafa;
}

.chat-widget__debug-toggle {
  border: 1px solid rgba(255, 255, 255, 0.5);
  background: transparent;
  color: inherit;
  font-size: 10px;
  font-weight: 700;
  padding: 4px 8px;
  border-radius: 6px;
  cursor: pointer;
  margin-inline-end: 6px;
}

.chat-widget__debug-toggle--on {
  background: rgba(255, 255, 255, 0.25);
}

.chat-widget__debug-panel {
  border-top: 1px solid var(--color-border-subtle);
  padding: 8px 12px;
  background: #f8fafc;
  max-height: 180px;
  overflow: auto;
}

/* ── Sources summary aside ─────────────────────────────────── */
.sources-summary-aside {
  display: none;
  height: 100%;
  width: 35%;
  max-width: 440px;
  flex-shrink: 0;
  overflow-y: auto;
  border-inline-start: 1px solid var(--color-border-subtle);
  background: var(--color-surface-subtle);
}

@media (min-width: 1024px) {
  .sources-summary-aside {
    display: flex;
  }
}

.sources-summary-aside__inner {
  display: flex;
  flex-direction: column;
  gap: 20px;
  width: 100%;
  padding: 32px;
}

.sources-summary-aside__inner h2 {
  font-size: 1.1rem;
  font-weight: var(--font-weight-semibold);
  margin: 0;
}

.sources-kind-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.sources-kind-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border: 1px solid var(--color-border-subtle);
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 1rem;
  background: var(--color-white);
}

.sources-kind-row--block {
  border: none;
  gap: 0.75rem;
  padding: 0.625rem 0.75rem;
  border-radius: var(--radius, 8px);
  background: var(--color-surface-subtle, #f3f4f6);
  font-size: 0.875rem;
}

.sources-kind-row > span:first-child {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--color-text-secondary);
}

.sources-quota-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  border: 1px solid var(--color-border-subtle);
  border-radius: 10px;
  padding: 14px 16px;
  background: var(--color-white);
}

.sources-quota-card__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 14px;
  font-weight: var(--font-weight-semibold);
}

.sources-summary-mobile {
  position: sticky;
  bottom: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
  border-top: 1px solid var(--color-border-subtle);
  background: var(--color-white);
  padding: 16px 16px calc(16px + env(safe-area-inset-bottom, 0px));
  box-shadow: 0 -4px 6px -1px rgba(0,0,0,0.06);
}

@media (min-width: 1024px) {
  .sources-summary-mobile { display: none; }
}

/* ── Shop connect flow ──────────────────────────────────────── */
.shop-connect-flow {
  display: flex;
  flex-direction: column;
  gap: 24px;
  max-width: 800px;
}

.shop-connect-flow__header h2 {
  margin: 0 0 4px;
  font-size: 1.25rem;
  font-weight: var(--font-weight-semibold);
}

.shop-connect-flow__panel {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.shop-step-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
}

.shop-step-nav__item {
  display: flex;
  align-items: center;
  flex: 1;
  min-width: 0;
}

.shop-step-nav__trigger {
  display: flex;
  align-items: center;
  gap: 10px;
  background: none;
  border: none;
  cursor: pointer;
  font: inherit;
  padding: 6px 4px;
  border-radius: 8px;
  color: var(--color-text-secondary);
  flex: 1;
}

.shop-step-nav__trigger--locked {
  opacity: 0.4;
  cursor: default;
}

.shop-step-nav__trigger--active,
.shop-step-nav__trigger--done {
  color: var(--color-text-primary);
}

.shop-step-nav__indicator {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  font-size: 13px;
  font-weight: var(--font-weight-medium);
  flex-shrink: 0;
  border: 2px solid var(--color-border-subtle);
  background: var(--color-white);
}

.shop-step-nav__trigger--active .shop-step-nav__indicator {
  border-color: var(--color-black);
  background: var(--color-black);
  color: #fff;
}

.shop-step-nav__trigger--done .shop-step-nav__indicator {
  border-color: #16a34a;
  background: #dcfce7;
  color: #16a34a;
}

.shop-step-nav__label {
  display: none;
  flex-direction: column;
  gap: 1px;
}

@media (min-width: 600px) {
  .shop-step-nav__label { display: flex; }
}

.shop-step-nav__title {
  font-size: 13px;
  font-weight: var(--font-weight-medium);
}

.shop-step-nav__desc {
  font-size: 11px;
  color: var(--color-text-secondary);
}

.shop-step-nav__sep {
  flex: 1;
  height: 1px;
  background: var(--color-border-subtle);
  margin: 0 4px;
}

.shop-sync-status {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  border: 1px solid var(--color-border-subtle);
  border-radius: 12px;
  padding: 40px 24px;
  text-align: center;
}

.shop-sync-status__spinner {
  animation: spin 1s linear infinite;
  color: var(--color-text-secondary);
}

@keyframes spin { to { transform: rotate(360deg); } }

.shop-sync-status__count {
  font-size: 2.5rem;
  font-weight: var(--font-weight-bold);
  color: #16a34a;
  margin: 0;
}

/* ── Knowledge add card ─────────────────────────────────────── */
.knowledge-add-card {
  border: 1px solid var(--color-border-subtle);
  border-radius: 12px;
  background: var(--color-white);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
  padding: 20px;
}

.knowledge-add-card [data-slot="accordion-trigger"] {
  font-size: 1.1rem;
  font-weight: var(--font-weight-semibold);
}

/* ── Product catalog card (compact) ────────────────────────── */
.product-card {
  overflow: hidden;
  border-radius: 10px;
  border: 1px solid var(--color-border-subtle);
  background: var(--color-white);
  transition: border-color 0.15s ease;
}

.product-card:hover {
  border-color: var(--color-primary, #2563eb);
}

.product-card__link {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
  height: 100%;
}

.product-card__image {
  width: 100%;
  aspect-ratio: 3 / 2;
  overflow: hidden;
  background: var(--color-surface-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.product-card__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.product-card__no-image {
  font-size: 11px;
  color: var(--color-text-muted);
}

.product-card__body {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 10px 12px 12px;
  flex: 1;
  min-height: 108px;
}

.product-card__top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 6px;
}

.product-card__name {
  margin: 0;
  font-size: 13px;
  font-weight: var(--font-weight-medium);
  line-height: 1.4;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  flex: 1;
}

.product-card__desc {
  margin: 0;
  font-size: 11px;
  color: var(--color-text-secondary);
  line-height: 1.4;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
}

.product-card__cat {
  font-size: 10px;
  color: var(--color-text-muted);
}

.product-card__pricing {
  margin-top: auto;
  direction: ltr;
  text-align: left;
  align-self: flex-end;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
}

.product-card__price {
  font-size: 13px;
  font-weight: var(--font-weight-semibold);
  color: var(--color-text-primary);
}

.product-card__regular {
  font-size: 11px;
  color: var(--color-text-muted);
  text-decoration: line-through;
}

.search-field {
  position: relative;
  display: flex;
  align-items: center;
  flex: 1;
  min-width: 0;
  width: 100%;
}

.search-field__icon {
  position: absolute;
  inset-inline-end: 12px;
  color: var(--color-text-muted);
  pointer-events: none;
  flex-shrink: 0;
}

.search-field__input {
  width: 100%;
  padding-inline-end: 36px;
}

.knowledge-toolbar__search .search-field {
  flex: 1;
  min-width: 180px;
  max-width: 320px;
}

.products-toolbar {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.products-toolbar__search {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-width: 0;
}

@media (min-width: 768px) {
  .products-toolbar {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
  }

  .products-toolbar__search {
    max-width: 480px;
    flex: 1;
  }

  .products-toolbar__count {
    flex-shrink: 0;
  }
}

/* ── Warning alert ──────────────────────────────────────────── */
.alert-warning {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  background: #fffbeb;
  border: 1px solid #fcd34d;
  border-radius: 8px;
  color: #92400e;
}

.alert-warning svg {
  flex-shrink: 0;
  margin-top: 1px;
  color: #d97706;
}

.alert-warning__title {
  margin: 0 0 3px;
  font-size: 13px;
  font-weight: var(--font-weight-semibold);
}

.alert-warning__text {
  margin: 0;
  font-size: 12px;
  line-height: 1.5;
  color: #b45309;
}

.alert-warning__spin {
  animation: spin 0.9s linear infinite;
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.alert-success {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  background: #ecfdf5;
  border: 1px solid #6ee7b7;
  border-radius: 8px;
  color: #065f46;
}

.alert-success svg {
  flex-shrink: 0;
  margin-top: 1px;
  color: #059669;
}

.alert-success__title {
  margin: 0 0 3px;
  font-size: 13px;
  font-weight: var(--font-weight-semibold);
}

.alert-success__text {
  margin: 0;
  font-size: 12px;
  line-height: 1.5;
  color: #047857;
}

/* ── Chat bubble markdown styles ─────────────────────────────── */
.chat-md p {
  margin: 0 0 6px;
  line-height: 1.55;
}

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

.chat-md strong {
  font-weight: var(--font-weight-semibold);
}

.chat-md-list {
  margin: 4px 0 6px;
  padding-inline-start: 18px;
  list-style: disc;
}

.chat-md-list:last-child {
  margin-bottom: 0;
}

.chat-md-list li {
  margin-bottom: 3px;
  line-height: 1.5;
}

.chat-md-link {
  color: var(--color-primary, #2563eb);
  text-decoration: underline;
  text-underline-offset: 2px;
  word-break: break-word;
}

.chat-md-link:hover {
  color: color-mix(in srgb, var(--color-primary, #2563eb) 82%, #000);
}

.chat-md-h {
  margin: 0 0 6px;
  font-weight: var(--font-weight-semibold);
  line-height: 1.35;
}

.chat-md-h:last-child {
  margin-bottom: 0;
}

.chat-md-h1 {
  font-size: 1.15em;
}

.chat-md-h2 {
  font-size: 1.1em;
}

.chat-md-h3 {
  font-size: 1.05em;
}

.chat-md-h4,
.chat-md-h5,
.chat-md-h6 {
  font-size: 1em;
}

.chat-md-h + p,
.chat-md-h + ul,
.chat-md-h + .chat-md-table-wrap {
  margin-top: 4px;
}

.chat-md-table-wrap {
  margin: 6px 0;
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.chat-md-table-wrap:last-child {
  margin-bottom: 0;
}

.chat-md-table {
  width: 100%;
  min-width: max-content;
  border-collapse: collapse;
  font-size: 0.92em;
  line-height: 1.45;
}

.chat-md-table th,
.chat-md-table td {
  padding: 6px 8px;
  border: 1px solid rgba(15, 23, 42, 0.12);
  text-align: start;
  vertical-align: top;
}

.chat-md-table th {
  font-weight: var(--font-weight-semibold);
  background: rgba(15, 23, 42, 0.04);
}

.chat-widget__bubble--user .chat-md-table th,
.chat-widget__bubble--user .chat-md-table td {
  border-color: rgba(255, 255, 255, 0.28);
}

.chat-widget__bubble--user .chat-md-table th {
  background: rgba(255, 255, 255, 0.12);
}

.chat-widget--dark .chat-widget__bubble--assistant .chat-md-table th,
.chat-widget--dark .chat-widget__bubble--assistant .chat-md-table td {
  border-color: rgba(226, 232, 240, 0.18);
}

.chat-widget--dark .chat-widget__bubble--assistant .chat-md-table th {
  background: rgba(255, 255, 255, 0.06);
}

.chats-msg--user .chat-md-table th,
.chats-msg--user .chat-md-table td {
  border-color: rgba(255, 255, 255, 0.28);
}

.chats-msg--user .chat-md-table th {
  background: rgba(255, 255, 255, 0.12);
}

.chat-widget__bubble--user .chat-md-link {
  color: #fff;
  text-decoration: underline;
}

.chat-widget__bubble--user .chat-md-link:hover {
  color: #fff;
  opacity: 0.9;
}

.chat-widget--dark .chat-widget__bubble--assistant .chat-md-link {
  color: #93c5fd;
}

.chat-widget--dark .chat-widget__bubble--assistant .chat-md-link:hover {
  color: #bfdbfe;
}

.chats-msg--user .chat-md-link {
  color: #fff;
  text-decoration: underline;
}

.chats-msg--user .chat-md-link:hover {
  color: #fff;
  opacity: 0.9;
}

.chats-msg--assistant .chat-md-link,
.chats-msg--human_agent .chat-md-link {
  color: var(--color-primary, #2563eb);
}

.chats-msg--assistant .chat-md-link:hover,
.chats-msg--human_agent .chat-md-link:hover {
  color: color-mix(in srgb, var(--color-primary, #2563eb) 82%, #000);
}

/* ── Subscription / credits ─────────────────────────────────── */
.dash-shell__credits {
  margin-top: auto;
}

.legal-footer-links {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  font-size: 12px;
  color: #71717a;
}

.legal-footer-links a {
  color: inherit;
  text-decoration: none;
}

.legal-footer-links a:hover {
  color: #3f3f46;
  text-decoration: underline;
}

.legal-footer-links__sep {
  user-select: none;
}

.legal-footer-links--auth {
  margin-top: 16px;
}

.credits-bar {
  display: flex;
  flex-direction: column;
  gap: 8px;
  border: 1px solid var(--color-border-subtle);
  border-radius: 10px;
  padding: 12px 14px;
  background: var(--color-white);
  text-decoration: none;
  color: inherit;
}

.credits-bar--compact:hover {
  border-color: var(--color-border);
}

.credits-bar__stats-link {
  display: flex;
  flex-direction: column;
  gap: 8px;
  text-decoration: none;
  color: inherit;
}

.credits-bar__upgrade-btn {
  width: 100%;
  margin-top: 2px;
  padding: 7px 10px;
  border-radius: 8px;
  font-size: 12px;
}

.credits-bar__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
}

.credits-bar__label {
  color: var(--color-text-secondary);
}

.credits-bar__count {
  font-weight: var(--font-weight-semibold);
}

.credits-bar__track {
  height: 6px;
  border-radius: 999px;
  background: var(--color-surface-muted, #eef0f3);
  overflow: hidden;
}

.credits-bar__fill {
  height: 100%;
  border-radius: 999px;
  background: var(--color-primary, #2563eb);
  transition: width 0.2s ease;
}

.credits-bar__fill--warn {
  background: #f59e0b;
}

.credits-bar__hint {
  margin: 0;
}

.subscription-page {
  width: 100%;
}

.subscription-page__header h1,
.subscription-page__header p {
  /* legacy — use DashboardPageHeader */
}

.subscription-page__usage {
  display: flex;
  flex-direction: column;
  gap: 16px;
  border: none;
  border-radius: var(--radius-card);
  padding: 20px;
  background: var(--card);
  box-shadow: 0 0 0 1px var(--border);
}

.subscription-page__usage-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.subscription-page__usage-head h2 {
  margin: 4px 0 0;
  font-size: 1.15rem;
}

.subscription-page__expiry {
  margin: 6px 0 0;
}

.subscription-page__cta {
  display: inline-flex;
  align-items: center;
  padding: 8px 14px;
  border-radius: var(--radius-button);
  border: 1px solid var(--primary);
  background: var(--primary);
  color: var(--primary-foreground);
  font-size: 13px;
  font-weight: var(--font-weight-medium);
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 0.14s ease, border-color 0.14s ease;
}

.subscription-page__cta:hover:not(:disabled) {
  background: var(--primary-hover);
  border-color: var(--primary-hover);
}

.subscription-page__cta:disabled {
  opacity: 0.7;
  cursor: default;
}

.subscription-page__plans-head {
  margin: 0 0 14px;
}

.subscription-page__plans h2 {
  margin: 0 0 6px;
  font-size: 1.05rem;
}

.subscription-page__plans-head p {
  margin: 0;
}

.plan-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 14px;
}

.plan-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  border: 1px solid var(--color-border-subtle);
  border-radius: 10px;
  padding: 18px 16px;
  background: var(--color-white);
}

.plan-card--current {
  border-color: var(--color-primary, #2563eb);
  box-shadow: 0 0 0 1px var(--color-primary, #2563eb);
}

.plan-card--recommended:not(.plan-card--current) {
  border-color: var(--color-primary, #2563eb);
  background: color-mix(in srgb, var(--color-primary, #2563eb) 4%, white);
}

.plan-card__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.plan-card__head h3 {
  margin: 0;
  font-size: 1.05rem;
}

.plan-card__badges {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  justify-content: flex-end;
}

.plan-card__badge {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 6px;
  background: rgba(37, 99, 235, 0.1);
  color: var(--color-primary, #2563eb);
  white-space: nowrap;
}

.plan-card__badge--rec {
  background: rgba(16, 185, 129, 0.12);
  color: #047857;
}

.plan-card__price {
  margin: 0;
  display: flex;
  align-items: baseline;
  gap: 4px;
  flex-wrap: wrap;
}

.plan-card__price-value {
  font-size: 1.15rem;
  font-weight: var(--font-weight-semibold, 600);
}

.plan-card__price-period {
  font-size: 12px;
}

.plan-card__features {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}

.plan-card__features li {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-size: 13px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--color-border-subtle);
}

.plan-card__features li:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.plan-card__feature-label {
  color: var(--color-text-secondary);
}

.plan-card__feature-value {
  font-weight: var(--font-weight-semibold, 600);
  text-align: left;
}

.plan-card__btn {
  display: block;
  text-align: center;
  margin-top: auto;
  padding: 9px 12px;
  border-radius: 8px;
  border: 1px solid var(--color-border-subtle);
  background: var(--color-white);
  color: inherit;
  font-size: 13px;
  text-decoration: none;
  cursor: pointer;
}

.plan-card__btn:hover:not(:disabled) {
  background: var(--color-surface-muted, #f3f4f6);
}

.plan-card__btn--primary {
  background: var(--color-primary, #2563eb);
  border-color: var(--color-primary, #2563eb);
  color: #fff;
}

.plan-card__btn--primary:hover:not(:disabled) {
  filter: brightness(1.05);
  background: var(--color-primary, #2563eb);
}

.plan-card__btn--muted {
  opacity: 0.6;
  cursor: default;
}

.subscription-page__contact {
  margin: 14px 0 0;
}

.subscription-page__contact a {
  color: var(--color-primary, #2563eb);
  text-decoration: none;
}

.subscription-page__banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 8px;
  margin: 0 0 16px;
  font-size: 14px;
}

.subscription-page__banner--ok {
  background: #ecfdf5;
  color: #065f46;
}

.subscription-page__banner--err {
  background: #fef2f2;
  color: #991b1b;
}

.subscription-page__banner-dismiss {
  border: 0;
  background: transparent;
  cursor: pointer;
  color: inherit;
  font-size: 12px;
}

/* ── Tools page ─────────────────────────────────────────────── */
.tools-page {
  padding: 8px 4px 24px;
}

.tools-page__loading {
  padding: 24px;
}

.tools-page__header {
  /* padding handled by page layout */
}

.tools-page__title,
.tools-page__subtitle {
  /* legacy aliases — use DashboardPageHeader */
}

.tools-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.tool-card {
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-card);
  background: var(--color-white);
  padding: 18px;
  min-height: 200px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 14px;
}

.tool-card__body {
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex: 1;
  min-height: 0;
}

.tool-card__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.tool-card__title-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.tool-card__icon {
  width: 55px;
  height: 55px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: #fff;
}

.tool-card__icon--products {
  background: #2563eb;
}

.tool-card__icon--orders {
  background: #475569;
}

.tool-card__icon--wordpress {
  background: #2563eb;
}

.tool-card__icon--embed {
  background: #059669;
}

.tool-card__icon--chat {
  background: #0f172a;
}

.tool-card__icon--leads {
  background: #0891b2;
}

.tool-card__icon--escalate {
  background: #dc2626;
}

.tool-card__icon--calendar {
  background: #16a34a;
}

.tool-card__icon--payment {
  background: #2563eb;
}

.tool-card__icon--instagram {
  background: #db2777;
}

.tool-card__icon--whatsapp {
  background: #16a34a;
}

.tool-card--connected {
  border-color: color-mix(in srgb, #10b981 55%, var(--color-border-subtle));
}

.tool-card--soon {
  opacity: 0.72;
}

.tool-card__link {
  color: var(--color-primary, #2563eb);
  text-decoration: none;
}

.tool-card__link:hover {
  text-decoration: underline;
}

.tool-card__cta {
  align-self: flex-start;
  margin-top: 4px;
}

.agent-home__chip {
  border: 1px solid var(--color-border-subtle);
  background: var(--color-white);
  color: var(--color-text-primary);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 0.8125rem;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.agent-home__chip:hover:not(:disabled) {
  border-color: color-mix(in srgb, var(--color-primary, #2563eb) 40%, var(--color-border-subtle));
  background: color-mix(in srgb, var(--color-primary, #2563eb) 5%, white);
}

.agent-home__chip:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.tool-card__soon-pill {
  font-size: 12px;
  font-weight: 600;
  padding: 4px 8px;
  border-radius: 999px;
  background: #f4f4f5;
  color: var(--color-text-secondary);
  white-space: nowrap;
}

.actions-page__header-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}

.actions-page__section-title {
  margin: 20px 0 12px;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--color-text-secondary);
}

.actions-page__hint {
  margin: 0 0 12px;
}

.leads-table-wrap {
  overflow-x: auto;
  padding: 0;
}

.leads-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.leads-table th,
.leads-table td {
  text-align: right;
  padding: 12px 14px;
  border-bottom: 1px solid var(--color-border-subtle);
}

.leads-table th {
  font-weight: 600;
  color: var(--color-text-secondary);
}

.chats-thread__header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.chats-inbox__badge {
  display: inline-block;
  margin-top: 4px;
  font-size: 0.7rem;
  font-weight: 600;
  color: #b91c1c;
}

.integrations-hub__grid {
  margin-bottom: 8px;
}

.tool-card__title {
  margin: 0;
  font-size: 16px;
  font-weight: var(--font-weight-medium);
  line-height: 1.4;
}

.tool-card__desc {
  margin: 0;
  font-size: 13px;
  line-height: 1.6;
  color: var(--color-text-secondary);
}

.tool-card__hint {
  margin: 8px 0 0;
  font-size: 12px;
  line-height: 1.5;
}

.tool-card__label {
  display: inline-flex;
  align-self: flex-start;
  padding: 5px 10px;
  border-radius: 999px;
  background: #f4f4f5;
  color: var(--color-text-secondary);
  font-size: 12px;
  line-height: 1.4;
}

.integrations-calendar-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 12px;
}

.integrations-calendar-form__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 13px;
  color: var(--color-text-secondary);
}

.integrations-calendar-form__row input {
  width: 88px;
  padding: 6px 8px;
  border: 1px solid #e4e4e7;
  border-radius: 8px;
  background: #fff;
  font-size: 13px;
  text-align: center;
}

.integrations-calendar-form__note {
  margin: 0;
  font-size: 12px;
  line-height: 1.5;
}

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

.integrations-appointments__item {
  padding: 12px 14px;
  border: 1px solid #e4e4e7;
  border-radius: 10px;
  background: #fff;
}

@media (max-width: 1024px) {
  .tools-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .tools-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* ── Deploy page ────────────────────────────────────────────── */
.deploy-page {
  padding: 8px 4px 24px;
}

.deploy-page__loading {
  padding: 24px;
}

.deploy-page__header {
  /* use DashboardPageHeader */
}

.deploy-page__title,
.deploy-page__subtitle {
  /* legacy aliases — use DashboardPageHeader */
}

.deploy-page__toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  max-width: 360px;
  margin-bottom: 16px;
  padding: 12px 14px;
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-card);
  background: var(--color-white);
  font-size: 14px;
}

.deploy-method-card {
  width: 100%;
  font: inherit;
  color: inherit;
  text-align: inherit;
  cursor: pointer;
  appearance: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.deploy-method-card:hover {
  border-color: var(--color-primary, #2563eb);
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.08);
}

.deploy-detail {
  max-width: 800px;
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-card);
  padding: 20px;
}

.deploy-detail__back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  padding: 0;
  border: none;
  background: none;
  color: var(--color-text-secondary);
  font-size: 13px;
  cursor: pointer;
}

.deploy-detail__back:hover {
  color: var(--color-primary, #2563eb);
}

.deploy-detail__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

.deploy-detail__header-main {
  min-width: 0;
}

.deploy-detail__title {
  margin: 0 0 6px;
  font-size: 1.25rem;
  font-weight: var(--font-weight-bold);
}

.deploy-detail__subtitle {
  margin: 0;
}

.deploy-detail__panel {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.deploy-detail__intro {
  margin: 0;
}

.deploy-detail__field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.deploy-detail__label {
  font-size: 13px;
  font-weight: var(--font-weight-medium);
}

.deploy-detail__copy-row {
  display: flex;
  gap: 8px;
  align-items: flex-start;
}

.deploy-detail__copy-row input,
.deploy-detail__copy-row textarea {
  flex: 1;
  min-width: 0;
}

.deploy-code-block {
  overflow: hidden;
  border: 1px solid #d0d7de;
  border-radius: 10px;
  background: #ffffff;
}

.deploy-code-block__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 10px;
  border-bottom: 1px solid #d0d7de;
  background: #f6f8fa;
}

.deploy-code-block__label {
  color: #57606a;
  font-family: ui-monospace, SFMono-Regular, SFMono-Regular, Consolas, "Liberation Mono", Menlo, monospace;
  font-size: 12px;
  line-height: 1.4;
}

.deploy-code-block__copy {
  padding: 5px 10px;
  border-color: #d0d7de;
  background: #ffffff;
  color: #24292f;
  font-size: 12px;
}

.deploy-code-block__copy:hover:not(:disabled) {
  background: #f3f4f6;
  border-color: #afb8c1;
  color: #24292f;
}

.deploy-code-block__pre {
  max-height: 260px;
  margin: 0;
  padding: 14px 16px;
  overflow: auto;
  background: #ffffff;
  color: #24292f;
  font-family: ui-monospace, SFMono-Regular, SFMono-Regular, Consolas, "Liberation Mono", Menlo, monospace;
  font-size: 12px;
  line-height: 1.7;
  white-space: pre-wrap;
  word-break: break-word;
}

.deploy-detail__link {
  color: var(--color-primary, #2563eb);
  text-decoration: none;
}

.deploy-detail__link:hover {
  text-decoration: underline;
}

@media (max-width: 640px) {
  .deploy-page__toggle {
    max-width: none;
  }

  .deploy-detail__copy-row {
    flex-direction: column;
  }
}

/* ── Website crawled pages list ─────────────────────────────────────────── */
.website-pages-toggle {
  color: var(--color-text);
  text-decoration: none;
}
.website-pages-toggle:hover .small {
  text-decoration: underline;
}

/* Live crawl progress indicator */
.website-crawl-status--processing {
  border: 1px solid #fcd34d;
  background: #fffbeb;
  color: #92400e;
}

.website-crawl-live {
  padding: 4px 0;
}
.website-crawl-live--subtle {
  padding: 2px 0;
  font-size: 0.8125rem;
}
.website-crawl-live--subtle .website-crawl-live__dot {
  width: 6px;
  height: 6px;
}
.website-crawl-live__dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--color-info, #3b82f6);
  flex-shrink: 0;
  animation: crawl-pulse 1.4s ease-in-out infinite;
}
@keyframes crawl-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%       { opacity: 0.4; transform: scale(0.75); }
}

.crawl-progress-panel {
  margin-bottom: 16px;
}
.crawl-progress-panel__header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  flex-wrap: wrap;
}
/* Legacy crawl row helpers — do not fight Chatbase .cb-links-tree-row grid */
.crawl-progress-folder__row,
.crawl-progress-page__main {
  /* unused with TreeRow */
}
.crawl-progress-folder__path,
.crawl-progress-page__path {
  flex: 1;
  min-width: 0;
  word-break: break-all;
  font-size: 0.85rem;
}
.crawl-progress-folder__meta {
  white-space: nowrap;
}
.crawl-progress-page {
  /* unused with TreeRow — keep inert */
}
.crawl-progress-folder {
  margin-bottom: 0;
}
.crawl-progress-folder__children {
  margin-top: 0;
}
.url-sources-blocked-notice {
  color: var(--color-warning, #b45309);
}

.knowledge-list-item--clickable {
  cursor: pointer;
}
.knowledge-list-item--clickable:hover {
  background: color-mix(in srgb, var(--color-border, #e5e7eb) 35%, transparent);
}

.knowledge-tip-alert {
  margin-top: 0.75rem;
}

.knowledge-dropzone {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  min-height: 140px;
  padding: 1.5rem 1rem;
  border: 1.5px dashed var(--color-border, #d1d5db);
  border-radius: 12px;
  background: color-mix(in srgb, var(--color-surface-subtle, #f9fafb) 80%, transparent);
  color: var(--color-text-muted, #6b7280);
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
  text-align: center;
}
.knowledge-dropzone:hover:not(:disabled),
.knowledge-dropzone--active {
  border-color: var(--color-primary, #2563eb);
  background: color-mix(in srgb, var(--color-primary, #2563eb) 6%, transparent);
  color: var(--color-foreground, #111);
}
.knowledge-dropzone:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}
.knowledge-dropzone__icon {
  width: 28px;
  height: 28px;
  opacity: 0.7;
}
.knowledge-dropzone__title {
  font-size: 0.9375rem;
  font-weight: var(--font-weight-medium, 500);
  color: var(--color-foreground, #111);
}
.knowledge-dropzone__hint {
  font-size: 0.8125rem;
}

.knowledge-form__label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.35rem;
}
.knowledge-form__label-row label {
  margin-bottom: 0;
}
.knowledge-form__expand-btn {
  gap: 0.35rem;
  height: auto;
  min-height: 0;
  padding-inline: 0.5rem;
  font-size: 0.75rem;
}
.knowledge-form__textarea--expanded {
  min-height: 16rem;
}

.source-preview-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.75rem;
  margin-bottom: 0.75rem;
  font-size: 0.8125rem;
  color: var(--color-text-muted, #6b7280);
}
.source-preview-body {
  margin: 0;
  max-height: min(50vh, 420px);
  overflow: auto;
  padding: 0.875rem 1rem;
  border: 1px solid var(--color-border-subtle, #e5e7eb);
  border-radius: 10px;
  background: var(--color-surface-subtle, #f9fafb);
  font-family: inherit;
  font-size: 0.875rem;
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
}

.url-sources-mode-help {
  margin-top: 0.35rem;
}

.sources-training-card {
  margin-top: 0;
  border-radius: 10px;
  padding: 14px 16px;
}
.products-empty-state {
  border: 1.5px dashed var(--color-border, #d1d5db);
  border-radius: 12px;
  padding: 3rem 1.5rem;
}

.fetched-links-dialog__body {
  /* layout owned by .fetched-links-dialog--chatbase block below */
  min-height: 0;
}
.crawl-progress-panel--embedded {
  /* layout owned by Chatbase chrome block below */
}

/* Mid-file crawl chrome superseded by Chatbase tree styles further below */
.crawl-progress-root,
.crawl-progress-toolbar,
.crawl-progress-tabs,
.crawl-progress-tree {
  /* no-op placeholders — real rules live in Chatbase section */
}

/* --- Chatbase Website / Fetched links chrome (visual only) --- */
.cb-links-add-card__title {
  margin: 0 0 0.75rem;
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--color-fg, #111827);
}

.cb-links-tabs {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  gap: 0;
  column-gap: 1.5rem;
  border-bottom: 1px solid var(--color-border, #e5e7eb);
  margin: 0 0 1rem;
  width: 100%;
}
.cb-links-tabs__tab {
  appearance: none !important;
  -webkit-appearance: none !important;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent !important;
  border: none !important;
  border-bottom: 2px solid transparent !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  padding: 0.625rem 0.125rem !important;
  margin: 0 0 -1px !important;
  min-height: 2.5rem;
  cursor: pointer;
  font: inherit;
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1.25;
  color: var(--color-muted, #6b7280);
  white-space: nowrap;
  text-decoration: none;
}
.cb-links-tabs__tab:hover:not(:disabled) {
  color: var(--color-fg, #111827);
}
.cb-links-tabs__tab.is-active {
  color: var(--color-fg, #111827) !important;
  font-weight: 600;
  border-bottom-color: var(--color-fg, #111827) !important;
}
.cb-links-tabs__tab:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}
.cb-links-tabs__tab.is-active:disabled {
  opacity: 1;
  color: var(--color-fg, #111827) !important;
  border-bottom-color: var(--color-fg, #111827) !important;
}

.cb-links-url-compound {
  display: flex;
  align-items: stretch;
  border: 1px solid var(--color-border, #e5e7eb);
  border-radius: var(--radius, 8px);
  overflow: hidden;
  background: var(--color-surface, #fff);
}
.cb-links-url-compound__prefix {
  display: flex;
  align-items: center;
  padding: 0 0.75rem;
  font-size: 0.8125rem;
  color: var(--color-muted, #6b7280);
  background: var(--color-surface-subtle, #f9fafb);
  border-inline-end: 1px solid var(--color-border, #e5e7eb);
  white-space: nowrap;
  direction: ltr;
}
.cb-links-url-compound input,
.cb-links-url-compound [data-slot="input"] {
  border: none !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  flex: 1;
  min-width: 0;
  height: 2.5rem;
}

.cb-links-info {
  display: flex;
  gap: 0.5rem;
  align-items: flex-start;
  padding: 0.75rem 0.875rem;
  margin-top: 0.625rem;
  border-radius: var(--radius, 8px);
  background: var(--color-surface-subtle, #f3f4f6);
  color: var(--color-muted, #6b7280);
  font-size: 0.8125rem;
  line-height: 1.5;
}
.cb-links-info__icon {
  flex-shrink: 0;
  margin-top: 0.1rem;
  opacity: 0.85;
}

.cb-links-add-form__actions,
.cb-links-add__actions,
.cb-links-advanced__actions {
  display: flex;
  justify-content: flex-start;
  margin-top: 0.875rem;
}
.cb-links-add-form__actions [data-slot="button"],
.cb-links-add__actions [data-slot="button"],
.cb-links-advanced__actions [data-slot="button"] {
  min-width: 7.5rem;
}

.cb-links-advanced {
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--color-border, #e5e7eb);
}
.cb-links-advanced__toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  appearance: none;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  font: inherit;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--color-fg, #111827);
}
.cb-links-advanced__fields {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: 0.75rem;
}

.cb-links-path-field {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
}
.cb-links-path-field__hint {
  line-height: 1.45;
}
.cb-links-path-chips {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.375rem;
  min-height: 2.5rem;
  padding: 0.375rem 0.5rem;
  border: 1px solid var(--color-border, #e5e7eb);
  border-radius: var(--radius, 8px);
  background: var(--color-surface, #fff);
}
.cb-links-path-chips.is-disabled {
  opacity: 0.55;
  pointer-events: none;
}
.cb-links-path-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.15rem 0.35rem 0.15rem 0.5rem;
  border-radius: 999px;
  background: var(--color-surface-subtle, #f3f4f6);
  font-size: 0.75rem;
  color: var(--color-fg, #111827);
}
.cb-links-path-chip__remove {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  appearance: none;
  border: none;
  background: transparent;
  padding: 0;
  cursor: pointer;
  color: var(--color-muted, #6b7280);
  border-radius: 999px;
}
.cb-links-path-chip__remove:hover {
  color: var(--color-fg, #111827);
}
.cb-links-path-chips__input,
.cb-links-path-chips [data-slot="input"] {
  flex: 1;
  min-width: 7rem;
  height: 1.75rem !important;
  border: none !important;
  box-shadow: none !important;
  background: transparent !important;
  padding-inline: 0.25rem !important;
}

.cb-links-tree-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  column-gap: 0.5rem;
  min-height: 2.5rem;
  padding-block: 0.375rem;
  padding-inline-end: 0.75rem;
  padding-inline-start: calc(0.75rem + (var(--cb-tree-depth, 0) * 1.25rem));
  border-bottom: 1px solid #eee;
  background: #fff;
}
.cb-links-tree-row:hover {
  background: #fafafa;
}
.cb-links-tree-row.is-selected .cb-links-tree-row__path {
  font-weight: 600;
}
.cb-links-tree-row__lead {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  flex-shrink: 0;
}
.cb-links-tree-row__path {
  min-width: 0;
  font-size: 0.875rem;
  line-height: 1.35;
  color: #111827;
  word-break: break-all;
}
.cb-links-tree-row__path--root {
  font-weight: 600;
}
.cb-links-tree-row__meta {
  justify-self: end;
  flex-shrink: 0;
  white-space: nowrap;
  font-size: 0.75rem;
  line-height: 1.3;
  color: #6b7280;
  text-align: end;
}
.cb-links-tree-row__chevron {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.5rem;
  height: 1.5rem;
  padding: 0;
  margin: 0;
  border: none;
  border-radius: 4px;
  background: transparent;
  color: #6b7280;
  cursor: pointer;
  flex-shrink: 0;
}
.cb-links-tree-row__chevron:hover {
  background: #f3f4f6;
  color: #111827;
}
.cb-links-tree-row__chevron-spacer {
  display: inline-block;
  width: 1.5rem;
  height: 1.5rem;
  flex-shrink: 0;
}

.fetched-links-dialog--chatbase {
  padding: 0 !important;
  gap: 0 !important;
  border-radius: 12px !important;
  overflow: hidden !important;
}
.fetched-links-dialog__header {
  text-align: start;
  padding: 1.25rem 1.25rem 0;
  gap: 0.25rem !important;
}
.fetched-links-dialog__title {
  font-size: 1.125rem !important;
  font-weight: 700 !important;
  line-height: 1.3 !important;
  color: #111827 !important;
}
.fetched-links-dialog__subtitle {
  margin: 0.25rem 0 0 !important;
  font-size: 0.875rem !important;
  color: #6b7280 !important;
}
.fetched-links-dialog__primary-tabs {
  display: flex;
  align-items: stretch;
  gap: 1.5rem;
  border-bottom: 1px solid #e5e7eb;
  margin: 0.875rem 0 0;
  width: 100%;
}
.fetched-links-dialog__primary-tab {
  appearance: none !important;
  background: none !important;
  border: none !important;
  border-bottom: 2px solid transparent !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  margin: 0 0 -1px !important;
  padding: 0.625rem 0.125rem !important;
  font: inherit;
  font-size: 0.875rem;
  font-weight: 500;
  color: #6b7280;
  cursor: pointer;
  white-space: nowrap;
}
.fetched-links-dialog__primary-tab:hover {
  color: #111827;
}
.fetched-links-dialog__primary-tab.is-active {
  color: #111827 !important;
  font-weight: 600;
  border-bottom-color: #111827 !important;
}
.fetched-links-dialog__body {
  overflow: hidden;
  min-height: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 0.875rem 1.25rem;
}
.fetched-links-dialog__panel {
  display: flex;
  flex-direction: column;
  min-height: 0;
  flex: 1;
}
.fetched-links-dialog__panel[hidden] {
  display: none !important;
}
.fetched-links-dialog__advanced {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.fetched-links-dialog__advanced-note {
  margin: 0;
  font-size: 0.8125rem;
  color: #6b7280;
  line-height: 1.5;
}
.fetched-links-dialog__well {
  display: flex;
  flex-direction: column;
  min-height: 0;
  flex: 1;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  overflow: hidden;
  background: #fff;
}
.crawl-progress-root {
  border-bottom: 1px solid #e5e7eb;
}
.crawl-progress-root .cb-links-tree-row {
  border-bottom: none;
  min-height: 2.75rem;
}
.crawl-progress-toolbar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.625rem 0.75rem;
  border-bottom: 1px solid #e5e7eb;
}
.crawl-progress-toolbar__search {
  flex: 1;
  min-width: 0;
}
.crawl-progress-toolbar__sort {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  padding: 0;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #fff;
  color: #6b7280;
  cursor: pointer;
  flex-shrink: 0;
}
.crawl-progress-toolbar__sort:hover {
  background: #f9fafb;
  color: #111827;
}
.crawl-progress-tabs {
  display: flex;
  gap: 1.25rem;
  padding: 0 0.75rem;
  border-bottom: 1px solid #e5e7eb;
  overflow-x: auto;
}
.crawl-progress-tabs__tab {
  appearance: none !important;
  background: none !important;
  border: none !important;
  border-bottom: 2px solid transparent !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  margin: 0 0 -1px !important;
  padding: 0.625rem 0.1rem !important;
  font: inherit;
  font-size: 0.875rem;
  font-weight: 500;
  color: #6b7280;
  cursor: pointer;
  white-space: nowrap;
}
.crawl-progress-tabs__tab:hover {
  color: #111827;
}
.crawl-progress-tabs__tab.is-active {
  color: #111827 !important;
  font-weight: 600;
  border-bottom-color: #111827 !important;
}
.crawl-progress-tree-scroll {
  flex: 1;
  min-height: 12rem;
  max-height: min(42vh, 380px);
  overflow: auto;
  scrollbar-width: thin;
  scrollbar-color: #d1d5db transparent;
}
.crawl-progress-tree-scroll::-webkit-scrollbar {
  width: 6px;
}
.crawl-progress-tree-scroll::-webkit-scrollbar-thumb {
  background: #d1d5db;
  border-radius: 999px;
}
.crawl-progress-tree-scroll::-webkit-scrollbar-track {
  background: transparent;
}
.crawl-progress-tree,
.crawl-progress-folder,
.crawl-progress-page {
  list-style: none;
  margin: 0;
  padding: 0;
}
.crawl-progress-panel--embedded {
  margin: 0;
  padding: 0;
  border: none;
  box-shadow: none;
  background: transparent;
  display: flex;
  flex-direction: column;
  min-height: 0;
  flex: 1;
  gap: 0.5rem;
}
.crawl-progress-panel__live {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.crawl-progress-panel--embedded .fetched-links-dialog__well {
  flex: 1;
  min-height: 0;
}

.fetched-links-dialog__footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1rem;
  padding: 0.875rem 1.25rem;
  border-top: 1px solid #e5e7eb;
  background: #fff;
}
.fetched-links-dialog__footer-meta {
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
  min-width: 0;
}
.fetched-links-dialog__footer-count {
  margin: 0;
  font-size: 0.875rem;
  font-weight: 600;
  color: #111827;
}
.fetched-links-dialog__footer-breakdown {
  margin: 0;
  font-size: 0.75rem;
  color: #6b7280;
}
.fetched-links-dialog__footer-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}
.fetched-links-dialog__btn {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.25rem;
  padding: 0.5rem 0.875rem;
  border-radius: 8px;
  font: inherit;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.12s, border-color 0.12s, opacity 0.12s;
}
.fetched-links-dialog__btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.fetched-links-dialog__btn--ghost {
  border: 1px solid #e5e7eb;
  background: #fff;
  color: #111827;
}
.fetched-links-dialog__btn--ghost:hover:not(:disabled) {
  background: #f9fafb;
}
.fetched-links-dialog__btn--exclude {
  border: 1px solid #dc2626;
  background: #dc2626;
  color: #fff;
}
.fetched-links-dialog__btn--exclude:hover:not(:disabled) {
  background: #b91c1c;
  border-color: #b91c1c;
}

.website-pages-list {
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  overflow: hidden;
}

.website-page-row {
  border-bottom: 1px solid var(--color-border);
}
.website-page-row:last-child {
  border-bottom: none;
}

.website-page-row__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  padding: 8px 12px;
  background: none;
  border: none;
  cursor: pointer;
  text-align: right;
  transition: background 0.1s;
}
.website-page-row__header:hover {
  background: var(--color-surface-hover, rgba(0,0,0,.03));
}

.website-page-row__meta {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  min-width: 0;
  flex: 1;
}

.website-page-row__url {
  font-size: 12px;
  color: var(--color-primary, #3B81F6);
  word-break: break-all;
  line-height: 1.4;
}

.website-page-row__title {
  font-size: 11px;
  color: var(--color-muted-text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
}

.website-page-row__right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.website-page-row__link {
  color: var(--color-muted-text);
  line-height: 1;
  display: flex;
  align-items: center;
}
.website-page-row__link:hover {
  color: var(--color-primary, #3B81F6);
}

.website-page-row__content {
  padding: 10px 14px 14px;
  margin: 0;
  border-top: 1px solid var(--color-border);
  background: var(--color-surface-subtle, rgba(0,0,0,.02));
  font-family: inherit;
  font-size: 12px;
  line-height: 1.7;
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 420px;
  overflow-y: auto;
}

.website-pages-pagination {
  padding: 8px 12px;
  border-top: 1px solid var(--color-border);
}

/* ── Global responsive polish ───────────────────────────────────────────── */
@media (max-width: 1023px) {
  .dashboard-page-header {
    margin-bottom: 20px;
    gap: 8px;
  }

  .dashboard-page-header--default {
    margin-bottom: 14px;
  }

  .playground-preview__frame {
    width: min(100%, calc(100% - 16px));
    height: min(749px, 75vh);
  }

  .shop-connect-flow {
    max-width: none;
  }

  .deploy-detail {
    padding: 16px;
  }

  .deploy-detail__header {
    flex-direction: column;
    align-items: stretch;
  }

  .subscription-page__usage {
    padding: 16px;
  }

  .plan-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .chats-inbox__header {
    padding: 12px;
  }

  .leads-table th,
  .leads-table td {
    padding: 10px 12px;
    font-size: 0.8125rem;
  }

  .leads-table {
    min-width: 520px;
  }

  .auth-page {
    padding: 16px 12px;
    justify-content: flex-start;
    padding-top: 28px;
  }

  .auth-brand__logo {
    width: 110px;
    max-width: 110px;
  }
}

@media (max-width: 960px) {
  .chats-page--improve .chats-workspace {
    grid-template-columns: 1fr;
  }

  .chats-page--improve.chats-page--has-thread .chats-inbox {
    display: none;
  }

  .chats-page--improve.chats-page--has-thread .chats-thread {
    display: none;
  }

  .chats-page--improve .improve-answer-panel {
    min-height: 0;
    height: 100%;
    max-height: none;
    border-right: none;
    border-top: none;
  }
}
