.w2r-ai-trigger.w2r-ai-trigger {
  display: grid;
  flex: 0 0 42px;
  place-items: center;
  width: 42px;
  height: 42px;
  min-height: 42px;
  padding: 1px;
  border: 1px solid var(--w-line);
  border-radius: 9px;
  background: var(--w-soft);
  color: var(--w-accent);
  cursor: pointer;
  transition: background-color .16s, border-color .16s;
}
#w2r-concept .w-search-form .w2r-ai-trigger[hidden] { display: none; }
#w2r-concept .w-search-form .w2r-ai-trigger { flex-basis: 42px; width: 42px; height: 42px; min-height: 42px; background: var(--w-soft); color: var(--w-accent); border: 1px solid var(--w-line); padding: 1px; }
#w2r-concept .w-search-form .w2r-ai-trigger:hover { background: var(--w-panel); border-color: var(--w-accent); }
#w2r-concept .w-search-form .w2r-ai-trigger:active { background: var(--w-soft); border-color: var(--w-accent); }
#w2r-concept .w-search-form .w2r-ai-trigger:focus-visible { outline: 3px solid var(--w-accent); outline-offset: 2px; }
.w2r-ai-art { position: relative; display: block; width: 38px; height: 38px; background: url('/assets/ai-w2r-v3-base.png?v=1') center/contain no-repeat; }
.w2r-ai-art::before {
  content: '';
  position: absolute;
  z-index: 3;
  inset: 0;
  background: conic-gradient(from 0deg at 50% 50%, transparent 0deg 275deg, #eaa077 308deg, #ffc49c 334deg, transparent 360deg);
  -webkit-mask: url('/assets/ai-w2r-v3-contour-mask.png?v=1') center/contain no-repeat;
  mask: url('/assets/ai-w2r-v3-contour-mask.png?v=1') center/contain no-repeat;
  opacity: 0;
  animation: w2r-ai-contour 7s linear infinite;
  pointer-events: none;
}
.w2r-ai-art::after {
  content: '';
  position: absolute;
  z-index: 1;
  inset: 0;
  background: radial-gradient(circle at center, #9f7dd1 8%, #c4a0e2 42%, #ffb183 84%) center/175% 175% no-repeat;
  -webkit-mask: url('/assets/ai-w2r-v2-star-mask.png?v=1') center/contain no-repeat;
  mask: url('/assets/ai-w2r-v2-star-mask.png?v=1') center/contain no-repeat;
  opacity: 0;
  animation: w2r-ai-v2-breathe 7s ease-in-out infinite;
}
.w2r-ai-details { position: absolute; z-index: 2; inset: 0; width: 100%; height: 100%; overflow: visible; }
.w2r-ai-rays line { transform-box: fill-box; transform-origin: center; animation: w2r-ai-ray 7s ease-in-out var(--phase) infinite; }
.w2r-ai-dots circle { animation: w2r-ai-dot 7s ease-in-out var(--phase) infinite; }
@keyframes w2r-ai-ray {
  0%, 100% { transform: scale(.94); }
  24% { transform: scale(1.08); }
  48% { transform: scale(.9); }
  73% { transform: scale(1.1); }
}
@keyframes w2r-ai-dot {
  0%, 100% { opacity: 1; }
  17% { opacity: .95; }
  31% { opacity: .08; }
  45% { opacity: .9; }
  70% { opacity: 1; }
}
@keyframes w2r-ai-contour {
  0%, 67% { opacity: 0; transform: rotate(0deg); }
  70% { opacity: .92; transform: rotate(35deg); }
  91% { opacity: .92; transform: rotate(360deg); }
  94%, 100% { opacity: 0; transform: rotate(360deg); }
}
@keyframes w2r-ai-v2-breathe {
  0%, 100% { opacity: 0; background-size: 175% 175%; }
  28% { opacity: .52; background-size: 130% 130%; }
  50% { opacity: .96; background-size: 105% 105%; }
  72% { opacity: .52; background-size: 130% 130%; }
}
.w2r-ai-dialog {
  color-scheme: light dark;
  width: min(620px, calc(100vw - 32px));
  height: min(680px, calc(100dvh - 32px));
  max-width: none;
  max-height: none;
  padding: 0;
  border: 1px solid var(--w-line);
  border-radius: 18px;
  background: var(--w-panel);
  color: var(--w-text);
  box-shadow: 0 20px 60px #11294233;
  font-size: 16px;
  line-height: 1.5;
}
.w2r-ai-dialog::backdrop { background: #11294299; }
.w2r-ai-dialog *, .w2r-ai-dialog *::before, .w2r-ai-dialog *::after { box-sizing: border-box; }
.w2r-ai-panel { display: flex; flex-direction: column; height: 100%; min-height: 0; }
.w2r-ai-header { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px 20px; border-bottom: 1px solid var(--w-line); }
.w2r-ai-brand { display: flex; align-items: center; gap: 9px; min-width: 0; }
.w2r-ai-brand-mark { display: block; flex: none; width: 28px; height: 28px; object-fit: contain; }
.w2r-ai-header h2 { margin: 0; font-size: 19px; font-weight: 600; line-height: 1.3; }
.w2r-ai-close { flex: none; width: 44px; height: 44px; padding: 0; border: 1px solid var(--w-line); border-radius: 12px; background: var(--w-panel); color: var(--w-accent); font: inherit; font-size: 27px; line-height: 1; cursor: pointer; }
.w2r-ai-close:hover { background: var(--w-soft); }
.w2r-ai-messages { flex: 1; min-height: 0; display: flex; flex-direction: column; align-items: flex-start; gap: 12px; overflow-y: auto; padding: 20px; overscroll-behavior: contain; }
.w2r-ai-message { max-width: 85%; padding: 12px 15px; border: 1px solid var(--w-line); border-radius: 14px; background: var(--w-soft); line-height: 1.45; overflow-wrap: anywhere; white-space: pre-wrap; }
.w2r-ai-message-user { align-self: flex-end; border-color: var(--w-accent); background: var(--w-accent); color: var(--w-on); }
.w2r-ai-composer { flex: none; display: flex; align-items: flex-end; gap: 10px; padding: 14px 20px; border-top: 1px solid var(--w-line); background: var(--w-panel); }
.w2r-ai-composer textarea { flex: 1; min-width: 0; min-height: 44px; max-height: 140px; padding: 11px 12px; resize: vertical; border: 1px solid var(--w-line); border-radius: 10px; background: var(--w-bg); color: var(--w-text); font: inherit; font-size: 16px; line-height: 1.3; }
.w2r-ai-composer textarea::placeholder { color: var(--w-muted); opacity: 1; }
.w2r-ai-send { flex: none; min-height: 44px; padding: 11px 16px; border: 0; border-radius: 9px; background: var(--w-accent); color: var(--w-on); font: inherit; font-size: 13px; cursor: pointer; }
.w2r-ai-send:hover { filter: brightness(.93); }
.w2r-ai-dialog :focus-visible { outline: 2px solid var(--w-accent); outline-offset: 2px; }
.w2r-ai-visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
@media (max-width: 600px) {
  .w2r-ai-art { width: 36px; height: 36px; }
  #w2r-concept .w-search-form .w2r-ai-trigger { flex-basis: 40px; width: 40px; height: 40px; min-height: 40px; }
  #w2r-concept .w-search-form.w2r-ai-search { gap: 6px; }
  .w2r-ai-dialog { width: 100vw; height: 100dvh; margin: 0; border: 0; border-radius: 0; }
  .w2r-ai-header { padding: 12px 16px; }
  .w2r-ai-header h2 { font-size: 17px; }
  .w2r-ai-messages { padding: 16px; }
  .w2r-ai-composer { padding: 10px 12px max(10px, env(safe-area-inset-bottom)); }
  .w2r-ai-send { padding-inline: 12px; }
}
@media (prefers-reduced-motion: reduce) {
  .w2r-ai-art::before, .w2r-ai-art::after { animation: none; opacity: 0; }
  .w2r-ai-rays line, .w2r-ai-dots circle { animation: none; }
}
