/* Luna Rosa Assistant — the moon-window launcher and the plaster panel. */

.lra { position: fixed; right: max(1.25rem, env(safe-area-inset-right)); bottom: max(1.25rem, env(safe-area-inset-bottom)); z-index: 150; font: 400 1rem/1.5 var(--lr-text, "LR Barlow", system-ui, sans-serif); color: var(--lr-ink, #2a1216); --lra-ease: cubic-bezier(0.23, 1, 0.32, 1); }
.lra *, .lra *::before, .lra *::after { box-sizing: border-box; }
.lra-sr { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.lra :focus-visible { outline: 2px solid var(--lr-wine-600, #590a22); outline-offset: 2px; }

/* Launcher: a moon window with the restaurant's wine and gold */
.lra-launcher {
	position: relative; display: inline-flex; align-items: center; gap: 0.6rem; min-height: 58px; padding: 0 1.25rem 0 0.4rem;
	border: 0; border-radius: 999px; background: var(--lr-wine-700, #4d091e); color: var(--lr-cream, #fbf4ea); cursor: pointer;
	box-shadow: 0 14px 30px -12px rgba(30, 3, 10, 0.7), inset 0 0 0 1px rgba(235, 214, 155, 0.35);
	font: 600 0.8rem/1 var(--lr-text, system-ui); letter-spacing: 0.12em; text-transform: uppercase;
	transition: transform 160ms var(--lra-ease), box-shadow 200ms ease;
}
.lra-launcher:active { transform: scale(0.96); }
.lra-launcher:focus-visible { outline-color: var(--lr-gold-500, #d2b25a); outline-offset: 3px; }
.lra-launcher__moon { width: 48px; height: 48px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; background: var(--lr-gold-500, #d2b25a); color: var(--lr-wine-900, #2b0710); box-shadow: inset 0 0 0 4px var(--lr-gold-500, #d2b25a), inset 0 0 0 5px rgba(43, 7, 16, 0.35); }
.lra-launcher__moon svg { width: 22px; height: 22px; }
.lra-launcher__dot { position: absolute; top: 4px; left: 40px; width: 12px; height: 12px; border-radius: 50%; background: #e2463f; box-shadow: 0 0 0 2px var(--lr-wine-700, #4d091e); }
.lra-launcher__dot[hidden] { display: none; }
.lra.is-open .lra-launcher { display: none; }
@media (hover: hover) and (pointer: fine) { .lra-launcher:hover { box-shadow: 0 18px 36px -12px rgba(30, 3, 10, 0.75), inset 0 0 0 1px rgba(235, 214, 155, 0.7); } }
@media (max-width: 640px) {
	.lra { right: max(0.85rem, env(safe-area-inset-right)); bottom: max(0.85rem, env(safe-area-inset-bottom)); }
	.lra-launcher { padding: 0 0.4rem; min-height: 56px; }
	.lra-launcher__text { display: none; }
}

/* Panel */
.lra-panel {
	position: absolute; right: 0; bottom: 0; width: min(410px, calc(100vw - 2.5rem)); height: min(640px, calc(100dvh - 7rem));
	display: flex; flex-direction: column; overflow: hidden;
	background: var(--lr-plaster, #f6efe4); border-radius: 14px 14px 4px 4px;
	box-shadow: 0 30px 70px -20px rgba(30, 3, 10, 0.55), 0 0 0 1px rgba(89, 10, 34, 0.12);
	opacity: 0; transform: translateY(12px) scale(0.98); transform-origin: bottom right;
	transition: opacity 220ms var(--lra-ease), transform 260ms var(--lra-ease);
}
.lra-panel[hidden] { display: none; }
.lra-panel.is-in { opacity: 1; transform: none; }
@media (max-width: 640px) {
	.lra-panel { position: fixed; inset: 0; width: 100vw; height: 100dvh; border-radius: 0; padding-bottom: env(safe-area-inset-bottom); }
	html.lra-locked, html.lra-locked body { overflow: hidden; }
}

.lra-head { display: flex; align-items: center; gap: 0.75rem; padding: 0.85rem 0.85rem 0.85rem 1rem; background: var(--lr-wine-700, #4d091e); color: var(--lr-cream, #fbf4ea); }
.lra-head :focus-visible { outline-color: var(--lr-gold-500, #d2b25a); }
.lra-mark { flex: none; width: 40px; height: 40px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; background: var(--lr-plaster, #f6efe4); color: var(--lr-wine-700, #4d091e); font: 600 1rem/1 var(--lr-display, Georgia, serif); letter-spacing: -0.04em; box-shadow: inset 0 0 0 3px var(--lr-plaster, #f6efe4), inset 0 0 0 4px var(--lr-gold-500, #d2b25a); }
.lra-titles { flex: 1; min-width: 0; }
.lra-title { margin: 0; font: 600 1.15rem/1.2 var(--lr-display, Georgia, serif); color: var(--lr-cream, #fbf4ea); }
.lra-sub { margin: 0.1rem 0 0; font-size: 0.82rem; color: var(--lr-cream-2, #e8d3ca); }
.lra-iconbtn { flex: none; width: 44px; height: 44px; display: inline-flex; align-items: center; justify-content: center; border: 0; border-radius: 6px; background: transparent; color: inherit; cursor: pointer; transition: background-color 160ms ease, transform 160ms var(--lra-ease); }
.lra-iconbtn:active { transform: scale(0.94); }
.lra-head .lra-iconbtn { border: 1px solid rgba(251, 244, 234, 0.3); }
@media (hover: hover) and (pointer: fine) { .lra-head .lra-iconbtn:hover { background: rgba(251, 244, 234, 0.12); } }

.lra-bar { display: flex; align-items: center; gap: 0.4rem; padding: 0.5rem 0.75rem; border-bottom: 1px solid rgba(89, 10, 34, 0.12); background: var(--lr-plaster-2, #ece1cf); }
.lra-chipbtn { display: inline-flex; align-items: center; gap: 0.35rem; min-height: 36px; padding: 0.3rem 0.7rem; border: 1px solid rgba(89, 10, 34, 0.25); border-radius: 4px; background: transparent; color: var(--lr-ink, #2a1216); font: 600 0.74rem/1 var(--lr-text, system-ui); letter-spacing: 0.08em; text-transform: uppercase; cursor: pointer; }
.lra-chipbtn svg { width: 16px; height: 16px; }
.lra-reset { margin-left: auto; }
.lra-bar .lra-iconbtn { width: 36px; height: 36px; color: var(--lr-ink-2, #5b3e44); border: 1px solid transparent; }
.lra-bar .lra-iconbtn svg { width: 18px; height: 18px; }
.lra-toggle[aria-pressed="true"] { background: var(--lr-wine-600, #590a22); color: var(--lr-cream, #fbf4ea) !important; }
@media (hover: hover) and (pointer: fine) { .lra-chipbtn:hover, .lra-bar .lra-iconbtn:hover { border-color: var(--lr-wine-600, #590a22); } }

.lra-log { flex: 1; overflow-y: auto; padding: 1rem 0.9rem 0.5rem; display: flex; flex-direction: column; gap: 0.7rem; overscroll-behavior: contain; scrollbar-width: thin; }
.lra-msg { display: flex; flex-direction: column; max-width: 88%; }
.lra-msg--bot { align-self: flex-start; }
.lra-msg--user { align-self: flex-end; align-items: flex-end; }
.lra-msg.is-new { animation: lra-in 260ms var(--lra-ease) both; }
@keyframes lra-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.lra-bubble { padding: 0.65rem 0.85rem; border-radius: 12px; font-size: 0.97rem; line-height: 1.5; overflow-wrap: anywhere; }
.lra-msg--bot .lra-bubble { background: #fffaf3; color: var(--lr-ink, #2a1216); border-top-left-radius: 3px; box-shadow: 0 1px 0 rgba(89, 10, 34, 0.08), 0 0 0 1px rgba(89, 10, 34, 0.08); }
.lra-msg--user .lra-bubble { background: var(--lr-wine-600, #590a22); color: var(--lr-cream, #fbf4ea); border-top-right-radius: 3px; }
.lra-bubble p { margin: 0; }
.lra-bubble p + p, .lra-bubble p + .lra-list, .lra-bubble .lra-list + p { margin-top: 0.45rem; }
.lra-bubble strong { font-weight: 600; color: var(--lr-wine-700, #4d091e); }
.lra-list { margin: 0.35rem 0 0; padding-left: 1.1rem; }
.lra-list li { margin: 0.15rem 0; }
.lra-fine { font-size: 0.82rem; color: var(--lr-ink-2, #5b3e44); font-style: italic; }
.lra-link { color: var(--lr-wine-600, #590a22); text-decoration: underline; text-underline-offset: 0.18em; }
.lra-links { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: 0.45rem; }
.lra-linkbtn { display: inline-flex; align-items: center; gap: 0.35rem; min-height: 36px; padding: 0.35rem 0.75rem; border-radius: 4px; background: var(--lr-wine-600, #590a22); color: var(--lr-cream, #fbf4ea); font: 600 0.78rem/1.2 var(--lr-text, system-ui); letter-spacing: 0.04em; text-decoration: none; }
.lra-linkbtn svg { width: 14px; height: 14px; }
@media (hover: hover) and (pointer: fine) { .lra-linkbtn:hover { background: var(--lr-wine-500, #74132f); } }

.lra-typing .lra-bubble { display: inline-flex; gap: 5px; align-items: center; padding: 0.85rem 1rem; }
.lra-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--lr-gold-700, #7a5c1c); opacity: 0.4; animation: lra-dot 1.1s ease-in-out infinite; }
.lra-dot:nth-child(3) { animation-delay: 0.15s; }
.lra-dot:nth-child(4) { animation-delay: 0.3s; }
@keyframes lra-dot { 0%, 100% { opacity: 0.3; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }

.lra-quick { display: flex; gap: 0.4rem; overflow-x: auto; padding: 0.45rem 2rem 0.35rem 0.9rem; scroll-padding: 0 0.9rem; scroll-snap-type: x proximity; scrollbar-width: none; -webkit-mask-image: linear-gradient(90deg, #000 85%, transparent); mask-image: linear-gradient(90deg, #000 85%, transparent); }
.lra-quick__btn { scroll-snap-align: start; }
.lra-quick::-webkit-scrollbar { display: none; }
.lra-quick__btn { flex: none; min-height: 36px; padding: 0.35rem 0.8rem; border: 1px solid rgba(89, 10, 34, 0.3); border-radius: 999px; background: #fffaf3; color: var(--lr-wine-700, #4d091e); font: 600 0.8rem/1.2 var(--lr-text, system-ui); cursor: pointer; white-space: nowrap; transition: background-color 160ms ease, transform 160ms var(--lra-ease); }
.lra-quick__btn:active { transform: scale(0.97); }
.lra-suggest { display: grid; gap: 0.4rem; justify-items: start; margin-top: 0.15rem; }
.lra-suggest__btn { min-height: 40px; padding: 0.45rem 0.85rem; border: 1px dashed rgba(89, 10, 34, 0.35); border-radius: 10px; background: transparent; color: var(--lr-wine-700, #4d091e); font: 500 0.9rem/1.3 var(--lr-text, system-ui); text-align: left; cursor: pointer; transition: background-color 160ms ease, transform 160ms var(--lra-ease); }
.lra-suggest__btn:active { transform: scale(0.98); }
@media (hover: hover) and (pointer: fine) { .lra-suggest__btn:hover { background: #fffaf3; border-style: solid; } }
@media (hover: hover) and (pointer: fine) { .lra-quick__btn:hover { background: var(--lr-wine-600, #590a22); color: var(--lr-cream, #fbf4ea); border-color: var(--lr-wine-600, #590a22); } }

.lra-status { margin: 0; padding: 0 0.9rem; min-height: 0; font-size: 0.85rem; color: var(--lr-wine-600, #590a22); font-weight: 600; }
.lra-status:empty { display: none; }
.lra-form { display: flex; align-items: flex-end; gap: 0.4rem; margin: 0.4rem 0.75rem 0; padding: 0.35rem; border: 1px solid rgba(43, 7, 16, 0.25); border-radius: 10px; background: #fff; }
.lra-form:focus-within { border-color: var(--lr-wine-600, #590a22); box-shadow: 0 0 0 3px rgba(210, 178, 90, 0.45); }
.lra-input::placeholder { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lra-input { flex: 1; min-height: 44px; max-height: 120px; padding: 0.6rem 0.5rem; border: 0; outline: none; resize: none; background: transparent; color: var(--lr-ink, #2a1216); font: 400 1rem/1.4 var(--lr-text, system-ui); }
.lra-input:focus-visible { outline: none; }
.lra-input::placeholder { color: #7a6066; }
.lra-mic { color: var(--lr-ink-2, #5b3e44); }
.lra-mic.is-on { background: #e2463f; color: #fff; animation: lra-pulse 1.4s ease-in-out infinite; }
@keyframes lra-pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(226, 70, 63, 0.45); } 50% { box-shadow: 0 0 0 6px rgba(226, 70, 63, 0); } }
.lra-send { flex: none; width: 44px; height: 44px; display: inline-flex; align-items: center; justify-content: center; border: 0; border-radius: 8px; background: var(--lr-wine-600, #590a22); color: var(--lr-cream, #fbf4ea); cursor: pointer; transition: transform 160ms var(--lra-ease), opacity 160ms ease; }
.lra-send:active { transform: scale(0.94); }
.lra-send:disabled { opacity: 0.5; cursor: wait; }
.lra-note { margin: 0; padding: 0.45rem 0.9rem 0.7rem; font-size: 0.74rem; line-height: 1.4; color: var(--lr-ink-2, #5b3e44); }

@media (prefers-reduced-motion: reduce) {
	.lra-panel, .lra-launcher, .lra-msg.is-new, .lra-dot, .lra-mic.is-on { transition: none !important; animation: none !important; }
	.lra-panel { transform: none; }
}
@media print { .lra { display: none !important; } }
