.vainstein-consultor {
  --vci-primary: #087cff;
  --vci-panel-bg: #101217;
  --vci-text: #f7f8fb;
  --vci-secondary: #a7afbd;
  --vci-user-bg: #0a67c7;
  --vci-assistant-bg: #191d24;
  --vci-border: rgba(255, 255, 255, .11);
  --vci-error: #ff8a8a;
  --vci-radius: 18px;
  --vci-panel-width: 440px;
  box-sizing: border-box;
  color: var(--vci-text);
  font-family: inherit;
}

.vainstein-consultor *,
.vainstein-consultor *::before,
.vainstein-consultor *::after {
  box-sizing: border-box;
}

.vainstein-consultor [hidden] {
  display: none;
}

.vainstein-consultor button,
.vainstein-consultor input,
.vainstein-consultor textarea {
  font: inherit;
}

.vainstein-consultor button {
  cursor: pointer;
  touch-action: manipulation;
}

.vainstein-consultor__launcher {
  align-items: center;
  background: var(--vci-primary);
  border: 1px solid rgba(255, 255, 255, .18);
  border-radius: 999px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, .24);
  color: #fff;
  display: inline-flex;
  font-size: 14px;
  font-weight: 700;
  gap: 10px;
  justify-content: center;
  line-height: 1.2;
  min-height: 48px;
  padding: 12px 20px;
  transition: filter .2s ease, transform .2s ease;
}

.vainstein-consultor__launcher-mark {
  background: currentColor;
  border-radius: 50%;
  box-shadow: 0 0 0 5px rgba(255, 255, 255, .14);
  height: 8px;
  width: 8px;
}

.vainstein-consultor__launcher:hover {
  filter: brightness(1.08);
  transform: translateY(-1px);
}

.vainstein-consultor__panel {
  background: var(--vci-panel-bg);
  border: 1px solid var(--vci-border);
  border-radius: var(--vci-radius);
  bottom: 24px;
  box-shadow: 0 28px 80px rgba(0, 0, 0, .48);
  color: var(--vci-text);
  display: flex;
  flex-direction: column;
  height: min(720px, calc(100vh - 48px));
  height: min(720px, calc(100dvh - 48px));
  max-width: calc(100vw - 32px);
  overflow: hidden;
  position: fixed;
  right: 24px;
  width: var(--vci-panel-width);
  z-index: 99999;
}

.vainstein-consultor__header {
  align-items: center;
  border-bottom: 1px solid var(--vci-border);
  display: flex;
  flex: 0 0 auto;
  justify-content: space-between;
  min-height: 76px;
  padding: 14px 16px 14px 20px;
}

.vainstein-consultor__title {
  color: var(--vci-text);
  display: block;
  font-size: 15px;
  font-weight: 750;
  letter-spacing: .08em;
  line-height: 1.3;
}

.vainstein-consultor__status {
  align-items: center;
  color: var(--vci-secondary);
  display: flex;
  font-size: 12px;
  gap: 7px;
  line-height: 1.4;
  margin-top: 4px;
}

.vainstein-consultor__status > span:first-child {
  background: var(--vci-primary);
  border-radius: 50%;
  box-shadow: 0 0 0 4px rgba(8, 124, 255, .12);
  height: 7px;
  width: 7px;
}

.vainstein-consultor__close,
.vainstein-consultor__send {
  align-items: center;
  border: 0;
  display: inline-flex;
  flex: 0 0 auto;
  justify-content: center;
  min-height: 44px;
  min-width: 44px;
}

.vainstein-consultor__close {
  background: transparent;
  border-radius: 50%;
  color: var(--vci-secondary);
}

.vainstein-consultor__close:hover {
  background: rgba(255, 255, 255, .07);
  color: var(--vci-text);
}

.vainstein-consultor__close svg,
.vainstein-consultor__send svg {
  fill: currentColor;
  height: 20px;
  width: 20px;
}

.vainstein-consultor__intro {
  align-items: flex-start;
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  justify-content: center;
  padding: 34px 28px;
}

