/* Linden AI — visually aligned with the portfolio's midnight / electric-blue palette. */
#linden-ai{--lai-bg:rgba(8,13,29,.97);--lai-panel:#0c1429;--lai-line:rgba(128,163,235,.18);--lai-text:#edf3ff;--lai-muted:#98a8c8;--lai-blue:#3978ff;--lai-cyan:#65d8ff;position:relative;z-index:80;font-family:Sora,system-ui,-apple-system,"Segoe UI",sans-serif;color:var(--lai-text)}
#linden-ai *{box-sizing:border-box}
#linden-ai button,#linden-ai input,#linden-ai textarea,#linden-ai select{font:inherit}
#linden-ai button:focus-visible,#linden-ai input:focus-visible,#linden-ai textarea:focus-visible,#linden-ai select:focus-visible{outline:2px solid var(--lai-cyan);outline-offset:3px}
.lai-launcher{position:fixed;right:max(22px,env(safe-area-inset-right));bottom:max(22px,env(safe-area-inset-bottom));z-index:81;display:flex;align-items:center;gap:11px;padding:8px 17px 8px 8px;border:1px solid rgba(116,190,255,.5);border-radius:999px;color:#f4f8ff;background:linear-gradient(135deg,rgba(13,26,56,.97),rgba(7,12,28,.97));box-shadow:0 8px 34px rgba(0,0,0,.38),0 0 26px rgba(47,107,255,.2);cursor:pointer;transition:transform .2s,border-color .2s,box-shadow .2s}
.lai-launcher:hover{transform:translateY(-3px);border-color:var(--lai-cyan);box-shadow:0 12px 38px rgba(0,0,0,.42),0 0 30px rgba(47,107,255,.3)}
.lai-launcher-label{font-size:12px;font-weight:700;letter-spacing:.01em}

/* BETA 16: hanging message badge attached to the robot launcher. */
.lai-launcher{position:fixed}
.lai-launcher-orb{position:relative;z-index:1}
.lai-hanging-message{position:absolute;z-index:2;left:35px;top:42px;width:27px;height:27px;display:grid;place-items:center;border:1px solid rgba(125,224,255,.9);border-radius:9px 9px 9px 3px;background:linear-gradient(145deg,#173b69,#08162d);box-shadow:0 4px 13px rgba(0,0,0,.42),0 0 13px rgba(90,209,255,.3);transform:rotate(9deg);pointer-events:none}
.lai-hanging-message:before{content:"";position:absolute;width:1.5px;height:10px;left:5px;top:-9px;background:linear-gradient(#8deaff,#4d9dff);transform:rotate(-25deg);transform-origin:bottom}
.lai-hanging-message svg{width:16px;height:16px;fill:none;stroke:#a8edff;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round}
.lai-launcher:hover .lai-hanging-message{box-shadow:0 4px 16px rgba(0,0,0,.48),0 0 18px rgba(90,209,255,.5)}

.lai-launcher-orb,.lai-avatar{display:grid;place-items:center;flex:0 0 auto;width:43px;height:43px;border:1px solid rgba(122,211,255,.65);border-radius:50%;background:radial-gradient(circle at 35% 25%,#285a9b,#101c3d 68%,#080e20);box-shadow:inset 0 0 14px rgba(90,209,255,.18),0 0 18px rgba(47,107,255,.28)}
.lai-robot-face{position:relative;display:flex;align-items:center;justify-content:center;gap:7px;width:25px;height:19px;border:1.5px solid #91dfff;border-radius:8px;background:linear-gradient(145deg,#152c52,#071327);box-shadow:0 0 8px rgba(90,209,255,.32)}
.lai-robot-face:before{content:"";position:absolute;top:-6px;left:50%;width:1px;height:5px;background:#91dfff}.lai-robot-face:after{content:"";position:absolute;top:-8px;left:calc(50% - 2px);width:4px;height:4px;border-radius:50%;background:#91dfff;box-shadow:0 0 7px #65d8ff}
.lai-robot-face i{display:block;width:4px;height:5px;border-radius:50%;background:#8ce8ff;box-shadow:0 0 5px #65d8ff}.lai-robot-face b{position:absolute;bottom:3px;left:50%;width:7px;height:2px;transform:translateX(-50%);border-radius:4px;background:#579cff}
.lai-panel{position:fixed;right:max(22px,env(safe-area-inset-right));bottom:calc(max(22px,env(safe-area-inset-bottom)) + 65px);z-index:82;display:flex;flex-direction:column;width:min(390px,calc(100vw - 28px));height:min(620px, min(78dvh,calc(100dvh - 112px)));min-height:390px;overflow:hidden;border:1px solid rgba(119,166,245,.3);border-radius:23px;background:var(--lai-bg);box-shadow:0 24px 90px rgba(0,0,0,.55),0 0 42px rgba(47,107,255,.14);backdrop-filter:blur(22px);animation:lai-enter .22s ease-out}
@keyframes lai-enter{from{opacity:0;transform:translateY(10px) scale(.985)}to{opacity:1;transform:translateY(0) scale(1)}}
.lai-panel[hidden],.lai-settings[hidden],.lai-local-fields[hidden],.lai-error[hidden],.lai-stop[hidden],.lai-send[hidden]{display:none!important}
.lai-head{display:flex;align-items:center;gap:11px;padding:15px 15px 13px;border-bottom:1px solid var(--lai-line);background:linear-gradient(110deg,rgba(26,55,106,.42),rgba(12,20,41,.25))}
.lai-avatar{width:39px;height:39px}.lai-avatar .lai-robot-face{transform:scale(.85)}.lai-head-copy{flex:1;min-width:0}.lai-head h2{margin:0;font-size:15px;font-weight:800;letter-spacing:-.02em}.lai-head p{display:flex;align-items:center;gap:6px;margin:3px 0 0;color:var(--lai-muted);font-size:10px}.lai-status-dot{width:6px;height:6px;border-radius:50%;background:#5be2a0;box-shadow:0 0 8px rgba(91,226,160,.8)}
.lai-language-bar{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:8px 15px;border-bottom:1px solid var(--lai-line);background:rgba(13,24,48,.72)}.lai-language-bar label{display:flex;align-items:center;gap:7px;min-width:0;color:#aebfdf;font-size:10px;font-weight:700}.lai-language-bar label span{display:grid;place-items:center;width:22px;height:22px;border:1px solid rgba(101,216,255,.22);border-radius:7px;color:#9de7ff;background:rgba(63,143,255,.12);font-size:10px}.lai-language-bar select{width:min(210px,62%);height:32px;padding:0 9px;border:1px solid rgba(128,163,235,.24);border-radius:9px;color:#e6efff;background:#101c35;font-size:10px;cursor:pointer}.lai-language-bar select:hover{border-color:rgba(101,216,255,.55)}
.lai-icon-btn{display:grid;place-items:center;width:31px;height:31px;padding:0;border:1px solid var(--lai-line);border-radius:10px;color:#c8d8f5;background:rgba(255,255,255,.04);font-size:17px;cursor:pointer}.lai-icon-btn:hover{background:rgba(91,151,255,.14)}.lai-close{font-size:23px;line-height:1}
.lai-settings{padding:12px 16px;border-bottom:1px solid var(--lai-line);background:rgba(13,24,48,.9)}.lai-settings label{display:block;margin:0 0 5px;color:#c6d7f5;font-size:10px;font-weight:700}.lai-settings select,.lai-settings input{width:100%;height:35px;margin-bottom:10px;padding:0 10px;border:1px solid var(--lai-line);border-radius:9px;color:var(--lai-text);background:#101c35;font-size:11px}.lai-settings p{margin:0 0 4px;color:var(--lai-muted);font-size:10px;line-height:1.5}
.lai-messages{flex:1;min-height:0;overflow:auto;padding:17px 14px 14px;scroll-behavior:smooth;overscroll-behavior:contain}.lai-welcome{padding:16px 14px;border:1px solid rgba(105,164,255,.18);border-radius:16px;background:linear-gradient(145deg,rgba(28,54,99,.4),rgba(13,22,43,.5))}.lai-welcome-mark{display:grid;place-items:center;width:27px;height:27px;margin-bottom:9px;border-radius:9px;color:#b7eaff;background:rgba(63,143,255,.18)}.lai-welcome p{margin:0 0 14px;color:#dbe7ff;font-size:12px;line-height:1.7}.lai-quick-actions{display:flex;flex-wrap:wrap;gap:7px}.lai-quick-actions button{padding:7px 9px;border:1px solid rgba(112,164,255,.24);border-radius:999px;color:#cfe1ff;background:rgba(52,103,190,.13);font-size:10px;cursor:pointer;transition:background .15s,border-color .15s}.lai-quick-actions button:hover{border-color:rgba(101,216,255,.7);background:rgba(52,130,230,.24)}
.lai-message{display:flex;flex-direction:column;align-items:flex-start;margin:15px 0}.lai-message.lai-user{align-items:flex-end}.lai-message-label{margin:0 3px 5px;color:var(--lai-muted);font-size:9px;font-weight:700;letter-spacing:.04em}.lai-bubble{max-width:91%;padding:10px 12px;border:1px solid var(--lai-line);border-radius:14px 14px 14px 4px;color:#e1ebff;background:rgba(24,38,67,.82);font-size:11px;line-height:1.7;white-space:pre-wrap;overflow-wrap:anywhere}.lai-user .lai-bubble{border-color:rgba(85,151,255,.35);border-radius:14px 14px 4px 14px;color:#fff;background:linear-gradient(135deg,rgba(41,91,181,.9),rgba(35,69,142,.9))}.lai-message-actions{display:flex;gap:10px;margin:5px 2px 0}.lai-message-actions button{padding:2px 0;border:0;color:#8faedc;background:none;font-size:9px;cursor:pointer}.lai-message-actions button:hover{color:#a9e7ff}.lai-dots{display:flex;gap:4px;padding:3px}.lai-dots i{width:5px;height:5px;border-radius:50%;background:#7bbdff;animation:lai-dot 1s infinite ease-in-out}.lai-dots i:nth-child(2){animation-delay:.14s}.lai-dots i:nth-child(3){animation-delay:.28s}@keyframes lai-dot{0%,60%,100%{opacity:.35;transform:translateY(0)}30%{opacity:1;transform:translateY(-3px)}}
.lai-error{margin:0 13px 9px;padding:9px 11px;border:1px solid rgba(255,139,139,.3);border-radius:10px;color:#ffc3c3;background:rgba(120,35,45,.2);font-size:10px;line-height:1.5}
.lai-compose{margin:0 12px;padding:9px 10px 7px;border:1px solid rgba(121,163,234,.28);border-radius:14px;background:rgba(17,29,53,.88)}.lai-compose textarea{display:block;width:100%;max-height:120px;min-height:30px;resize:none;border:0;outline:0!important;color:var(--lai-text);background:transparent;font-size:11px;line-height:1.5}.lai-compose textarea::placeholder{color:#7184a7}.lai-compose-bottom{display:flex;align-items:center;justify-content:space-between;gap:8px;margin-top:4px}.lai-compose-bottom span{color:#7486a8;font-size:8px}.lai-send,.lai-stop{display:grid;place-items:center;min-width:31px;height:31px;padding:0 9px;border:0;border-radius:10px;color:#fff;background:linear-gradient(135deg,#3978ff,#2460d5);cursor:pointer}.lai-send:disabled{opacity:.45;cursor:wait}.lai-send svg{width:15px;height:15px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}.lai-stop{display:block;background:#763d55;font-size:10px}
.lai-foot{display:flex;align-items:center;justify-content:space-between;gap:8px;padding:9px 15px 11px;color:#7183a4;font-size:8px}.lai-foot button{padding:0;border:0;color:#9cb8e8;background:none;font-size:9px;cursor:pointer}.lai-foot button:hover{color:#d5e8ff}
@media(max-width:520px){.lai-launcher{right:14px;bottom:max(14px,env(safe-area-inset-bottom));padding:7px}.lai-launcher-label{display:none}.lai-launcher-orb{width:46px;height:46px}.lai-panel{right:8px;bottom:calc(max(8px,env(safe-area-inset-bottom)) + 60px);width:calc(100vw - 16px);height:min(76dvh,680px);min-height:360px;border-radius:19px}.lai-head{padding:12px}.lai-messages{padding:13px 11px}}
@media(prefers-reduced-motion:reduce){#linden-ai *,#linden-ai *:before,#linden-ai *:after{animation:none!important;scroll-behavior:auto!important;transition:none!important}.lai-launcher:hover{transform:none}}

#linden-ai .lai-mascot-image{display:block;width:100%;height:100%;object-fit:contain;border-radius:50%}

/* BETA 11 polish: animated, draggable CSS robot mascot. No external image or library required. */
.lai-launcher {
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  cursor: grab;
}
.lai-launcher:active { cursor: grabbing; }
.lai-launcher-orb {
  position: relative;
  width: 62px;
  height: 66px;
  overflow: visible;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}
.lai-robot {
  position: relative;
  display: block;
  width: 60px;
  height: 65px;
  transform-origin: 50% 90%;
  animation: lai-robot-hover 3.4s ease-in-out infinite;
  filter: drop-shadow(0 5px 8px rgba(18, 99, 190, .28));
}
.lai-robot-antenna {
  position: absolute;
  z-index: 1;
  top: 1px;
  left: 29px;
  width: 2px;
  height: 10px;
  border-radius: 2px;
  background: #86dfff;
}
.lai-robot-antenna i {
  position: absolute;
  top: -4px;
  left: -3px;
  width: 8px;
  height: 8px;
  border: 1px solid #c1f5ff;
  border-radius: 50%;
  background: #55caff;
  box-shadow: 0 0 10px rgba(101, 216, 255, .95);
  animation: lai-robot-signal 2s ease-in-out infinite;
}
.lai-robot-head {
  position: absolute;
  z-index: 3;
  top: 10px;
  left: 10px;
  display: grid;
  place-items: center;
  width: 40px;
  height: 29px;
  border: 2px solid #a5eaff;
  border-radius: 11px 11px 9px 9px;
  background: linear-gradient(145deg, #244c7e 0%, #102344 72%);
  box-shadow: inset 0 2px 5px rgba(255,255,255,.17), 0 0 12px rgba(72, 190, 255, .25);
}
.lai-robot-ear {
  position: absolute;
  top: 8px;
  width: 4px;
  height: 10px;
  border: 1px solid #8bdfff;
  border-radius: 3px;
  background: #2865a0;
}
.lai-robot-ear-left { left: -6px; }
.lai-robot-ear-right { right: -6px; }
.lai-robot-eyes {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  width: 100%;
  margin-top: -2px;
}
.lai-robot-eyes i {
  display: block;
  width: 5px;
  height: 7px;
  border-radius: 50%;
  background: #a9f1ff;
  box-shadow: 0 0 7px #65d8ff;
  transform-origin: center;
  animation: lai-robot-blink 5.2s infinite;
}
.lai-robot-eyes i:nth-child(2) { animation-delay: .08s; }
.lai-robot-mouth {
  position: absolute;
  bottom: 4px;
  left: 50%;
  width: 8px;
  height: 3px;
  border-bottom: 1.5px solid #76cfff;
  border-radius: 0 0 8px 8px;
  transform: translateX(-50%);
}
.lai-robot-neck {
  position: absolute;
  z-index: 2;
  top: 37px;
  left: 27px;
  width: 7px;
  height: 5px;
  background: #83d8ff;
}
.lai-robot-body {
  position: absolute;
  top: 40px;
  left: 16px;
  width: 28px;
  height: 21px;
  border: 1.5px solid #86dfff;
  border-radius: 8px 8px 7px 7px;
  background: linear-gradient(155deg, #28568b, #102343 78%);
  box-shadow: inset 0 2px 5px rgba(255,255,255,.12), 0 0 10px rgba(72,190,255,.17);
}
.lai-robot-core {
  position: absolute;
  top: 6px;
  left: 10px;
  width: 7px;
  height: 7px;
  border: 1px solid #d2faff;
  border-radius: 50%;
  background: #53cfff;
  box-shadow: 0 0 9px #45c9ff;
}
.lai-robot-arm {
  position: absolute;
  top: 3px;
  width: 6px;
  height: 15px;
  border: 1px solid #8edfff;
  border-radius: 5px;
  background: linear-gradient(#3476aa, #18385e);
  transform-origin: 50% 3px;
}
.lai-robot-arm-left { left: -7px; animation: lai-robot-wave-left 2.8s ease-in-out infinite; }
.lai-robot-arm-right { right: -7px; animation: lai-robot-wave-right 3.3s ease-in-out infinite; }
.lai-robot-shadow {
  position: absolute;
  bottom: -1px;
  left: 16px;
  width: 28px;
  height: 5px;
  border-radius: 50%;
  background: rgba(2, 8, 22, .55);
  filter: blur(2px);
  animation: lai-robot-shadow 3.4s ease-in-out infinite;
}
.lai-avatar {
  overflow: visible;
  border: 0;
  background: transparent;
  box-shadow: none;
}
.lai-avatar .lai-robot {
  transform: scale(.66);
  transform-origin: 50% 50%;
  animation-duration: 3.8s;
}
.lai-robot + .lai-robot { pointer-events: none; }
@keyframes lai-robot-hover {
  0%, 100% { transform: translateY(0) rotate(-1deg); }
  50% { transform: translateY(-5px) rotate(1deg); }
}
@keyframes lai-robot-signal {
  0%, 100% { opacity: .75; box-shadow: 0 0 5px rgba(101,216,255,.55); }
  50% { opacity: 1; box-shadow: 0 0 12px rgba(101,216,255,1); }
}
@keyframes lai-robot-blink {
  0%, 43%, 47%, 100% { transform: scaleY(1); }
  45% { transform: scaleY(.12); }
}
@keyframes lai-robot-wave-left {
  0%, 72%, 100% { transform: rotate(7deg); }
  82% { transform: rotate(-30deg); }
  90% { transform: rotate(5deg); }
}
@keyframes lai-robot-wave-right {
  0%, 100% { transform: rotate(-5deg); }
  50% { transform: rotate(12deg); }
}
@keyframes lai-robot-shadow {
  0%, 100% { opacity: .48; transform: scaleX(1); }
  50% { opacity: .25; transform: scaleX(.8); }
}

/* Never leave stale Copy/Retry actions or an old error visible during a new request. */
#linden-ai.lai-is-loading .lai-message-actions { display: none !important; }
#linden-ai.lai-is-loading .lai-error { display: none !important; }
.lai-error {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.lai-error-retry {
  flex: 0 0 auto;
  padding: 5px 9px;
  border: 1px solid rgba(255, 178, 178, .35);
  border-radius: 7px;
  color: #ffe4e4;
  background: rgba(130, 48, 59, .35);
  font-size: 10px;
  font-weight: 700;
  cursor: pointer;
}
.lai-error-retry:hover { background: rgba(150, 55, 68, .55); }
.lai-pending .lai-bubble { min-width: 52px; min-height: 31px; }
.lai-is-loading .lai-robot { animation-duration: 1.25s; }
@media(max-width:520px) {
  .lai-launcher-orb { width: 60px; height: 64px; }
  .lai-error { align-items: flex-start; }
}
@media(prefers-reduced-motion:reduce) {
  .lai-robot, .lai-robot * { animation: none !important; }
  .lai-robot-shadow { opacity: .4; }
}
.lai-avatar .lai-robot { animation: none; transform: scale(.66); }


/* Owner-supplied Linden robot from the standalone demo, without its sky/background scene. */
#linden-ai .lai-launcher {
  display: block;
  width: 108px;
  height: 142px;
  padding: 0;
  border: 0;
  border-radius: 0;
  color: inherit;
  background: transparent;
  box-shadow: none;
  overflow: visible;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  cursor: grab;
  transition: filter .2s ease, transform .2s ease;
}
#linden-ai .lai-launcher:hover {
  border-color: transparent;
  background: transparent;
  box-shadow: none;
  filter: drop-shadow(0 0 13px rgba(83, 190, 255, .18));
  transform: translateY(-3px);
}
#linden-ai .lai-launcher:active { cursor: grabbing; }
#linden-ai .lai-launcher:focus-visible {
  outline: 2px solid var(--lai-cyan);
  outline-offset: 3px;
  border-radius: 22px;
}
#linden-ai .lai-launcher-orb {
  position: absolute;
  left: 7px;
  bottom: 0;
  display: block;
  width: 94px;
  height: 137px;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  overflow: visible;
}
#linden-ai .lai-launcher-label {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
#linden-ai .lai-launcher::after {
  content: "Ask Linden AI";
  position: absolute;
  right: 100%;
  top: 50%;
  margin-right: 4px;
  padding: 6px 9px;
  border: 1px solid rgba(127, 188, 255, .24);
  border-radius: 9px;
  color: #eaf4ff;
  background: rgba(8, 15, 32, .94);
  box-shadow: 0 7px 22px rgba(0, 0, 0, .24);
  font-size: 10px;
  font-weight: 700;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transform: translateY(5px);
  transition: opacity .18s ease, transform .18s ease;
}
#linden-ai .lai-launcher:hover::after,
#linden-ai .lai-launcher:focus-visible::after { opacity: 1; transform: translateY(0); }

#linden-ai .lai-robot {
  position: relative;
  display: block;
  width: 94px;
  height: 137px;
  overflow: visible;
  transform-origin: 50% 82%;
  filter: drop-shadow(0 8px 9px rgba(15, 44, 95, .28));
  animation: lai-mascot-hover 3.5s ease-in-out infinite;
}
#linden-ai .lai-robot-rig {
  position: absolute;
  z-index: 1;
  top: 0;
  left: 0;
  display: block;
  width: 100%;
  aspect-ratio: 485 / 412;
  overflow: visible;
}
#linden-ai .lai-robot-layer {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  pointer-events: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-user-drag: none;
}
#linden-ai .lai-head-layer {
  transform-origin: 54% 49.3%;
  animation: lai-mascot-head-idle 7s ease-in-out infinite;
}
#linden-ai .lai-arm-left-layer {
  transform-origin: 27.4% 55.6%;
  animation: lai-mascot-arm-left-idle 5.5s ease-in-out infinite;
}
#linden-ai .lai-arm-right-layer {
  transform-origin: 74% 58.3%;
  animation: lai-mascot-arm-right-idle 6.5s ease-in-out infinite;
}
#linden-ai .lai-rocket {
  position: absolute;
  z-index: 0;
  top: 71%;
  left: 50%;
  display: block;
  width: 36%;
  transform: translateX(-50%);
  pointer-events: none;
}
#linden-ai .lai-rocket svg { display: block; width: 100%; height: auto; overflow: visible; }
#linden-ai .lai-flame-outer,
#linden-ai .lai-flame-mid,
#linden-ai .lai-flame-core {
  transform-box: fill-box;
  transform-origin: 50% 0;
  animation: lai-flame-flicker .14s ease-in-out infinite alternate;
}
#linden-ai .lai-flame-mid { animation-duration: .17s; }
#linden-ai .lai-flame-core { animation-duration: .11s; }
#linden-ai .lai-launcher-greeting {
  position: absolute;
  z-index: 3;
  top: -49px;
  left: 50%;
  right: auto;
  width: max-content;
  max-width: min(205px, 64vw);
  padding: 9px 12px;
  border: 1px solid rgba(125, 184, 255, .25);
  border-radius: 15px;
  color: #f0f6ff;
  background: rgba(10, 19, 40, .96);
  box-shadow: 0 9px 24px rgba(0, 0, 0, .3), 0 0 18px rgba(56, 139, 255, .12);
  font-size: 11px;
  font-weight: 700;
  line-height: 1.35;
  text-align: center;
  pointer-events: none;
  transform: translateX(-50%);
  animation: none;
}
#linden-ai .lai-launcher-greeting::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -5px;
  width: 9px;
  height: 9px;
  border-right: 1px solid rgba(125, 184, 255, .25);
  border-bottom: 1px solid rgba(125, 184, 255, .25);
  background: rgba(10, 19, 40, .96);
  transform: translateX(-50%) rotate(45deg);
}
#linden-ai.lai-open .lai-launcher-greeting { display: none; }

#linden-ai .lai-avatar {
  position: relative;
  display: grid;
  place-items: center;
  flex: 0 0 48px;
  width: 48px;
  height: 48px;
  overflow: visible;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}
#linden-ai .lai-avatar .lai-robot {
  width: 48px;
  height: 43px;
  filter: drop-shadow(0 3px 4px rgba(15, 44, 95, .2));
  animation: none;
  transform: none;
}
#linden-ai .lai-avatar .lai-robot-rig { width: 48px; }
#linden-ai .lai-avatar .lai-rocket { display: none; }

#linden-ai .lai-panel {
  bottom: calc(max(22px, env(safe-area-inset-bottom)) + 150px);
}
#linden-ai .lai-launcher.lai-robot-wave .lai-head-layer { animation: lai-mascot-head-wave 2.6s ease-in-out; }
#linden-ai .lai-launcher.lai-robot-wave .lai-arm-left-layer { animation: lai-mascot-arm-left-wave 2.6s ease-in-out; }
#linden-ai .lai-launcher.lai-robot-wave .lai-arm-right-layer { animation: lai-mascot-arm-right-wave 2.6s ease-in-out; }
#linden-ai .lai-launcher.lai-robot-nod .lai-head-layer { animation: lai-mascot-head-nod 1.4s ease-in-out; }
#linden-ai .lai-launcher.lai-robot-nod .lai-arm-left-layer { animation: lai-mascot-arm-left-nod 1.4s ease-in-out; }
#linden-ai .lai-launcher.lai-robot-nod .lai-arm-right-layer { animation: lai-mascot-arm-right-nod 1.4s ease-in-out; }
#linden-ai .lai-launcher-greeting.lai-greeting-refresh { animation: lai-greeting-refresh .28s ease-out; }
#linden-ai.lai-is-loading .lai-robot { animation-duration: 1.25s; }
#linden-ai.lai-is-loading .lai-flame-outer,
#linden-ai.lai-is-loading .lai-flame-mid,
#linden-ai.lai-is-loading .lai-flame-core { animation-duration: .08s; }

@keyframes lai-mascot-hover {
  0%, 100% { transform: translateY(0) rotate(-1deg); }
  50% { transform: translateY(-7px) rotate(1deg); }
}
@keyframes lai-mascot-head-idle {
  0%, 100% { rotate: 0deg; }
  35% { rotate: -1.5deg; }
  70% { rotate: 1.5deg; }
}
@keyframes lai-mascot-arm-left-idle {
  0%, 100% { rotate: 0deg; }
  50% { rotate: 3deg; }
}
@keyframes lai-mascot-arm-right-idle {
  0%, 100% { rotate: 0deg; }
  50% { rotate: -3deg; }
}
@keyframes lai-mascot-head-wave {
  0%, 100% { rotate: 0deg; translate: 0 0; }
  14% { rotate: 7deg; translate: 0 -1.2%; }
  40% { rotate: 4deg; }
  62% { rotate: 7deg; translate: 0 -1.2%; }
  88% { rotate: 5deg; }
}
@keyframes lai-mascot-arm-left-wave {
  0%, 100% { rotate: 0deg; }
  14% { rotate: 16deg; }
  38% { rotate: 8deg; }
  62% { rotate: 14deg; }
  86% { rotate: 12deg; }
}
@keyframes lai-mascot-arm-right-wave {
  0%, 100% { rotate: 0deg; }
  14% { rotate: -66deg; }
  26% { rotate: -54deg; }
  38% { rotate: -78deg; }
  50% { rotate: -54deg; }
  62% { rotate: -78deg; }
  74% { rotate: -58deg; }
  88% { rotate: -66deg; }
}
@keyframes lai-mascot-head-nod {
  0%, 100% { rotate: 0deg; translate: 0 0; }
  25% { rotate: -3deg; translate: 0 1.4%; }
  55% { rotate: 3deg; translate: 0 -.6%; }
}
@keyframes lai-mascot-arm-left-nod {
  0%, 100% { rotate: 0deg; }
  30% { rotate: 10deg; }
  60% { rotate: 4deg; }
}
@keyframes lai-mascot-arm-right-nod {
  0%, 100% { rotate: 0deg; }
  30% { rotate: -16deg; }
  60% { rotate: -6deg; }
}
@keyframes lai-greeting-refresh {
  from { opacity: .3; transform: translateY(3px) scale(.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes lai-flame-flicker {
  from { transform: scale(.92, .86); }
  to { transform: scale(1.06, 1.1); }
}
@keyframes lai-greeting-appear {
  0% { opacity: 0; transform: translateY(5px) scale(.94); }
  9%, 76% { opacity: 1; transform: translateY(0) scale(1); }
  100% { opacity: 0; transform: translateY(-3px) scale(.97); visibility: hidden; }
}
@media (max-width: 520px) {
  #linden-ai .lai-launcher {
    right: 12px;
    bottom: max(12px, env(safe-area-inset-bottom));
    width: 96px;
    height: 132px;
  }
  #linden-ai .lai-launcher-orb { left: 4px; width: 88px; height: 128px; }
  #linden-ai .lai-robot { width: 88px; height: 128px; }
  #linden-ai .lai-launcher-greeting { top: -49px; max-width: min(185px, 64vw); }
  #linden-ai .lai-panel {
    right: 8px;
    bottom: calc(max(12px, env(safe-area-inset-bottom)) + 138px);
    width: calc(100vw - 16px);
    height: min(70dvh, calc(100dvh - 158px));
    min-height: 320px;
  }
}
@media (prefers-reduced-motion: reduce) {
  #linden-ai .lai-robot,
  #linden-ai .lai-robot *,
  #linden-ai .lai-launcher-greeting {
    animation: none !important;
  }
  #linden-ai .lai-launcher-greeting { opacity: 1; }
  #linden-ai .lai-flame-outer,
  #linden-ai .lai-flame-mid,
  #linden-ai .lai-flame-core { transform: none !important; }
  #linden-ai .lai-launcher:hover { transform: none; }
}

/* Owner replies are visually identified separately from automated AI replies. */
#linden-ai .lai-owner-reply .lai-message-label { color: #9bd3a8; }
#linden-ai .lai-owner-reply .lai-bubble { border-color: rgba(120, 190, 145, .32); background: rgba(19, 50, 43, .88); }


/* BETA 16 public contact hub: clickable message charm attached to the robot's lower edge. */
#linden-ai .lai-contact-trigger {
  position: fixed;
  z-index: 86;
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  padding: 0;
  border: 1px solid rgba(139, 231, 255, .95);
  border-radius: 13px 13px 13px 5px;
  color: #c8f5ff;
  background: linear-gradient(145deg, #1c4d7d, #09182f 78%);
  box-shadow: 0 6px 17px rgba(0, 0, 0, .43), 0 0 17px rgba(83, 202, 255, .38), inset 0 1px rgba(255,255,255,.18);
  cursor: pointer;
  transform: rotate(7deg);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
#linden-ai .lai-contact-trigger::before {
  content: "";
  position: absolute;
  width: 2px;
  height: 15px;
  left: 8px;
  top: -13px;
  border-radius: 2px;
  background: linear-gradient(#a7f0ff, #4b9bdf);
  transform: rotate(-19deg);
  transform-origin: bottom;
}
#linden-ai .lai-contact-trigger svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
#linden-ai .lai-contact-trigger:hover,
#linden-ai .lai-contact-trigger:focus-visible { border-color: #e1fbff; box-shadow: 0 8px 22px rgba(0,0,0,.48), 0 0 23px rgba(83,202,255,.58); transform: rotate(0) translateY(-2px); }
#linden-ai .lai-contact-trigger[aria-expanded="true"] { border-color: #fff; color: #fff; transform: rotate(0); }
#linden-ai .lai-contact-trigger-dot { position: absolute; right: 5px; top: 5px; width: 7px; height: 7px; border: 1px solid #09203a; border-radius: 50%; background: #77f0c2; box-shadow: 0 0 8px rgba(119,240,194,.8); }
#linden-ai .lai-contact-hub {
  position: fixed;
  z-index: 87;
  display: flex;
  flex-direction: column;
  width: min(320px, calc(100vw - 24px));
  padding: 14px;
  border: 1px solid rgba(121, 190, 255, .28);
  border-radius: 19px;
  color: #edf5ff;
  background: linear-gradient(155deg, rgba(14, 29, 55, .985), rgba(6, 13, 28, .985));
  box-shadow: 0 20px 58px rgba(0,0,0,.52), 0 0 32px rgba(59,143,255,.15);
  backdrop-filter: blur(20px);
  animation: lai-enter .18s ease-out;
}
#linden-ai .lai-contact-hub[hidden] { display: none !important; }
#linden-ai .lai-contact-hub-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
#linden-ai .lai-contact-kicker { color: #79dfff; font-size: 8px; font-weight: 800; letter-spacing: .16em; }
#linden-ai .lai-contact-hub-head h2 { margin: 3px 0 0; color: #f1f7ff; font-size: 17px; line-height: 1.25; letter-spacing: -.035em; }
#linden-ai .lai-contact-close { display: grid; place-items: center; flex: 0 0 28px; width: 28px; height: 28px; padding: 0; border: 1px solid rgba(136,177,239,.2); border-radius: 9px; color: #c7d9f5; background: rgba(255,255,255,.045); font-size: 20px; line-height: 1; cursor: pointer; }
#linden-ai .lai-contact-options { display: grid; gap: 8px; }
#linden-ai .lai-contact-option { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 66px; padding: 10px; border: 1px solid rgba(118,167,239,.2); border-radius: 13px; color: inherit; text-align: left; background: rgba(26,48,83,.56); cursor: pointer; transition: border-color .16s ease, background .16s ease, transform .16s ease; }
#linden-ai .lai-contact-option:hover { border-color: rgba(117,220,255,.65); background: rgba(39,79,129,.56); transform: translateY(-1px); }
#linden-ai .lai-contact-option-icon { display: grid; place-items: center; flex: 0 0 38px; width: 38px; height: 38px; border-radius: 11px; }
#linden-ai .lai-contact-option-icon svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
#linden-ai .lai-chat-icon { color: #9eeaff; background: rgba(55,153,220,.17); }
#linden-ai .lai-rating-icon { color: #ffe29a; background: rgba(226,169,64,.15); }
#linden-ai .lai-contact-option-copy { display: grid; flex: 1; gap: 3px; min-width: 0; }
#linden-ai .lai-contact-option-copy strong { color: #f2f7ff; font-size: 12px; font-weight: 800; }
#linden-ai .lai-contact-option-copy small { color: #a6b9d8; font-size: 9px; line-height: 1.45; }
#linden-ai .lai-contact-option-arrow { color: #91abcF; font-size: 16px; }
#linden-ai .lai-contact-hub-note { margin: 10px 2px 0; color: #8298bb; font-size: 8px; line-height: 1.5; }
@media (max-width: 520px) {
  #linden-ai .lai-contact-trigger { width: 40px; height: 40px; border-radius: 12px 12px 12px 5px; }
  #linden-ai .lai-contact-hub { width: min(310px, calc(100vw - 20px)); padding: 12px; border-radius: 17px; }
}
@media (prefers-reduced-motion: reduce) {
  #linden-ai .lai-contact-trigger,
  #linden-ai .lai-contact-option { transition: none; }
}


/* BETA v1.6.1 — continuous, restrained wave on the original supplied robot layer. */
#linden-ai .lai-launcher .lai-arm-right-layer {
  transform-origin: 74% 58.3%;
  animation: lai-mascot-arm-right-continuous-wave 4.2s ease-in-out infinite;
}
@keyframes lai-mascot-arm-right-continuous-wave {
  0%, 52%, 100% { rotate: 0deg; }
  60% { rotate: -42deg; }
  68% { rotate: -31deg; }
  76% { rotate: -48deg; }
  84% { rotate: -32deg; }
  92% { rotate: -44deg; }
}

/* The message bubble remains a separately accessible control, positioned from the
   launcher's live bounding box so it follows every drag and viewport adjustment. */
#linden-ai .lai-contact-trigger {
  translate: 0 0;
  animation: lai-contact-bubble-float 3.4s ease-in-out infinite;
  will-change: translate;
}
@keyframes lai-contact-bubble-float {
  0%, 100% { translate: 0 0; }
  50% { translate: 0 -4px; }
}
#linden-ai .lai-contact-trigger:hover,
#linden-ai .lai-contact-trigger:focus-visible,
#linden-ai .lai-contact-trigger[aria-expanded="true"] {
  animation-play-state: paused;
}
#linden-ai .lai-contact-option-link {
  color: inherit;
  text-decoration: none;
}
#linden-ai .lai-contact-option-link em {
  display: inline-block;
  margin-top: 3px;
  color: #8fe4ff;
  font-size: 9px;
  font-style: normal;
  font-weight: 800;
}
#linden-ai .lai-account-icon {
  color: #a8f0d0;
  background: rgba(64,190,139,.15);
}
#linden-ai .lai-contact-hub {
  max-height: min(76dvh, 560px);
  overflow-y: auto;
  overscroll-behavior: contain;
}
#linden-ai .lai-contact-option:focus-visible {
  outline: 2px solid #8fe4ff;
  outline-offset: 2px;
}
@media (max-width: 520px) {
  #linden-ai .lai-contact-hub {
    width: min(320px, calc(100vw - 20px));
    max-height: min(72dvh, 520px);
  }
  #linden-ai .lai-contact-option { min-height: 72px; }
  #linden-ai .lai-contact-option-copy small { font-size: 10px; }
}
@media (prefers-reduced-motion: reduce) {
  #linden-ai .lai-launcher .lai-arm-right-layer,
  #linden-ai .lai-contact-trigger {
    animation: none !important;
    will-change: auto;
  }
}
