/* PlainGlow AI assistant: same corner, shape and tokens as the guided helper (assistant.css).
   Set --nl-accent / --nl-ink / --nl-paper and the --nl-radius-* knobs in the template's :root and it blends in.
   With the house bottom panel on the page (body.np-has-dock, set by panel.js) the button and chat sit above the bar. */
.nla {
  --a: var(--nl-accent, #c4643c); --ink: var(--nl-ink, #1d1b19); --paper: var(--nl-paper, #fff);
  --r-btn:   var(--nl-radius-btn, 999px);
  --r-panel: var(--nl-radius-panel, 18px);
  --r-field: var(--nl-radius-field, 11px);
  --nla-bottom: 20px;
}
body.np-has-dock .nla { --nla-bottom: 88px; }   /* a wide bar (long call label) reaches under the open chat even at 1440 */
@media (max-width: 620px)  { .nla { --nla-bottom: 12px; } body.np-has-dock .nla { --nla-bottom: 70px; } }

.nla-fab { position: fixed; right: 20px; bottom: calc(var(--nla-bottom) + env(safe-area-inset-bottom)); z-index: 200;
  display: inline-flex; align-items: center; gap: 9px; background: var(--a); color: #fff; border: none; border-radius: var(--r-btn);
  padding: 14px 20px; font: 600 14.5px/1 inherit; box-shadow: 0 12px 34px rgba(0,0,0,.22); cursor: pointer; transition: transform .18s, opacity .2s; }
.nla-fab:hover { transform: translateY(-2px); }
.nla-fab:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; }
.nla.is-open .nla-fab { opacity: 0; pointer-events: none; }

.nla-panel[hidden] { display: none !important; }
.nla-panel { position: fixed; right: 20px; bottom: calc(var(--nla-bottom) + env(safe-area-inset-bottom)); z-index: 201;
  width: min(380px, calc(100vw - 32px)); height: min(600px, calc(100dvh - var(--nla-bottom) - 110px));   /* clears a fixed site header */
  background: var(--paper); color: var(--ink); border-radius: var(--r-panel); box-shadow: 0 28px 70px rgba(0,0,0,.28), 0 0 0 1px rgba(0,0,0,.05);
  overflow: hidden; display: flex; flex-direction: column; animation: nla-in .22s cubic-bezier(.2,.8,.3,1); }
@keyframes nla-in { from { opacity: 0; transform: translateY(10px) scale(.985); } }