.vainstein-consultor__intro > strong {
  color: var(--vci-text);
  font-size: clamp(24px, 3vw, 34px);
  font-weight: 700;
  letter-spacing: -.025em;
  line-height: 1.14;
  max-width: 16ch;
}

.vainstein-consultor__intro > p {
  color: var(--vci-secondary);
  font-size: 15px;
  line-height: 1.65;
  margin: 18px 0 28px;
  max-width: 42ch;
}

.vainstein-consultor__start {
  background: var(--vci-primary);
  border: 0;
  border-radius: 999px;
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  min-height: 48px;
  padding: 12px 20px;
  transition: filter .2s ease, transform .2s ease;
}

.vainstein-consultor__start:hover {
  filter: brightness(1.08);
  transform: translateY(-1px);
}

.vainstein-consultor__start:disabled,
.vainstein-consultor__send:disabled,
.vainstein-consultor__input:disabled {
  cursor: wait;
  opacity: .62;
}

.vainstein-consultor__start:disabled:hover,
.vainstein-consultor__send:disabled:hover {
  filter: none;
  transform: none;
}

.vainstein-consultor__start-error {
  color: var(--vci-error);
  font-size: 12px;
  line-height: 1.45;
  margin: 12px 2px 0;
}

.vainstein-consultor__messages {
  flex: 1 1 auto;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 22px 20px;
  scrollbar-color: rgba(255, 255, 255, .2) transparent;
  scrollbar-width: thin;
}

.vainstein-consultor__message {
  display: flex;
  flex-direction: column;
  margin-bottom: 18px;
  max-width: 86%;
}

.vainstein-consultor__message--user {
  align-items: flex-end;
  margin-left: auto;
}

.vainstein-consultor__message-author {
  color: var(--vci-secondary);
  font-size: 11px;
  font-weight: 650;
  letter-spacing: .025em;
  margin: 0 9px 6px;
}

.vainstein-consultor__message-body {
  background: var(--vci-assistant-bg);
  border: 1px solid var(--vci-border);
  border-radius: var(--vci-radius);
  color: var(--vci-text);
  font-size: 14px;
  line-height: 1.6;
  overflow-wrap: anywhere;
  padding: 13px 15px;
  white-space: pre-wrap;
}

.vainstein-consultor__message--user .vainstein-consultor__message-body {
  background: var(--vci-user-bg);
  border-color: transparent;
  color: #fff;
}

.vainstein-consultor__message-body p {
  color: inherit;
  margin: 0;
}

.vainstein-consultor__message-body p + p {
  margin-top: 9px;
}

.vainstein-consultor__composer {
  background: var(--vci-panel-bg);
  border-top: 1px solid var(--vci-border);
  flex: 0 0 auto;
  padding: 14px 16px 16px;
}

.vainstein-consultor__field-row {
  align-items: flex-end;
  display: flex;
  gap: 10px;
}

.vainstein-consultor__field {
  flex: 1 1 auto;
  min-width: 0;
}

.vainstein-consultor__input {
  background: rgba(255, 255, 255, .055);
  border: 1px solid var(--vci-border);
  border-radius: 12px;
  color: var(--vci-text);
  display: block;
  font-size: 16px;
  line-height: 1.45;
  min-height: 48px;
  outline: 0;
  padding: 12px 14px;
  resize: vertical;
  width: 100%;
}

textarea.vainstein-consultor__input {
  max-height: 132px;
  min-height: 72px;
}

.vainstein-consultor__input::placeholder {
  color: var(--vci-secondary);
  opacity: .82;
}

.vainstein-consultor__input:focus {
  border-color: var(--vci-primary);
  box-shadow: 0 0 0 3px rgba(8, 124, 255, .24);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--vci-primary) 24%, transparent);
}

.vainstein-consultor__input[aria-invalid="true"] {
  border-color: var(--vci-error);
}

.vainstein-consultor__send {
  background: var(--vci-primary);
  border-radius: 12px;
  color: #fff;
}

.vainstein-consultor__send:hover {
  filter: brightness(1.1);
}

