.vf-smart-ai-shell {
  position: relative;
}

.vf-smart-ai-shell--compact {
  padding: 0;
}

.vf-smart-ai-header {
  align-items: flex-start;
}

.vf-smart-ai-bar {
  border: 1px solid rgba(148, 163, 184, 0.16);
  background:
    linear-gradient(180deg, rgba(24, 34, 53, 0.98) 0%, rgba(18, 28, 44, 0.97) 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.04),
    0 18px 36px -30px rgba(15, 23, 42, 0.42);
}

.vf-smart-ai-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  align-items: center;
}

.vf-smart-ai-control {
  min-width: 0;
  border: 1px solid rgba(148, 163, 184, 0.18);
  background: rgba(51, 65, 85, 0.56);
  color: rgba(248, 250, 252, 0.96);
  border-radius: 999px;
  padding: 0.62rem 0.9rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  outline: none;
  transition: border-color 180ms ease, background-color 180ms ease;
}

.vf-smart-ai-control:focus {
  border-color: rgba(var(--vf-brand-100-rgb), 0.65);
}

.vf-smart-ai-control option {
  color: #0f172a;
}

.vf-smart-ai-entry {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 0.7rem;
  align-items: end;
  margin-top: 0.8rem;
}

.vf-smart-ai-textarea {
  min-height: 3.65rem;
  width: 100%;
  resize: none;
  border: 1px solid rgba(148, 163, 184, 0.16);
  background: rgba(41, 51, 71, 0.82);
  color: rgba(255, 255, 255, 0.95);
  border-radius: 1.45rem;
  padding: 0.88rem 1rem;
  font-size: 0.98rem;
  line-height: 1.55;
  outline: none;
  transition: border-color 180ms ease, background-color 180ms ease, box-shadow 180ms ease;
}

.vf-smart-ai-textarea::placeholder {
  color: rgba(226, 232, 240, 0.68);
}

.vf-smart-ai-textarea:focus {
  border-color: rgba(var(--vf-brand-100-rgb), 0.62);
  box-shadow: 0 0 0 4px rgba(var(--vf-brand-100-rgb), 0.08);
}

.vf-smart-ai-icon-button,
.vf-smart-ai-send,
.vf-smart-ai-example,
.vf-smart-ai-chip,
.vf-smart-ai-mode-badge {
  transition:
    transform 180ms ease,
    background-color 180ms ease,
    border-color 180ms ease,
    color 180ms ease,
    box-shadow 180ms ease;
}

.vf-smart-ai-icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.8rem;
  height: 2.8rem;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  background: rgba(51, 65, 85, 0.56);
  color: rgba(255, 255, 255, 0.92);
}

.vf-smart-ai-icon-button:hover,
.vf-smart-ai-icon-button:focus-visible {
  border-color: rgba(var(--vf-brand-100-rgb), 0.55);
  background: rgba(65, 86, 42, 0.75);
}

.vf-smart-ai-send {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  min-width: 7.9rem;
  min-height: 3rem;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--vf-brand-600) 0%, var(--vf-brand-500) 100%);
  color: #fff;
  font-size: 0.95rem;
  font-weight: 700;
  padding: 0.82rem 1.15rem;
  box-shadow: 0 12px 24px -20px rgba(var(--vf-brand-700-rgb), 0.8);
}

.vf-smart-ai-send:hover,
.vf-smart-ai-send:focus-visible {
  transform: translateY(-1px);
  box-shadow: 0 20px 32px -24px rgba(var(--vf-brand-700-rgb), 0.9);
}

.vf-smart-ai-send:disabled,
.vf-smart-ai-icon-button:disabled {
  opacity: 0.65;
  cursor: not-allowed;
  transform: none;
}

.vf-smart-ai-example,
.vf-smart-ai-chip {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  border: 1px solid rgba(203, 213, 225, 0.92);
  background: #fff;
  color: rgb(51 65 85 / 1);
  padding: 0.64rem 0.95rem;
  font-size: 0.82rem;
  font-weight: 700;
  line-height: 1.35;
  text-align: center;
}

