:root {
  --w3fa-bg: #082c36;
  --w3fa-surface: #0d3541;
  --w3fa-surface-soft: #0b2730;
  --w3fa-surface-user: #173f3d;
  --w3fa-text: #f5f7f7;
  --w3fa-text-secondary: #c7d3d6;
  --w3fa-text-muted: #9eb1b6;
  --w3fa-accent: #86a83a;
  --w3fa-accent-hover: #93b83e;
  --w3fa-accent-ink: #13210b;
  --w3fa-border: rgba(255, 255, 255, 0.12);
  --w3fa-border-accent: rgba(134, 168, 58, 0.55);
  --w3fa-shadow: 0 18px 52px rgba(2, 18, 23, 0.38);
}

.we3d-fa__dialog[hidden] { display: none !important; }

.we3d-fa,
.we3d-fa * { box-sizing: border-box; }

.we3d-fa {
  position: fixed;
  z-index: 999998;
  right: 20px;
  bottom: 20px;
  color: var(--w3fa-text);
  font: 400 13px/1.45 Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}

.we3d-fa button,
.we3d-fa input,
.we3d-fa a { font: inherit; }

.we3d-fa[data-open="true"] .we3d-fa__launcher { visibility: hidden; }

.we3d-fa__launcher {
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: calc(100vw - 32px);
  min-height: 48px;
  padding: 7px 13px 7px 8px;
  border: 1px solid var(--w3fa-border-accent);
  border-radius: 15px;
  background: linear-gradient(145deg, #0d3541, #082c36);
  color: var(--w3fa-text);
  box-shadow: 0 12px 34px rgba(2, 18, 23, 0.34);
  cursor: pointer;
  transition: transform .16s ease, border-color .16s ease, box-shadow .16s ease;
}

.we3d-fa__launcher:hover {
  transform: translateY(-1px);
  border-color: var(--w3fa-accent);
  box-shadow: 0 15px 38px rgba(2, 18, 23, 0.42);
}

.we3d-fa__launcher > span:last-child { min-width: 0; }
.we3d-fa__launcher strong,
.we3d-fa__launcher small { display: block; text-align: left; white-space: nowrap; }
.we3d-fa__launcher strong {
  overflow: hidden;
  color: var(--w3fa-text);
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: .01em;
  text-overflow: ellipsis;
  text-transform: none;
}
.we3d-fa__launcher small { margin-top: 1px; color: var(--w3fa-text-secondary); font-size: 10.5px; }
.we3d-fa__launcher-icon {
  display: grid;
  flex: 0 0 32px;
  width: 32px;
  height: 32px;
  place-items: center;
  border-radius: 10px;
  background: var(--w3fa-accent);
  color: var(--w3fa-accent-ink);
}
.we3d-fa__launcher-icon svg {
  width: 18px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.9;
}

.we3d-fa__dialog {
  position: absolute;
  right: 0;
  bottom: 0;
  display: grid;
  width: min(372px, calc(100vw - 28px));
  height: min(610px, calc(100vh - 34px));
  grid-template-rows: auto minmax(0, 1fr) auto auto auto;
  overflow: hidden;
  border: 1px solid var(--w3fa-border);
  border-radius: 18px;
  background: var(--w3fa-bg);
  box-shadow: var(--w3fa-shadow);
}

.we3d-fa__header {
  display: flex;
  min-height: 82px;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  padding: 13px 14px;
  border-bottom: 1px solid var(--w3fa-border);
  background: var(--w3fa-surface);
}
.we3d-fa__header > div:first-child { min-width: 0; }
.we3d-fa__header h2 {
  margin: 0 !important;
  color: var(--w3fa-text) !important;
  font-size: 16px !important;
  font-weight: 720 !important;
  line-height: 1.2 !important;
  letter-spacing: -.01em;
}
.we3d-fa__header p {
  max-width: 220px;
  margin: 3px 0 !important;
  color: var(--w3fa-text-secondary) !important;
  font-size: 10.5px !important;
  line-height: 1.35 !important;
}
.we3d-fa__live { display: block; color: var(--w3fa-text-secondary); font-size: 9.5px; }
.we3d-fa__live i {
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-right: 5px;
  border-radius: 50%;
  background: var(--w3fa-accent);
  box-shadow: 0 0 0 3px rgba(134, 168, 58, .12);
}
.we3d-fa__header-actions { display: flex; flex: 0 0 auto; gap: 2px; }
.we3d-fa__header-actions button {
  display: grid;
  width: 32px;
  min-height: 32px;
  padding: 0;
  place-items: center;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--w3fa-text-secondary);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  transition: color .16s ease, background .16s ease;
}
.we3d-fa__header-actions button:hover { background: rgba(255,255,255,.08); color: var(--w3fa-text); }