.vainstein-consultor__error {
  color: var(--vci-error);
  font-size: 12px;
  line-height: 1.45;
  margin: 8px 2px 0;
}

.vainstein-consultor__summary {
  background: rgba(8, 124, 255, .07);
  border: 1px solid rgba(8, 124, 255, .35);
  border: 1px solid color-mix(in srgb, var(--vci-primary) 35%, transparent);
  border-radius: var(--vci-radius);
  margin: 6px 0 18px;
  padding: 16px;
}

.vainstein-consultor__summary > strong {
  color: var(--vci-text);
  display: block;
  font-size: 13px;
  margin-bottom: 12px;
}

.vainstein-consultor__summary dl {
  display: grid;
  gap: 10px;
  margin: 0;
}

.vainstein-consultor__summary dl > div {
  align-items: baseline;
  display: flex;
  gap: 12px;
  justify-content: space-between;
}

.vainstein-consultor__summary dt,
.vainstein-consultor__summary dd {
  margin: 0;
}

.vainstein-consultor__summary dt {
  color: var(--vci-secondary);
  font-size: 12px;
}

.vainstein-consultor__summary dd {
  color: var(--vci-text);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  text-align: right;
}

.vainstein-consultor__pending {
  background: rgba(255, 255, 255, .055);
  border: 1px solid var(--vci-border);
  border-radius: 12px;
  color: var(--vci-secondary);
  cursor: not-allowed;
  display: block;
  font-size: 13px;
  line-height: 1.4;
  min-height: 48px;
  opacity: .75;
  padding: 11px 15px;
  width: 100%;
}

.vainstein-consultor__generation-state {
  background: rgba(255, 255, 255, .055);
  border: 1px solid var(--vci-border);
  border-radius: 12px;
  color: var(--vci-secondary);
  font-size: 13px;
  line-height: 1.55;
  margin-top: 4px;
  padding: 15px;
}

.vainstein-consultor__generation-state p {
  color: inherit;
  margin: 0 0 12px;
}

.vainstein-consultor__generation-state--error {
  color: var(--vci-error);
}

.vainstein-consultor__retry {
  background: var(--vci-primary);
  border: 0;
  border-radius: 999px;
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  min-height: 42px;
  padding: 9px 17px;
}

.vainstein-consultor__diagnosis {
  display: grid;
  gap: 22px;
  margin-top: 4px;
}

.vainstein-consultor__diagnosis-section {
  margin: 0;
}

.vainstein-consultor__diagnosis-section > h3 {
  color: var(--vci-secondary);
  font-size: 11px;
  font-weight: 750;
  letter-spacing: .09em;
  line-height: 1.4;
  margin: 0 0 10px;
}

.vainstein-consultor__diagnosis-section > p,
.vainstein-consultor__diagnosis-section > ul {
  color: var(--vci-text);
  font-size: 14px;
  line-height: 1.65;
  margin: 0;
}

.vainstein-consultor__diagnosis-section > ul {
  padding-left: 20px;
}

.vainstein-consultor__diagnosis-section > ul li + li {
  margin-top: 7px;
}

.vainstein-consultor__diagnosis-card {
  background: rgba(255, 255, 255, .035);
  border: 1px solid var(--vci-border);
  border-radius: 12px;
  color: var(--vci-text);
  padding: 14px;
}

.vainstein-consultor__diagnosis-card + .vainstein-consultor__diagnosis-card {
  margin-top: 10px;
}

.vainstein-consultor__diagnosis-card > h4 {
  color: var(--vci-text);
  font-size: 15px;
  line-height: 1.4;
  margin: 0 0 11px;
}

.vainstein-consultor__diagnosis-card > p {
  color: var(--vci-secondary);
  font-size: 13px;
  line-height: 1.6;
  margin: 0;
}

.vainstein-consultor__diagnosis-field + .vainstein-consultor__diagnosis-field {
  margin-top: 11px;
}

.vainstein-consultor__diagnosis-field > strong {
  color: var(--vci-secondary);
  display: block;
  font-size: 11px;
  line-height: 1.4;
  margin-bottom: 3px;
}