.vf-smart-ai-example:hover,
.vf-smart-ai-chip:hover,
.vf-smart-ai-chip:focus-visible {
  background: rgba(248, 250, 252, 1);
  border-color: rgba(var(--vf-brand-500-rgb), 0.38);
  color: var(--vf-brand-700);
}

.vf-smart-ai-turn-group {
  display: grid;
  gap: 1rem;
}

.vf-smart-ai-turn-group[data-collapsed="true"] {
  gap: 0;
}

.vf-smart-ai-turn-group[data-collapsed="true"] .vf-smart-ai-turn-body {
  display: none;
}

.vf-smart-ai-history-toggle {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  border-radius: 1.25rem;
  border: 1px solid rgba(226, 232, 240, 0.96);
  background: rgba(255, 255, 255, 0.98);
  padding: 0.95rem 1rem;
  text-align: left;
  box-shadow: 0 12px 24px -28px rgba(15, 23, 42, 0.18);
}

.vf-smart-ai-history-toggle:hover,
.vf-smart-ai-history-toggle:focus-visible {
  border-color: rgba(var(--vf-brand-500-rgb), 0.28);
  background: rgba(248, 250, 252, 1);
}

.vf-smart-ai-history-toggle-copy {
  display: grid;
  gap: 0.18rem;
  min-width: 0;
}

.vf-smart-ai-history-toggle-label {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgb(100 116 139 / 1);
}

.vf-smart-ai-history-toggle-question {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.9rem;
  font-weight: 600;
  color: rgb(15 23 42 / 0.94);
}

.vf-smart-ai-history-toggle-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  flex: 0 0 auto;
  border-radius: 999px;
  border: 1px solid rgba(203, 213, 225, 0.92);
  background: rgba(248, 250, 252, 0.98);
  color: rgb(71 85 105 / 1);
  font-size: 1.15rem;
  line-height: 1;
}

.vf-smart-ai-turn-group[data-collapsed="false"] .vf-smart-ai-history-toggle-icon {
  transform: rotate(45deg);
}

.vf-smart-ai-turn {
  display: grid;
  gap: 0.35rem;
  padding-inline: 0.15rem;
}

.vf-smart-ai-user-label {
  margin: 0;
  font-size: 0.75rem;
  font-weight: 700;
  color: rgb(71 85 105 / 1);
  text-transform: uppercase;
  letter-spacing: 0.14em;
}

.vf-smart-ai-user-message {
  margin: 0;
  max-width: min(42rem, 100%);
  border-radius: 1.4rem;
  border: 1px solid rgba(226, 232, 240, 0.92);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(248, 250, 252, 0.98) 100%);
  padding: 0.9rem 1rem;
  font-size: 0.98rem;
  line-height: 1.6;
  color: rgb(15 23 42 / 0.96);
  box-shadow: 0 12px 26px -26px rgba(15, 23, 42, 0.22);
}

.vf-smart-ai-turn-body {
  display: grid;
  gap: 1rem;
}

.vf-smart-ai-loading-card,
.vf-smart-ai-assistant-card {
  border-radius: 1.45rem;
  border: 1px solid rgba(255, 255, 255, 0.05);
  background: linear-gradient(160deg, rgba(15, 23, 42, 0.95) 0%, rgba(21, 32, 49, 0.97) 100%);
  color: #fff;
  padding: 1.05rem 1.15rem;
  box-shadow: 0 16px 30px -28px rgba(15, 23, 42, 0.42);
}

.vf-smart-ai-typing {
  display: inline-flex;
  gap: 0.3rem;
}

.vf-smart-ai-typing-dot {
  width: 0.36rem;
  height: 0.36rem;
  border-radius: 999px;
  background: rgba(221, 232, 201, 0.95);
  animation: vfSmartAiTyping 1s infinite ease-in-out;
}

