/* assistant.css · Legend widget. Uses the site tokens from pages.css / index.html. */
.lg { position: fixed; right: 1.1rem; bottom: 1.1rem; z-index: 45; font-family: var(--sc-font-text, Inter, system-ui, sans-serif); }
.lg__fab { display: inline-flex; align-items: center; gap: 0.55em; background: var(--sc-ink, #1d1c22); color: var(--sc-canvas, #f7f4ee); border: 0; border-radius: 999px; padding: 0.8rem 1.15rem 0.8rem 1rem; cursor: pointer; box-shadow: 0 10px 30px rgba(0,0,0,0.18); font-size: 0.76rem; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; transition: transform 160ms ease, background 160ms ease; }
.lg__fab svg { width: 1.15rem; height: 1.15rem; }
.lg__fab:hover { background: var(--sc-accent, #b4472b); color: var(--sc-accent-ink, #fff); transform: translateY(-1px); }
.lg__fab:focus-visible { outline: 2px solid var(--sc-accent, #b4472b); outline-offset: 3px; }
.lg.is-open .lg__fab { display: none; }

.lg__panel { position: fixed; right: 1.1rem; bottom: 1.1rem; width: min(24rem, calc(100vw - 2.2rem)); height: min(34rem, calc(100vh - 2.2rem)); display: flex; flex-direction: column; background: var(--sc-canvas, #f7f4ee); color: var(--sc-ink, #1d1c22); border: 1px solid var(--sc-hairline-strong, rgba(0,0,0,0.18)); border-radius: 14px; box-shadow: 0 24px 60px rgba(0,0,0,0.22); overflow: hidden; }
.lg__panel[hidden] { display: none; }
.lg__head { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; padding: 0.9rem 1rem 0.8rem 1.1rem; border-bottom: 1px solid var(--sc-hairline, rgba(0,0,0,0.12)); }
.lg__title { display: block; font-family: var(--sc-font-display, "Playfair Display", Georgia, serif); font-weight: 600; font-size: 1.15rem; line-height: 1.1; }
.lg__sub { display: block; font-size: 0.68rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--sc-ink-soft, #67666e); margin-top: 0.2rem; }
.lg__close { background: transparent; border: 1px solid var(--sc-hairline-strong, rgba(0,0,0,0.18)); border-radius: 50%; width: 2.1rem; height: 2.1rem; display: grid; place-items: center; cursor: pointer; color: inherit; }
.lg__close svg { width: 1rem; height: 1rem; }
.lg__close:hover { border-color: var(--sc-accent, #b4472b); color: var(--sc-accent, #b4472b); }

.lg__log { flex: 1; overflow-y: auto; padding: 1rem 1rem 0.5rem; display: flex; flex-direction: column; gap: 0.6rem; scroll-behavior: smooth; }
.lg__m { max-width: 88%; }
.lg__m p { margin: 0; padding: 0.65rem 0.85rem; border-radius: 12px; font-size: 0.95rem; line-height: 1.5; white-space: pre-wrap; }
.lg__m--a { align-self: flex-start; }
.lg__m--a p { background: var(--sc-surface, #fff); border: 1px solid var(--sc-hairline, rgba(0,0,0,0.12)); border-top-left-radius: 4px; }
.lg__m--u { align-self: flex-end; }
.lg__m--u p { background: var(--sc-ink, #1d1c22); color: var(--sc-canvas, #f7f4ee); border-top-right-radius: 4px; }
.lg__m--wait p { color: var(--sc-ink-soft, #67666e); font-style: italic; }
.lg__acts { display: flex; flex-wrap: wrap; gap: 0.45rem; margin-top: 0.5rem; }
.lg__act { display: inline-flex; align-items: center; background: var(--sc-accent, #b4472b); color: var(--sc-accent-ink, #fff); text-decoration: none; border-radius: 999px; padding: 0.5rem 0.9rem; font-size: 0.72rem; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; }
.lg__act--ghost { background: transparent; color: var(--sc-ink, #1d1c22); border: 1px solid var(--sc-hairline-strong, rgba(0,0,0,0.18)); }
.lg__act:hover { filter: brightness(0.95); }

.lg__chips { display: flex; flex-wrap: wrap; gap: 0.4rem; padding: 0 1rem 0.5rem; }
.lg__chips:empty { display: none; }
.lg__chip { background: transparent; border: 1px solid var(--sc-hairline-strong, rgba(0,0,0,0.18)); color: var(--sc-ink, #1d1c22); border-radius: 999px; padding: 0.4rem 0.75rem; font-size: 0.8rem; cursor: pointer; text-align: left; }
.lg__chip:hover { border-color: var(--sc-accent, #b4472b); color: var(--sc-accent, #b4472b); }

.lg__form { display: flex; align-items: flex-end; gap: 0.5rem; padding: 0.6rem 0.8rem 0.4rem; border-top: 1px solid var(--sc-hairline, rgba(0,0,0,0.12)); }
.lg__form textarea { flex: 1; min-width: 0; min-height: 2.7rem; height: 2.7rem; resize: none; border: 1px solid var(--sc-hairline-strong, rgba(0,0,0,0.18)); border-radius: 10px; padding: 0.6rem 0.75rem; font: inherit; font-size: 0.95rem; line-height: 1.4; background: var(--sc-surface, #fff); color: inherit; max-height: 120px; }
.lg__form textarea:focus-visible { outline: 2px solid var(--sc-accent, #b4472b); outline-offset: 1px; }
.lg__send { background: var(--sc-ink, #1d1c22); color: var(--sc-canvas, #f7f4ee); border: 0; border-radius: 10px; padding: 0.7rem 0.95rem; font-size: 0.72rem; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; cursor: pointer; }
.lg__send[disabled] { opacity: 0.55; cursor: wait; }
.lg__note { margin: 0; padding: 0 1rem 0.75rem; font-size: 0.7rem; line-height: 1.4; color: var(--sc-ink-soft, #67666e); }
.lg__sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

html.lg-lock, html.lg-lock body { overflow: hidden; }
@media (max-width: 900px) { html.lg-lock body { position: fixed; left: 0; right: 0; width: 100%; } }
.lg__log { overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
.lg__ts { position: absolute; left: 0.8rem; bottom: 4.6rem; z-index: 1; }
.lg__ts:empty { display: none; }
@media (max-width: 900px) {
  .lg { right: 0.9rem; bottom: calc(4.3rem + env(safe-area-inset-bottom, 0px)); }
  .lg__fab-l { display: none; }
  .lg__fab { padding: 0.85rem; border-radius: 50%; }
  .lg.is-open { z-index: 100; }
  .lg__panel { right: 0; bottom: 0; left: 0; width: 100vw; height: 100dvh; border-radius: 0; border: 0; z-index: 100; }
  .lg__head { padding-top: calc(0.9rem + env(safe-area-inset-top, 0px)); }
  .lg__close { width: 2.5rem; height: 2.5rem; }
}
.lg__nudge { position: absolute; right: 0; bottom: calc(100% + 0.7rem); width: max-content; max-width: min(17rem, calc(100vw - 2.2rem)); display: flex; align-items: flex-start; gap: 0.4rem; background: var(--sc-surface, #fff); color: var(--sc-ink, #1d1c22); border: 1px solid var(--sc-hairline-strong, rgba(0,0,0,0.18)); border-radius: 12px; padding: 0.7rem 0.6rem 0.7rem 0.85rem; box-shadow: 0 14px 34px rgba(0,0,0,0.16); font-size: 0.86rem; line-height: 1.45; opacity: 0; transform: translateY(6px); transition: opacity 320ms ease, transform 320ms ease; }
.lg__nudge::after { content: ""; position: absolute; right: 1.35rem; bottom: -6px; width: 10px; height: 10px; background: inherit; border-right: 1px solid var(--sc-hairline-strong, rgba(0,0,0,0.18)); border-bottom: 1px solid var(--sc-hairline-strong, rgba(0,0,0,0.18)); transform: rotate(45deg); }
.lg__nudge.is-in { opacity: 1; transform: translateY(0); }
.lg__nudge-open { flex: 1; background: none; border: 0; padding: 0; margin: 0; font: inherit; color: inherit; text-align: left; cursor: pointer; }
.lg__nudge-x { flex: none; background: none; border: 0; padding: 0 0.15rem; margin: -0.2rem 0 0; font-size: 1.15rem; line-height: 1; color: var(--sc-ink-soft, #67666e); cursor: pointer; }
.lg__nudge-x:hover { color: var(--sc-accent, #b4472b); }
.lg__fab--pulse { animation: lg-pulse 1.6s ease-out 2; }
@keyframes lg-pulse { 0% { box-shadow: 0 10px 30px rgba(0,0,0,0.18), 0 0 0 0 rgba(180,71,43,0.55); } 70% { box-shadow: 0 10px 30px rgba(0,0,0,0.18), 0 0 0 14px rgba(180,71,43,0); } 100% { box-shadow: 0 10px 30px rgba(0,0,0,0.18), 0 0 0 0 rgba(180,71,43,0); } }
@media (prefers-reduced-motion: reduce) { .lg__fab { transition: none; } .lg__log { scroll-behavior: auto; } .lg__fab--pulse { animation: none; } .lg__nudge { transition: none; transform: none; } }