.we3d-fa__messages {
  min-width: 0;
  padding: 13px;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-color: rgba(199, 211, 214, .3) transparent;
  scrollbar-width: thin;
}
.we3d-fa__bubble {
  max-width: 92%;
  margin: 0 0 10px;
  padding: 10px 11px;
  overflow-wrap: anywhere;
  border: 1px solid var(--w3fa-border);
  border-radius: 12px 12px 12px 4px;
  background: var(--w3fa-surface);
}
.we3d-fa__bubble--user {
  margin-left: auto;
  border-color: rgba(134, 168, 58, .25);
  border-radius: 12px 12px 4px 12px;
  background: var(--w3fa-surface-user);
}
.we3d-fa__bubble > strong {
  display: block;
  color: var(--w3fa-accent);
  font-size: 8.5px;
  font-weight: 750;
  letter-spacing: .09em;
  text-transform: uppercase;
}
.we3d-fa__bubble > p {
  margin: 4px 0 0 !important;
  color: var(--w3fa-text) !important;
  font-size: 12.5px !important;
  line-height: 1.48 !important;
}

.we3d-fa__quick {
  display: flex;
  min-width: 0;
  min-height: 0;
  max-height: 94px;
  flex-wrap: wrap;
  align-content: flex-start;
  gap: 6px;
  padding: 6px 12px 8px;
  overflow-x: hidden;
  overflow-y: auto;
  border-top: 1px solid rgba(255,255,255,.055);
  scrollbar-color: rgba(134, 168, 58, .38) transparent;
  scrollbar-width: thin;
}
.we3d-fa__quick:empty { display: none; }
.we3d-fa__quick button {
  min-height: 32px;
  padding: 5px 10px;
  border: 1px solid var(--w3fa-border-accent);
  border-radius: 999px;
  background: var(--w3fa-surface-soft);
  color: var(--w3fa-text-secondary);
  font-size: 11px;
  line-height: 1.2;
  cursor: pointer;
  transition: color .16s ease, border-color .16s ease, background .16s ease;
}
.we3d-fa__quick button:hover {
  border-color: var(--w3fa-accent-hover);
  background: rgba(134, 168, 58, .16);
  color: var(--w3fa-text);
}

.we3d-fa__form {
  display: flex;
  min-height: 54px;
  gap: 7px;
  padding: 7px 9px;
  border-top: 1px solid var(--w3fa-border);
  background: rgba(4, 27, 34, .38);
}
.we3d-fa__form input {
  min-width: 0;
  flex: 1;
  padding: 0 11px;
  border: 1px solid var(--w3fa-border);
  border-radius: 10px;
  outline: 0;
  background: var(--w3fa-surface-soft);
  color: var(--w3fa-text);
  font-size: 14px;
  transition: border-color .16s ease, box-shadow .16s ease;
}
.we3d-fa__form input::placeholder { color: var(--w3fa-text-muted); font-size: 12px; }
.we3d-fa__form input:hover { border-color: rgba(255,255,255,.22); }
.we3d-fa__form button,
.we3d-fa__actions a {
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  justify-content: center;
  padding: 0 13px;
  border: 0;
  border-radius: 9px;
  background: var(--w3fa-accent);
  color: var(--w3fa-accent-ink) !important;
  font-weight: 750;
  text-decoration: none;
  cursor: pointer;
  transition: transform .16s ease, background .16s ease, box-shadow .16s ease;
}
.we3d-fa__form button:hover,
.we3d-fa__actions a:hover { background: var(--w3fa-accent-hover); box-shadow: 0 6px 16px rgba(134,168,58,.18); }
.we3d-fa__form button:active,
.we3d-fa__actions a:active { transform: translateY(1px); }
.we3d-fa__form button svg { display: none; width: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.we3d-fa__form.is-loading { opacity: .7; pointer-events: none; }

.we3d-fa footer {
  display: flex;
  min-height: 27px;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 2px 10px 6px;
  color: var(--w3fa-text-muted);
  font-size: 8.5px;
}
.we3d-fa__reset {
  min-height: 24px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--w3fa-text-secondary);
  font-size: 9.5px;
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
}