.vf-smart-ai-typing-dot:nth-child(2) {
  animation-delay: 0.16s;
}

.vf-smart-ai-typing-dot:nth-child(3) {
  animation-delay: 0.32s;
}

.vf-smart-ai-response-card {
  display: grid;
  gap: 0.8rem;
}

.vf-smart-ai-question-card,
.vf-smart-ai-summary-card,
.vf-smart-ai-empty-card {
  border-radius: 1.35rem;
  border: 1px solid rgba(226, 232, 240, 0.96);
  background: rgba(255, 255, 255, 0.98);
  padding: 1rem 1.05rem;
  box-shadow: 0 14px 28px -30px rgba(15, 23, 42, 0.18);
}

.vf-smart-ai-question-card {
  background: linear-gradient(180deg, rgba(255, 252, 244, 0.98) 0%, rgba(255, 255, 255, 0.98) 100%);
}

.vf-smart-ai-empty-card {
  background: linear-gradient(180deg, rgba(255, 252, 244, 0.98) 0%, rgba(249, 250, 251, 0.98) 100%);
}

.vf-smart-ai-question-groups {
  display: grid;
  gap: 1rem;
}

@media (max-width: 639px) {
  .vf-smart-ai-history-toggle {
    padding: 0.88rem 0.9rem;
  }

  .vf-smart-ai-history-toggle-question {
    font-size: 0.84rem;
  }
}

.vf-smart-ai-question-group + .vf-smart-ai-question-group {
  padding-top: 0.9rem;
  border-top: 1px solid rgba(226, 232, 240, 0.9);
}

.vf-smart-ai-mode-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  background: rgba(255, 255, 255, 0.03);
  color: rgba(255, 255, 255, 0.92);
  padding: 0.55rem 0.9rem;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

[data-ai-smart-status][data-tone="error"] {
  color: rgb(185 28 28 / 1);
}

[data-ai-smart-status][data-tone="success"] {
  color: rgb(71 85 105 / 0.92);
}

[data-ai-smart-status][data-tone="loading"] {
  color: rgb(71 85 105 / 0.9);
}

.vf-smart-ai-shell--compact .vf-smart-ai-bar {
  border-radius: 1.35rem;
}

.vf-smart-ai-shell--compact .vf-smart-ai-entry {
  grid-template-columns: minmax(0, 1fr) auto auto;
}

.vf-smart-ai-shell--compact .vf-smart-ai-textarea {
  min-height: 3.45rem;
}

.vf-smart-ai-shell--compact [data-ai-smart-history-wrap] {
  margin-top: 1rem;
}

.vf-smart-ai-shell--compact .vf-smart-ai-user-message {
  font-size: 0.96rem;
}

html.vf-dark .vf-smart-ai-shell:not(.vf-smart-ai-shell--compact) {
  border-color: rgba(71, 85, 105, 0.55);
  background: rgba(15, 23, 42, 0.84);
}

html.vf-dark .vf-smart-ai-shell:not(.vf-smart-ai-shell--compact) h2,
html.vf-dark .vf-smart-ai-shell:not(.vf-smart-ai-shell--compact) > div > p,
html.vf-dark .vf-smart-ai-shell:not(.vf-smart-ai-shell--compact) [data-ai-smart-status],
html.vf-dark .vf-smart-ai-shell:not(.vf-smart-ai-shell--compact) .vf-smart-ai-user-label {
  color: rgb(241 245 249 / 0.96);
}

html.vf-dark .vf-smart-ai-shell:not(.vf-smart-ai-shell--compact) .vf-smart-ai-user-message {
  border-color: rgba(148, 163, 184, 0.24);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(241, 245, 249, 0.98) 100%);
  color: rgb(15 23 42 / 0.96);
}