.vainstein-consultor__diagnosis-field > p {
  color: var(--vci-text);
  font-size: 13px;
  line-height: 1.6;
  margin: 0;
  white-space: pre-wrap;
}

.vainstein-consultor__diagnosis-meta {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin: 13px 0 0;
}

.vainstein-consultor__diagnosis-meta > div {
  background: rgba(255, 255, 255, .035);
  border-radius: 8px;
  padding: 8px;
}

.vainstein-consultor__diagnosis-meta dt,
.vainstein-consultor__diagnosis-meta dd {
  margin: 0;
}

.vainstein-consultor__diagnosis-meta dt {
  color: var(--vci-secondary);
  font-size: 10px;
  line-height: 1.35;
}

.vainstein-consultor__diagnosis-meta dd {
  color: var(--vci-text);
  font-size: 12px;
  font-weight: 700;
  margin-top: 3px;
}

.vainstein-consultor__diagnosis-card--comparison {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.vainstein-consultor__download-action {
  border-top: 1px solid var(--vci-border);
  margin-top: 2px;
  padding-top: 20px;
}

.vainstein-consultor__download {
  align-items: center;
  background: var(--vci-primary);
  border: 0;
  border-radius: 999px;
  color: #fff;
  display: inline-flex;
  font-size: 13px;
  font-weight: 750;
  justify-content: center;
  line-height: 1.3;
  min-height: 48px;
  padding: 12px 20px;
  transition: filter .2s ease;
  width: 100%;
}

.vainstein-consultor__download:hover:not(:disabled) {
  filter: brightness(1.09);
}

.vainstein-consultor__download:disabled {
  cursor: wait;
  opacity: .62;
}

.vainstein-consultor__download-error {
  color: var(--vci-error);
  font-size: 12px;
  line-height: 1.45;
  margin: 10px 2px 0;
}

.vainstein-consultor__appointment-action {
  border-top: 1px solid var(--vci-border);
  margin-top: 16px;
  min-width: 0;
  padding-top: 16px;
}

.vainstein-consultor__appointment-launch,
.vainstein-appointment-confirm {
  align-items: center;
  background: #0759c7;
  border: 1px solid #0759c7;
  border-radius: 999px;
  color: #fff;
  display: inline-flex;
  font-size: 14px;
  font-weight: 700;
  justify-content: center;
  line-height: 1.3;
  min-height: 48px;
  padding: 12px 20px;
  transition: background-color .2s ease, border-color .2s ease, color .2s ease;
  width: 100%;
}

.vainstein-consultor__appointment-launch:hover:not(:disabled),
.vainstein-appointment-confirm:hover:not(:disabled) {
  background: #064aa6;
  border-color: #064aa6;
  color: #fff;
}

.vainstein-consultor__appointment-launch:disabled,
.vainstein-appointment-confirm:disabled {
  cursor: wait;
  opacity: .75;
}

.vainstein-consultor__appointment {
  background: #fff;
  border: 1px solid #cbd5e1;
  border-radius: 16px;
  color: #172033;
  display: grid;
  gap: 18px;
  margin-top: 14px;
  min-width: 0;
  overflow: hidden;
  padding: 18px;
}

.vainstein-consultor__appointment--status {
  color: #334155;
  font-size: 14px;
  line-height: 1.55;
}

.vainstein-appointment-title,
.vainstein-appointment-phase-title,
.vainstein-appointment-secondary,
.vainstein-appointment-help,
.vainstein-appointment-confirmation__title,
.vainstein-appointment-confirmation__text,
.vainstein-appointment-confirmation__data {
  margin: 0;
}

.vainstein-appointment-title {
  color: #111827;
  font-size: 22px;
  font-weight: 750;
  line-height: 1.25;
}

.vainstein-appointment-calendar,
.vainstein-appointment-slots {
  display: grid;
  gap: 10px;
  min-width: 0;
}

.vainstein-appointment-slots:empty {
  display: none;
}

.vainstein-appointment-phase-title {
  color: #1f2937;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.4;
}

.vainstein-appointment-secondary,
.vainstein-appointment-help {
  color: #4b5563;
  font-size: 13px;
  line-height: 1.55;
}

.vainstein-appointment-monthbar {
  align-items: center;
  display: flex;
  gap: 12px;
  justify-content: space-between;
  margin-top: 2px;
  min-width: 0;
}

.vainstein-appointment-month {
  color: #111827;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.35;
  min-width: 0;
  text-align: center;
  text-transform: capitalize;
}

.vainstein-appointment-nav {
  align-items: center;
  background: #fff;
  border: 1px solid #94a3b8;
  border-radius: 10px;
  color: #1f2937;
  display: inline-flex;
  flex: 0 0 auto;
  height: 44px;
  justify-content: center;
  min-height: 44px;
  min-width: 44px;
  padding: 0;
  transition: background-color .2s ease, border-color .2s ease, color .2s ease;
  width: 44px;
}

.vainstein-appointment-nav svg {
  fill: currentColor;
  height: 20px;
  width: 20px;
}

.vainstein-appointment-nav:hover:not(:disabled) {
  background: #0759c7;
  border-color: #0759c7;
  color: #fff;
}

.vainstein-appointment-nav:disabled {
  background: #e2e8f0;
  color: #475569;
  cursor: not-allowed;
  opacity: .8;
}

.vainstein-appointment-grid {
  display: grid;
  gap: 5px;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  min-width: 0;
  text-align: center;
  width: 100%;
}

.vainstein-appointment-weekday,
.vainstein-appointment-day-spacer {
  align-items: center;
  display: flex;
  justify-content: center;
  min-width: 0;
}

.vainstein-appointment-weekday {
  color: #475569;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.3;
  padding-bottom: 6px;
}

.vainstein-appointment-day {
  background: #fff;
  border: 1px solid #94a3b8;
  border-radius: 9px;
  color: #1f2937;
  font-size: 14px;
  font-weight: 650;
  line-height: 1;
  min-height: 44px;
  min-width: 0;
  padding: 6px 4px;
  transition: background-color .2s ease, border-color .2s ease, color .2s ease;
  width: 100%;
}

.vainstein-appointment-day:hover:not(:disabled) {
  background: #eff6ff;
  border-color: #0759c7;
  color: #0759c7;
}

.vainstein-appointment-day.is-selected {
  background: #0759c7;
  border-color: #0759c7;
  color: #fff;
}

.vainstein-appointment-day:disabled {
  background: #e2e8f0;
  color: #475569;
  cursor: not-allowed;
  opacity: .8;
}

.vainstein-appointment-slots-grid {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  min-width: 0;
}

.vainstein-appointment-slot {
  background: #fff;
  border: 1px solid #94a3b8;
  border-radius: 9px;
  color: #1f2937;
  font-size: 13px;
  font-weight: 650;
  line-height: 1.35;
  min-height: 44px;
  min-width: 0;
  padding: 10px 12px;
  transition: background-color .2s ease, border-color .2s ease, color .2s ease;
  width: 100%;
}

.vainstein-appointment-slot:hover:not(:disabled) {
  background: #eff6ff;
  border-color: #0759c7;
  color: #0759c7;
}

.vainstein-appointment-slot[aria-pressed="true"] {
  background: #0759c7;
  border-color: #0759c7;
  color: #fff;
}

.vainstein-appointment-slot:disabled {
  background: #e2e8f0;
  color: #475569;
  cursor: not-allowed;
  opacity: .8;
}

.vainstein-appointment-form {
  display: grid;
  gap: 14px;
  margin-top: 6px;
  min-width: 0;
}

.vainstein-appointment-label {
  color: #1f2937;
  display: grid;
  font-size: 14px;
  font-weight: 650;
  gap: 7px;
  line-height: 1.45;
  min-width: 0;
}

.vainstein-appointment-input {
  background: #fff;
  border: 1px solid #94a3b8;
  border-radius: 9px;
  color: #111827;
  display: block;
  font: inherit;
  font-size: 16px;
  line-height: 1.45;
  min-height: 46px;
  min-width: 0;
  padding: 11px 12px;
  width: 100%;
}

.vainstein-appointment-input::placeholder {
  color: #64748b;
  opacity: 1;
}

.vainstein-appointment-input:focus {
  background: #fff;
  border-color: #0759c7;
  box-shadow: 0 0 0 3px rgba(7, 89, 199, .2);
}

textarea.vainstein-appointment-input {
  min-height: 96px;
  resize: vertical;
}

.vainstein-appointment-help a {
  color: #0759c7;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.vainstein-appointment-confirm:disabled {
  background: #cbd5e1;
  border-color: #cbd5e1;
  color: #475569;
}

.vainstein-appointment-error {
  color: #b42318;
  font-size: 13px;
  line-height: 1.45;
  margin: 0;
}

.vainstein-appointment-error:empty {
  display: none;
}

.vainstein-appointment-confirmation {
  background: #ecfdf5;
  border: 1px solid #86efac;
  border-radius: 12px;
  display: grid;
  gap: 8px;
  padding: 16px;
}

.vainstein-appointment-confirmation__title {
  color: #14532d;
  font-size: 17px;
  font-weight: 750;
  line-height: 1.35;
}

.vainstein-appointment-confirmation__text,
.vainstein-appointment-confirmation__data {
  color: #166534;
  font-size: 13px;
  line-height: 1.55;
  overflow-wrap: anywhere;
}

.vainstein-appointment-confirmation__data {
  font-weight: 700;
}

.vainstein-consultor__screen-reader {
  clip: rect(1px, 1px, 1px, 1px);
  clip-path: inset(50%);
  height: 1px;
  overflow: hidden;
  position: absolute;
  white-space: nowrap;
  width: 1px;
}

.vainstein-consultor button:focus-visible,
.vainstein-consultor input:focus-visible,
.vainstein-consultor textarea:focus-visible {
  outline: 2px solid var(--vci-primary);
  outline-offset: 3px;
}

@media (max-width: 767px) {
  .vainstein-consultor__panel {
    border-radius: var(--vci-radius);
    bottom: max(12px, env(safe-area-inset-bottom));
    height: calc(100vh - 24px - env(safe-area-inset-bottom));
    height: calc(100dvh - 24px - env(safe-area-inset-bottom));
    left: 12px;
    max-width: none;
    right: 12px;
    width: auto;
  }

  .vainstein-consultor__intro {
    padding: 28px 20px;
  }

  .vainstein-consultor__intro > strong {
    font-size: 26px;
  }

  .vainstein-consultor__messages {
    padding: 18px 14px;
  }

  .vainstein-consultor__message {
    max-width: 91%;
  }

  .vainstein-consultor__composer {
    padding: 12px 12px calc(12px + env(safe-area-inset-bottom));
  }

  .vainstein-consultor__diagnosis-card--comparison {
    grid-template-columns: 1fr;
  }

  .vainstein-consultor__appointment {
    padding: 16px;
  }

  .vainstein-appointment-slots-grid {
    grid-template-columns: 1fr;
  }

  .vainstein-appointment-slot,
  .vainstein-appointment-confirm,
  .vainstein-consultor__appointment-launch,
  .vainstein-appointment-input {
    width: 100%;
  }
}

@media (max-width: 420px) {
  .vainstein-consultor__appointment {
    padding: 14px;
  }

  .vainstein-appointment-grid {
    gap: 3px;
  }

  .vainstein-appointment-day {
    font-size: 13px;
    padding-left: 2px;
    padding-right: 2px;
  }

  .vainstein-appointment-monthbar {
    gap: 8px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .vainstein-consultor__launcher,
  .vainstein-consultor__start,
  .vainstein-consultor__download,
  .vainstein-consultor__appointment-launch,
  .vainstein-appointment-confirm,
  .vainstein-appointment-nav,
  .vainstein-appointment-day,
  .vainstein-appointment-slot {
    transition: none;
  }
}