.we3d-fa__product {
  margin-top: 10px;
  padding: 11px;
  border: 1px solid var(--w3fa-border);
  border-radius: 11px;
  background: var(--w3fa-surface-soft);
}
.we3d-fa__product h3 { margin: 4px 0 1px !important; color: var(--w3fa-text) !important; font-size: 15px !important; line-height: 1.25 !important; }
.we3d-fa__product h4 { margin: 9px 0 3px !important; color: var(--w3fa-text) !important; font-size: 9.5px !important; letter-spacing: .06em; text-transform: uppercase; }
.we3d-fa__material { margin: 0 0 8px !important; color: var(--w3fa-text-secondary) !important; font-size: 10.5px !important; }
.we3d-fa__eyebrow { color: var(--w3fa-accent); font-size: 8px; font-weight: 750; letter-spacing: .1em; }
.we3d-fa__product dl { margin: 0; }
.we3d-fa__product dl div { display: flex; justify-content: space-between; gap: 10px; margin: 4px 0; font-size: 10px; }
.we3d-fa__product dt { color: var(--w3fa-text-muted); }
.we3d-fa__product dd { margin: 0; color: var(--w3fa-text); text-align: right; }
.we3d-fa__why,
.we3d-fa__trade { margin: 0 0 3px !important; padding: 0 0 0 16px !important; color: var(--w3fa-text-secondary); font-size: 10px; }
.we3d-fa__why li::marker { color: var(--w3fa-accent); }
.we3d-fa__price { display: flex; justify-content: space-between; gap: 8px; margin: 9px 0 4px !important; color: var(--w3fa-text) !important; font-size: 12.5px !important; }
.we3d-fa__checked { margin: 0 0 8px !important; color: var(--w3fa-text-muted) !important; font-size: 8px !important; }
.we3d-fa__actions { display: flex; flex-wrap: wrap; gap: 6px; }
.we3d-fa__actions a { min-height: 36px; flex: 1; padding: 0 10px; font-size: 10.5px; }
.we3d-fa__actions a:first-child { border: 1px solid var(--w3fa-border-accent); background: transparent; color: var(--w3fa-text) !important; }
.we3d-fa__actions a:first-child:hover { background: rgba(134,168,58,.12); }

.we3d-fa button:focus-visible,
.we3d-fa a:focus-visible,
.we3d-fa input:focus-visible {
  outline: 3px solid #d8eaad;
  outline-offset: 2px;
}
.we3d-fa__form input:focus-visible { border-color: var(--w3fa-accent); box-shadow: 0 0 0 3px rgba(134,168,58,.18); outline: 0; }

@media (max-width: 600px) {
  .we3d-fa { right: 10px; bottom: max(72px, calc(env(safe-area-inset-bottom) + 10px)); }
  .we3d-fa__launcher { max-width: calc(100vw - 20px); padding: 7px 11px 7px 8px; }
  .we3d-fa__launcher small { display: none; }
  .we3d-fa__dialog {
    position: fixed;
    right: 7px;
    bottom: max(7px, env(safe-area-inset-bottom));
    left: 7px;
    width: auto;
    height: min(650px, calc(100dvh - 14px));
    border-radius: 16px;
  }
  .we3d-fa__header { min-height: 78px; padding: 11px 12px; }
  .we3d-fa__header p { max-width: 195px; }
  .we3d-fa__messages { padding: 11px; }
  .we3d-fa__quick { max-height: 104px; padding: 6px 10px 8px; }
  .we3d-fa__quick button { min-height: 34px; }
  .we3d-fa__form button { width: 42px; padding: 0; }
  .we3d-fa__form button span { display: none; }
  .we3d-fa__form button svg { display: block; }
  .we3d-fa footer span { max-width: 58%; text-align: right; }
}

@media (max-width: 370px) {
  .we3d-fa__dialog { right: 5px; left: 5px; }
  .we3d-fa__header { padding: 10px; }
  .we3d-fa__header p { max-width: 175px; }
  .we3d-fa__header-actions button { width: 30px; min-height: 30px; }
  .we3d-fa__messages { padding: 9px; }
  .we3d-fa__quick { padding-inline: 8px; }
  .we3d-fa__quick button { padding-inline: 9px; font-size: 10.5px; }
}

@media (prefers-reduced-motion: reduce) {
  .we3d-fa * { scroll-behavior: auto !important; transition: none !important; }
}