html.vf-dark .vf-smart-ai-shell:not(.vf-smart-ai-shell--compact) .vf-smart-ai-question-card,
html.vf-dark .vf-smart-ai-shell:not(.vf-smart-ai-shell--compact) .vf-smart-ai-summary-card,
html.vf-dark .vf-smart-ai-shell:not(.vf-smart-ai-shell--compact) .vf-smart-ai-empty-card {
  background: rgba(15, 23, 42, 0.82);
  border-color: rgba(71, 85, 105, 0.52);
}

html.vf-dark .vf-smart-ai-shell:not(.vf-smart-ai-shell--compact) .vf-smart-ai-question-card .text-brand-700,
html.vf-dark .vf-smart-ai-shell:not(.vf-smart-ai-shell--compact) .vf-smart-ai-summary-card .text-brand-700,
html.vf-dark .vf-smart-ai-shell:not(.vf-smart-ai-shell--compact) .vf-smart-ai-empty-card .text-brand-700 {
  color: rgb(221 232 201 / 0.96) !important;
}

html.vf-dark .vf-smart-ai-shell:not(.vf-smart-ai-shell--compact) .vf-smart-ai-question-card .text-slate-500,
html.vf-dark .vf-smart-ai-shell:not(.vf-smart-ai-shell--compact) .vf-smart-ai-question-card .text-slate-600,
html.vf-dark .vf-smart-ai-shell:not(.vf-smart-ai-shell--compact) .vf-smart-ai-summary-card .text-slate-500,
html.vf-dark .vf-smart-ai-shell:not(.vf-smart-ai-shell--compact) .vf-smart-ai-summary-card .text-slate-600,
html.vf-dark .vf-smart-ai-shell:not(.vf-smart-ai-shell--compact) .vf-smart-ai-empty-card .text-slate-500,
html.vf-dark .vf-smart-ai-shell:not(.vf-smart-ai-shell--compact) .vf-smart-ai-empty-card .text-slate-600,
html.vf-dark .vf-smart-ai-shell:not(.vf-smart-ai-shell--compact) .vf-smart-ai-empty-card .text-slate-700 {
  color: rgb(203 213 225 / 0.92) !important;
}

html.vf-dark .vf-smart-ai-shell:not(.vf-smart-ai-shell--compact) .vf-smart-ai-question-card .text-slate-900,
html.vf-dark .vf-smart-ai-shell:not(.vf-smart-ai-shell--compact) .vf-smart-ai-question-card .text-slate-950,
html.vf-dark .vf-smart-ai-shell:not(.vf-smart-ai-shell--compact) .vf-smart-ai-summary-card .text-slate-900,
html.vf-dark .vf-smart-ai-shell:not(.vf-smart-ai-shell--compact) .vf-smart-ai-summary-card .text-slate-950,
html.vf-dark .vf-smart-ai-shell:not(.vf-smart-ai-shell--compact) .vf-smart-ai-empty-card .text-slate-900,
html.vf-dark .vf-smart-ai-shell:not(.vf-smart-ai-shell--compact) .vf-smart-ai-empty-card .text-slate-950 {
  color: rgb(248 250 252 / 0.98) !important;
}

html.vf-dark .vf-smart-ai-shell:not(.vf-smart-ai-shell--compact) .vf-smart-ai-summary-card .bg-white,
html.vf-dark .vf-smart-ai-shell:not(.vf-smart-ai-shell--compact) .vf-smart-ai-summary-card .bg-slate-50,
html.vf-dark .vf-smart-ai-shell:not(.vf-smart-ai-shell--compact) .vf-smart-ai-question-card .bg-white,
html.vf-dark .vf-smart-ai-shell:not(.vf-smart-ai-shell--compact) .vf-smart-ai-question-card .bg-slate-50,
html.vf-dark .vf-smart-ai-shell:not(.vf-smart-ai-shell--compact) .vf-smart-ai-response-card .bg-white {
  background: rgba(30, 41, 59, 0.9) !important;
}