.nla-head { display: flex; align-items: center; gap: 11px; padding: 13px 12px 13px 16px; border-bottom: 1px solid rgba(0,0,0,.08); flex: none; }
.nla-dot { width: 34px; height: 34px; border-radius: 50%; background: var(--a); color: #fff; display: grid; place-items: center; flex: none; }
.nla-dot svg { width: 16px; height: 16px; }
.nla-title { min-width: 0; line-height: 1.25; }
.nla-title b { display: block; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nla-title span { font-size: 12px; opacity: .55; }
.nla-call { margin-left: auto; display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 13px; border-radius: var(--r-btn);
  border: 1.5px solid var(--a); color: var(--a); font: 700 13.5px/1 inherit; text-decoration: none; white-space: nowrap; flex: none; transition: background .16s, color .16s; }
.nla-call:hover { background: var(--a); color: #fff; }
.nla-x { background: none; border: none; font-size: 26px; line-height: 1; opacity: .4; cursor: pointer; color: inherit; padding: 4px 6px; flex: none; }
.nla-head > .nla-title + .nla-x { margin-left: auto; }   /* no phone set: the close button takes the right edge */
.nla-x:hover { opacity: .75; }

.nla-body { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 10px; overscroll-behavior: contain; }
.nla-msg { max-width: 86%; padding: 10px 14px; border-radius: var(--r-field); font-size: 14.5px; line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; }
.nla-bot { background: rgba(0,0,0,.055); border-bottom-left-radius: 4px; align-self: flex-start; }
.nla-bot a { color: var(--a); font-weight: 700; text-decoration: underline; text-underline-offset: 2px; }
.nla-me { background: var(--a); color: #fff; border-bottom-right-radius: 4px; align-self: flex-end; }

.nla-typing { display: inline-flex; gap: 5px; padding: 14px 15px; }
.nla-typing i { width: 7px; height: 7px; border-radius: 50%; background: currentColor; opacity: .35; animation: nla-dot 1.1s infinite ease-in-out; }
.nla-typing i:nth-child(2) { animation-delay: .15s; } .nla-typing i:nth-child(3) { animation-delay: .3s; }
@keyframes nla-dot { 0%, 60%, 100% { transform: none; opacity: .3; } 30% { transform: translateY(-4px); opacity: .7; } }

.nla-chips { display: flex; flex-direction: column; align-items: flex-start; gap: 7px; margin-top: 2px; }
.nla-chip { font: 600 13.5px/1.3 inherit; text-align: left; padding: 9px 14px; border-radius: var(--r-btn); border: 1.5px solid rgba(0,0,0,.14);
  background: var(--paper); color: var(--ink); cursor: pointer; transition: border-color .16s, color .16s; }
.nla-chip:hover { border-color: var(--a); color: var(--a); }

.nla-form { display: flex; align-items: flex-end; gap: 8px; padding: 10px 12px; border-top: 1px solid rgba(0,0,0,.08); flex: none; }
.nla-form textarea { flex: 1; resize: none; font: 400 16px/1.4 inherit; padding: 10px 12px; border: 1.5px solid rgba(0,0,0,.14);
  border-radius: var(--r-field); outline: none; color: var(--ink); background: var(--paper); max-height: 110px; }   /* 16px: no iOS zoom on focus */
.nla-form textarea:focus { border-color: var(--a); }
.nla-form button { border: none; background: var(--a); color: #fff; width: 44px; height: 44px; border-radius: var(--r-field); cursor: pointer; display: grid; place-items: center; flex: none; }
.nla-form button:disabled { opacity: .5; cursor: default; }
.nla-form .nla-add { background: transparent; color: var(--ink); border: 1.5px solid rgba(0,0,0,.14); opacity: .75; transition: border-color .16s, color .16s, opacity .16s; }
.nla-form .nla-add:hover:not(:disabled) { border-color: var(--a); color: var(--a); opacity: 1; }
.nla-form .nla-add:disabled { opacity: .3; }
.nla-form button:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }

/* photos: the tray of photos waiting to go with the next message, and the photos inside a sent bubble */
.nla-tray[hidden] { display: none !important; }
.nla-tray { padding: 10px 12px 0; border-top: 1px solid rgba(0,0,0,.08); flex: none; }
.nla-thumbs { display: flex; gap: 8px; }
.nla-thumbs:empty { display: none; }
.nla-thumb { position: relative; width: 58px; height: 58px; flex: none; }
.nla-thumb img { width: 100%; height: 100%; object-fit: cover; border-radius: var(--r-field); display: block; box-shadow: 0 0 0 1px rgba(0,0,0,.1); }
.nla-rm { position: absolute; top: -7px; right: -7px; width: 24px; height: 24px; border-radius: 50%; border: 2px solid var(--paper);
  background: var(--ink); color: var(--paper); font-size: 16px; line-height: 1; display: grid; place-items: center; cursor: pointer; padding: 0; }
.nla-note { font-size: 12.5px; line-height: 1.35; opacity: .75; }
.nla-note:not(:empty) { padding-top: 6px; }
.nla-tray:not([hidden]) + .nla-form { border-top: none; }
.nla-pics { display: flex; gap: 6px; flex-wrap: wrap; }
.nla-pics img { width: 76px; height: 76px; object-fit: cover; border-radius: calc(var(--r-field) - 3px); display: block; }
.nla-pics:not(:last-child), .nla-pics-label:not(:last-child) { margin-bottom: 7px; }
.nla-pics-label { font-size: 13px; font-weight: 600; opacity: .85; }
.nla-foot { padding: 0 14px 10px; font-size: 11.5px; opacity: .5; text-align: center; flex: none; }

/* teaser: beside the button, never covers the page, never auto-opens */
.nla-teaser { position: fixed; right: 20px; bottom: calc(var(--nla-bottom) + 58px + env(safe-area-inset-bottom)); z-index: 200; max-width: min(280px, calc(100vw - 40px));
  display: flex; align-items: flex-start; gap: 6px; background: var(--paper); color: var(--ink);
  border-radius: var(--r-panel); padding: 12px 10px 12px 15px; font-size: 14px; line-height: 1.45;
  box-shadow: 0 14px 40px rgba(0,0,0,.18); border: 1px solid rgba(0,0,0,.07);
  opacity: 0; transform: translateY(8px); transition: opacity .45s ease, transform .45s ease; pointer-events: none; }
.nla-teaser.in { opacity: 1; transform: none; pointer-events: auto; }
.nla-teaser span { cursor: pointer; }
.nla-tx { background: none; border: none; font-size: 17px; line-height: 1; opacity: .35; cursor: pointer; color: inherit; padding: 0 2px; }
.nla-tx:hover { opacity: .7; }

@media (max-width: 620px) {
  .nla-fab { right: 12px; }
  .nla-teaser { right: 12px; }
  .nla-panel { right: 8px; left: 8px; width: auto; height: calc(100dvh - var(--nla-bottom) - 16px - env(safe-area-inset-bottom)); max-height: 640px; }
}
/* budget fallback: the guided helper (assistant.css) takes the corner; keep it clear of the house bottom bar too */
body.nla-fallback.np-has-dock .nl-fab, body.nla-fallback.np-has-dock .nl-panel { bottom: calc(88px + env(safe-area-inset-bottom)); }
body.nla-fallback.np-has-dock .nl-teaser { bottom: calc(146px + env(safe-area-inset-bottom)); }
@media (max-width: 620px) {
  body.nla-fallback.np-has-dock .nl-fab, body.nla-fallback.np-has-dock .nl-panel { bottom: calc(70px + env(safe-area-inset-bottom)); }
  body.nla-fallback.np-has-dock .nl-teaser { bottom: calc(126px + env(safe-area-inset-bottom)); }
}

@media (prefers-reduced-motion: reduce) { .nla-panel { animation: none; } .nla-typing i { animation: none; opacity: .5; } }
