:root {
  --nlq-widget-size: 56px;
  --nlq-widget-radius: 18px;
  --nlq-widget-shadow: 0 20px 40px rgba(15, 23, 42, 0.2);
  --nlq-widget-panel-width: min(40vw, 640px);
  --nlq-widget-panel-height: min(70vh, 620px);
  --nlq-widget-gap: 12px;
  --nlq-widget-border: var(--ta-border, #e2e8f0);
  --nlq-widget-surface: var(--ta-surface, #ffffff);
  --nlq-widget-accent: var(--ta-brand-500, #12e3c4);
}

.nlq-widget {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 2100;
  display: flex;
  flex-direction: column-reverse;
  align-items: flex-end;
  gap: var(--nlq-widget-gap);
  pointer-events: none;
}

.nlq-widget__toggle,
.nlq-widget__panel {
  pointer-events: auto;
}

.nlq-widget__toggle {
  width: var(--nlq-widget-size);
  height: var(--nlq-widget-size);
  border-radius: 999px;
  border: none;
  background: var(--nlq-widget-accent);
  color: #0f172a;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--nlq-widget-shadow);
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.nlq-widget__toggle:hover {
  transform: translateY(-2px);
  box-shadow: 0 24px 45px rgba(15, 23, 42, 0.25);
}

.nlq-widget__panel {
  width: var(--nlq-widget-panel-width);
  height: var(--nlq-widget-panel-height);
  background: var(--nlq-widget-surface);
  border: 1px solid var(--nlq-widget-border);
  border-radius: var(--nlq-widget-radius);
  box-shadow: var(--nlq-widget-shadow);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.nlq-widget__panel[hidden] {
  display: none;
}

.nlq-widget__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  background: var(--ta-bg, #f8fafc);
  border-bottom: 1px solid var(--nlq-widget-border);
}

.nlq-widget__title {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  color: var(--ta-text, #0f172a);
}

.nlq-widget__minimize {
  background: transparent;
  border: none;
  color: var(--ta-text, #0f172a);
  padding: 6px;
  border-radius: 8px;
  cursor: pointer;
}

.nlq-widget__minimize:hover {
  background: rgba(15, 23, 42, 0.08);
}

.nlq-widget__body {
  flex: 1;
  background: var(--nlq-widget-surface);
}

.nlq-widget__frame {
  width: 100%;
  height: 100%;
}

.nlq-widget__iframe {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}

.nlq-widget__toggle .material-symbols-rounded,
.nlq-widget__minimize .material-symbols-rounded,
.nlq-widget__title .material-symbols-rounded {
  font-size: 24px;
}

.nlq-widget__toggle:focus-visible,
.nlq-widget__minimize:focus-visible {
  outline: 2px solid var(--secondary-500, #1fb6ff);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  .nlq-widget__toggle {
    transition: none;
  }
}

@media (max-width: 767px) {
  .nlq-widget {
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    align-items: stretch;
    gap: 0;
  }

  .nlq-widget__panel {
    width: 100%;
    height: 100%;
    border-radius: 0;
  }

  .nlq-widget__toggle {
    position: absolute;
    right: 16px;
    bottom: 16px;
  }
}