html.vf-dark .vf-smart-ai-shell:not(.vf-smart-ai-shell--compact) .vf-smart-ai-response-card .text-slate-900,
html.vf-dark .vf-smart-ai-shell:not(.vf-smart-ai-shell--compact) .vf-smart-ai-response-card .text-slate-950 {
  color: rgb(248 250 252 / 0.98) !important;
}

html.vf-dark .vf-smart-ai-shell:not(.vf-smart-ai-shell--compact) .vf-smart-ai-response-card .text-slate-600,
html.vf-dark .vf-smart-ai-shell:not(.vf-smart-ai-shell--compact) .vf-smart-ai-response-card .text-slate-500,
html.vf-dark .vf-smart-ai-shell:not(.vf-smart-ai-shell--compact) .vf-smart-ai-response-card .text-slate-700 {
  color: rgb(203 213 225 / 0.92) !important;
}

html.vf-dark .vf-smart-ai-shell:not(.vf-smart-ai-shell--compact) .vf-smart-ai-summary-card .border-slate-200,
html.vf-dark .vf-smart-ai-shell:not(.vf-smart-ai-shell--compact) .vf-smart-ai-question-card .border-slate-200,
html.vf-dark .vf-smart-ai-shell:not(.vf-smart-ai-shell--compact) .vf-smart-ai-empty-card .border-slate-200,
html.vf-dark .vf-smart-ai-shell:not(.vf-smart-ai-shell--compact) .vf-smart-ai-question-group + .vf-smart-ai-question-group {
  border-color: rgba(71, 85, 105, 0.72) !important;
}

html.vf-dark .vf-smart-ai-shell:not(.vf-smart-ai-shell--compact) .vf-smart-ai-example,
html.vf-dark .vf-smart-ai-shell:not(.vf-smart-ai-shell--compact) .vf-smart-ai-chip {
  background: rgba(15, 23, 42, 0.78);
  color: rgb(226 232 240 / 0.95);
  border-color: rgba(148, 163, 184, 0.35);
}

html.vf-dark .vf-smart-ai-shell:not(.vf-smart-ai-shell--compact) .vf-smart-ai-chip:hover,
html.vf-dark .vf-smart-ai-shell:not(.vf-smart-ai-shell--compact) .vf-smart-ai-chip:focus-visible,
html.vf-dark .vf-smart-ai-shell:not(.vf-smart-ai-shell--compact) .vf-smart-ai-example:hover {
  background: rgba(30, 41, 59, 0.94);
  color: rgb(248 250 252 / 0.98);
}

html.vf-dark .vf-smart-ai-shell .vf-smart-ai-result-card {
  border-color: rgba(71, 85, 105, 0.72);
  background: rgba(15, 23, 42, 0.92);
  box-shadow: 0 18px 34px -28px rgba(2, 6, 23, 0.62);
}

html.vf-dark .vf-smart-ai-shell .vf-smart-ai-result-card .text-slate-950,
html.vf-dark .vf-smart-ai-shell .vf-smart-ai-result-card .text-slate-900 {
  color: rgb(248 250 252 / 0.98) !important;
}

html.vf-dark .vf-smart-ai-shell .vf-smart-ai-result-card .text-slate-700,
html.vf-dark .vf-smart-ai-shell .vf-smart-ai-result-card .text-slate-600,
html.vf-dark .vf-smart-ai-shell .vf-smart-ai-result-card .text-slate-500 {
  color: rgb(203 213 225 / 0.94) !important;
}

html.vf-dark .vf-smart-ai-shell .vf-smart-ai-result-card .border-slate-200,
html.vf-dark .vf-smart-ai-shell .vf-smart-ai-result-card .border-slate-300,
html.vf-dark .vf-smart-ai-shell .vf-smart-ai-result-card .border-brand-200,
html.vf-dark .vf-smart-ai-shell .vf-smart-ai-result-card .border-emerald-100 {
  border-color: rgba(71, 85, 105, 0.72) !important;
}

