/* The question box of the home page (pages/landing loads this sheet; landing.css holds the rest of the page): white
   and rounded, its button a violet pill (lavender until the question is long enough), the typing ghost of the example
   questions (js/hero.js) and the Examples menu. */

.lx-ask { --menu-h: 316px; position: relative; z-index: 4; width: min(100%, 760px); margin: clamp(20px, 4svh, 36px) auto 0; }
.lx-composer { position: relative; display: flex; flex-direction: column; border-radius: 6px; background: #fff; color: var(--ink); caret-color: var(--vi-violet); text-align: left; box-shadow: none; transition: box-shadow .2s, border-radius .2s; }
.lx-composer:focus-within { box-shadow: none; }
.lx-composer:has(.lx-prompts[open]) { border-bottom-left-radius: 0; border-bottom-right-radius: 0; }
.lx-composer__field { position: relative; }
.lx-composer textarea, .lx-ghost { padding: 22px 22px 6px; font-size: 18px; line-height: 1.45; }
.lx-composer textarea { display: block; width: 100%; min-height: clamp(56px, 11svh, 100px); max-height: 260px; border: 0; outline: 0; resize: none; background: transparent; color: var(--ink); field-sizing: content; }
.lx-composer textarea::placeholder { color: #666b7a; }
.lx-ghost { position: absolute; inset: 0; display: none; overflow: hidden; color: #666b7a; white-space: pre-wrap; pointer-events: none; }
.lx-ghost i { display: inline-block; width: 2px; height: 1.1em; margin-left: 2px; vertical-align: -.2em; background: var(--vi-violet); }
.lx-composer.is-typing textarea::placeholder { color: transparent; }
.lx-composer.is-typing textarea:placeholder-shown + .lx-ghost { display: block; }
.lx-composer__bar { display: flex; align-items: center; gap: 6px; padding: 8px 10px 10px 12px; }
.lx-composer .dictation-button { width: 40px; height: 40px; border-radius: 6px; color: var(--vi-muted); }
.lx-composer .dictation-button:hover { background: var(--vi-mist); color: var(--vi-ink); }
.lx-composer .dictation-panel { margin: 0 12px 12px; text-align: left; }
.lx-send { display: inline-flex; align-items: center; gap: 8px; flex: none; height: 42px; padding: 0 16px 0 18px; border: 0; border-radius: 6px; background: var(--vi-violet); color: #fff; font: 600 15px/1 var(--vi-body); transition: background .2s; }
.lx-send:hover { background: #3424d6; }
.lx-composer:has(textarea:invalid) .lx-send { background: var(--vi-lavender); }
.lx-busy { border-radius: 6px; background: rgba(36, 28, 150, .94); }
.lx-busy .ring { border-top-color: var(--vi-lavender); }
.lx-prompts { position: static; margin-right: auto; }
.lx-prompts summary { display: inline-flex; align-items: center; gap: 7px; height: 38px; padding: 0 12px; border-radius: 6px; font-size: 14px; font-weight: 600; color: var(--vi-ink); list-style: none; cursor: pointer; user-select: none; }
.lx-prompts summary::-webkit-details-marker { display: none; }
.lx-prompts summary:hover, .lx-prompts[open] summary { background: var(--vi-mist); }
.lx-prompts summary .icon:first-child { color: var(--vi-violet); }
.lx-prompts summary .icon:last-child { color: var(--vi-muted); transition: transform .2s; }
.lx-prompts[open] summary .icon:last-child { transform: rotate(180deg); }
.lx-prompts__panel { position: absolute; top: 100%; left: 0; right: 0; z-index: 30; display: flex; flex-direction: column; height: var(--menu-h); padding: 4px 8px 8px; border-top: 1px solid var(--fr-rule); border-radius: 0 0 6px 6px; background: #fff; text-align: left; box-shadow: none; }
.lx-prompts__head { margin: 0; padding: 12px 12px 6px; font: 500 11.5px/1.4 var(--sans); color: var(--vi-muted); }
.lx-prompts__list { flex: 1; min-height: 0; display: grid; align-content: start; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; }
.lx-prompt { display: grid; grid-template-columns: 120px minmax(0, 1fr); align-items: baseline; gap: 12px; padding: 9px 12px; border: 0; border-radius: 6px; background: transparent; font-size: 14px; line-height: 1.35; color: var(--vi-ink); text-align: left; }
.lx-prompt:hover, .lx-prompt:focus-visible { background: var(--vi-mist); }
.lx-prompt__topic { font: 500 11.5px/1.4 var(--sans); color: var(--vi-violet); }

/* ---------- Motion: one entrance and a caret. None with reduced motion. */
@media (prefers-reduced-motion: no-preference) {
  .lx-ask { animation: vi-rise .8s cubic-bezier(.2, .7, .2, 1) .14s both; }
  .lx-ghost i { animation: vi-caret 1.05s steps(1) infinite; }
  .lx-prompts[open] .lx-prompts__panel { animation: vi-drop .24s cubic-bezier(.2, .7, .2, 1); }
}
@keyframes vi-rise { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
@keyframes vi-caret { 0%, 100% { opacity: 1; } 50% { opacity: 0; } }
@keyframes vi-drop { from { clip-path: inset(0 0 100% 0); } to { clip-path: inset(0 0 0 0); } }

@media (max-width: 720px) {
  .lx-ask { margin-top: 28px; --menu-h: 330px; }
  .lx-composer textarea, .lx-ghost { padding: 18px 18px 4px; font-size: 17px; }
  .lx-prompt { grid-template-columns: 1fr; gap: 2px; padding: 10px 12px; }
  .lx-send span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .lx-send { width: 44px; padding: 0; justify-content: center; }
}