html.vf-dark .vf-smart-ai-shell .vf-smart-ai-result-card .bg-white,
html.vf-dark .vf-smart-ai-shell .vf-smart-ai-result-card .bg-slate-50,
html.vf-dark .vf-smart-ai-shell .vf-smart-ai-result-card .bg-brand-50,
html.vf-dark .vf-smart-ai-shell .vf-smart-ai-result-card .bg-emerald-50 {
  background: rgba(30, 41, 59, 0.92) !important;
}

html.vf-dark .vf-smart-ai-shell .vf-smart-ai-result-pill {
  border: 1px solid rgba(148, 163, 184, 0.2);
  background: rgba(15, 23, 42, 0.74) !important;
  color: rgb(248 250 252 / 0.96) !important;
}

html.vf-dark .vf-smart-ai-shell .vf-smart-ai-result-pill--verified {
  background: rgba(166, 190, 118, 0.16) !important;
  color: rgb(221 232 201 / 0.98) !important;
  border-color: rgba(166, 190, 118, 0.28) !important;
}

html.vf-dark .vf-smart-ai-shell .vf-smart-ai-rating-badge {
  background: rgba(16, 185, 129, 0.14) !important;
  color: rgb(167 243 208 / 0.98) !important;
  border-color: rgba(52, 211, 153, 0.28) !important;
}

html.vf-dark .vf-smart-ai-shell .vf-smart-ai-result-stat {
  background: rgba(30, 41, 59, 0.9) !important;
}

html.vf-dark .vf-smart-ai-shell .vf-smart-ai-result-reason {
  border: 1px solid rgba(71, 85, 105, 0.72);
  background: rgba(30, 41, 59, 0.92) !important;
  color: rgb(226 232 240 / 0.95) !important;
}

[data-ai-smart-floating-root] {
  pointer-events: none;
}

[data-ai-smart-floating-root] > * {
  pointer-events: auto;
}

@media (max-width: 768px) {
  .vf-smart-ai-header {
    gap: 1rem;
  }

  .vf-smart-ai-toolbar {
    gap: 0.6rem;
  }

  .vf-smart-ai-control {
    flex: 1 1 calc(50% - 0.35rem);
    min-width: calc(50% - 0.35rem);
  }

  .vf-smart-ai-entry {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }

  .vf-smart-ai-send,
  .vf-smart-ai-icon-button--mic {
    width: 100%;
  }

  .vf-smart-ai-shell--compact .vf-smart-ai-entry {
    grid-template-columns: 1fr;
  }

  .vf-smart-ai-question-groups {
    gap: 0.85rem;
  }

  [data-ai-smart-floating-root] {
    right: 0.75rem !important;
    bottom: max(0.9rem, env(safe-area-inset-bottom)) !important;
    max-width: min(18rem, calc(100vw - 1rem)) !important;
  }

  [data-ai-smart-floating-root] [data-ai-smart-floating-panel] {
    width: min(23rem, calc(100vw - 1rem)) !important;
    max-width: min(23rem, calc(100vw - 1rem)) !important;
    bottom: calc(100% + 0.65rem) !important;
  }

  [data-ai-smart-floating-root] [data-ai-smart-floating-toggle] {
    gap: 0.6rem;
    border-radius: 999px;
    padding: 0.8rem 1rem;
    font-size: 0.86rem;
  }

  [data-ai-smart-floating-root] [data-ai-smart-floating-toggle] span:first-child {
    width: 2rem;
    height: 2rem;
  }
}

@media (max-width: 480px) {
  .vf-smart-ai-control {
    flex: 1 1 100%;
    min-width: 100%;
  }

  .vf-smart-ai-example,
  .vf-smart-ai-chip {
    width: 100%;
  }

  .vf-smart-ai-user-message {
    font-size: 0.94rem;
    line-height: 1.55;
  }
}

@keyframes vfSmartAiTyping {
  0%,
  80%,
  100% {
    opacity: 0.4;
    transform: translateY(0);
  }

  40% {
    opacity: 1;
    transform: translateY(-2px);
  }
}
