/* Ray — the NDT Inspect AI assistant: header trigger (ai-trigger.php) + chat panel (ai-widget.php, ai-chat.js). 2026-09-17:
   the launcher moved from a bottom-right bubble into the header icon cluster (desktop) and the mobile quick-links row;
   the panel now opens as a large modal on desktop and full screen on tablet and mobile. */
.ndti-ai{--ai-green:#3d9142;--ai-green-d:#2f7a34;--ai-ink:#0b1620;--ai-mute:#57697a;--ai-line:#e3e9ee;font-family:inherit;line-height:1.4}
.ndti-ai *{box-sizing:border-box}
.ndti-ai [hidden]{display:none!important}
.ndti-ai__lock{position:absolute;right:-2px;bottom:-2px;width:16px;height:16px;border-radius:50%;background:#fff;color:#7a8794;display:flex;align-items:center;justify-content:center;box-shadow:0 1px 4px rgba(0,0,0,.25)}
/* the trigger buttons live outside #ndti-ai (header, mobile menu), so they use literal colors, not the --ai-* custom properties */
.ndti-ai__trigger{position:relative;display:flex;align-items:center;gap:6px;height:38px;padding:0 14px 0 10px;border-radius:999px;background:#3d9142;color:#fff;border:0;font:inherit;font-size:13.5px;font-weight:700;cursor:pointer;appearance:none;white-space:nowrap}
.ndti-ai__trigger:hover,.ndti-ai__trigger:focus-visible{background:#2f7a34;outline:none}
.ndti-ai__trigger svg{flex:0 0 auto;display:block}
.ndti-ai__trigger .ndti-ai__lock{position:static;box-shadow:none;width:14px;height:14px;color:#2f7a34;background:#fff}
.ndti-ai__trigger-mobile{display:flex;align-items:center;gap:10px;width:100%;padding:12px 14px;margin:0 0 14px;border-radius:12px;background:#3d9142;color:#fff;border:0;font:inherit;font-size:14.5px;font-weight:700;text-align:left;cursor:pointer;appearance:none}
.ndti-ai__trigger-mobile:hover,.ndti-ai__trigger-mobile:active{background:#2f7a34}
.ndti-ai__trigger-mobile .ndti-ai__mark-mini{width:30px;height:30px;border-radius:9px;background:rgba(255,255,255,.22);color:#fff;display:flex;align-items:center;justify-content:center;flex:0 0 auto}
.ndti-ai__trigger-mobile .ndti-ai__lock{position:static;box-shadow:none;width:16px;height:16px;background:#fff;color:#2f7a34;margin-left:auto;flex:0 0 auto}
.ndti-ai__backdrop{position:fixed;inset:0;background:rgba(11,22,32,.5);z-index:1899}
.ndti-ai__panel{position:fixed;top:50%;left:50%;transform:translate(-50%,-50%);z-index:1900;width:min(1300px,94vw);height:min(880px,90vh);max-height:90dvh;background:#fff;border:1px solid var(--ai-line);border-radius:18px;box-shadow:0 24px 80px rgba(11,22,32,.35);display:flex;flex-direction:column;overflow:hidden;color:var(--ai-ink)}
.ndti-ai__head{display:flex;align-items:center;justify-content:space-between;gap:8px;padding:12px 12px 12px 14px;border-bottom:1px solid var(--ai-line);background:#f6faf6}
.ndti-ai__id{display:flex;align-items:center;gap:10px;min-width:0}
.ndti-ai__id strong{display:block;font-size:15.5px;line-height:1.2}
.ndti-ai__id small{display:block;color:var(--ai-mute);font-size:12px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.ndti-ai__mark{flex:0 0 38px;width:38px;height:38px;border-radius:12px;background:var(--ai-green);color:#fff;display:flex;align-items:center;justify-content:center}
.ndti-ai__acts{display:flex;align-items:center;gap:6px;flex:0 0 auto}
.ndti-ai__new{background:#fff;border:1px solid var(--ai-line);border-radius:999px;padding:6px 11px;font:inherit;font-size:12.5px;color:var(--ai-ink);cursor:pointer}
.ndti-ai__new:hover{border-color:#c9d3db;background:#f3f5f7}
.ndti-ai__close{width:34px;height:34px;border:0;background:transparent;border-radius:10px;font-size:26px;line-height:1;color:var(--ai-mute);cursor:pointer;padding:0}
.ndti-ai__close:hover{background:#eaf0ea;color:var(--ai-ink)}
.ndti-ai__log{flex:1 1 auto;overflow-y:auto;padding:14px 14px 8px;display:flex;flex-direction:column;gap:10px;background:#fff;overscroll-behavior:contain;scroll-behavior:smooth}
.ndti-ai__msg{max-width:90%;padding:10px 13px;border-radius:15px;font-size:14.5px;line-height:1.5;color:var(--ai-ink);overflow-wrap:anywhere}
.ndti-ai__msg--user{align-self:flex-end;background:#e6f3e7;border-bottom-right-radius:5px;white-space:pre-wrap}
.ndti-ai__msg--ai{align-self:flex-start;background:#f2f5f7;border-bottom-left-radius:5px}
.ndti-ai__msg--err{background:#fdf1f0;color:#7a271a}
.ndti-ai__msg p{margin:0 0 9px}
.ndti-ai__msg p:last-child{margin:0}
.ndti-ai__msg ul,.ndti-ai__msg ol{margin:0 0 9px;padding-left:20px}
.ndti-ai__msg li{margin:0 0 4px}
.ndti-ai__msg a{color:var(--ai-green-d);text-decoration:underline;text-underline-offset:2px}
.ndti-ai__msg code{background:#e8ecef;border-radius:4px;padding:1px 5px;font-size:13px}
.ndti-ai__msg strong{font-weight:700}
.ndti-ai__tool{display:flex;align-items:center;gap:7px;font-size:12.5px;color:var(--ai-mute);margin:0 0 7px;font-style:italic}
.ndti-ai__tool::before{content:"";width:12px;height:12px;border:2px solid #c9d3db;border-top-color:var(--ai-green);border-radius:50%;animation:ndti-ai-spin .8s linear infinite;flex:0 0 12px}
.ndti-ai__tool.is-done::before{animation:none;border-color:var(--ai-green);border-top-color:var(--ai-green)}
.ndti-ai__dots{display:inline-flex;gap:4px;align-items:center;height:18px}
.ndti-ai__dots i{width:7px;height:7px;border-radius:50%;background:#9aa8b3;animation:ndti-ai-bounce 1.2s infinite ease-in-out}
.ndti-ai__dots i:nth-child(2){animation-delay:.15s}
.ndti-ai__dots i:nth-child(3){animation-delay:.3s}
.ndti-ai__starters{display:flex;flex-wrap:wrap;gap:6px;margin-top:2px}
.ndti-ai__starter{border:1px solid var(--ai-line);background:#fff;border-radius:999px;padding:7px 12px;font:inherit;font-size:13px;color:var(--ai-ink);cursor:pointer;text-align:left;line-height:1.3}
.ndti-ai__starter:hover{border-color:var(--ai-green);background:#f3f9f3}
.ndti-ai__composer{display:flex;align-items:flex-end;gap:8px;padding:10px 12px;border-top:1px solid var(--ai-line);background:#fff}
.ndti-ai__composer textarea{flex:1 1 auto;resize:none;border:1px solid #d5dde3;border-radius:12px;padding:10px 12px;font:inherit;font-size:14.5px;line-height:1.4;min-height:42px;max-height:150px;color:var(--ai-ink);background:#fff;margin:0}
.ndti-ai__composer textarea:focus{outline:none;border-color:var(--ai-green);box-shadow:0 0 0 3px rgba(61,145,66,.15)}
.ndti-ai__send{flex:0 0 42px;width:42px;height:42px;border-radius:12px;background:var(--ai-green);color:#fff;border:0;cursor:pointer;display:flex;align-items:center;justify-content:center;padding:0}
.ndti-ai__send:hover{background:var(--ai-green-d)}
.ndti-ai__send:disabled{opacity:.45;cursor:default}
.ndti-ai__foot{display:flex;align-items:center;gap:8px 10px;flex-wrap:wrap;padding:0 14px 10px;font-size:11.5px;color:var(--ai-mute);background:#fff}
.ndti-ai__count{white-space:nowrap}
.ndti-ai__count.is-low{color:#b45309;font-weight:700}
.ndti-ai__disc{flex:1 1 150px;min-width:140px}
.ndti-ai__linkbtn{background:none;border:0;color:var(--ai-green-d);text-decoration:underline;text-underline-offset:2px;cursor:pointer;font:inherit;font-size:12px;padding:0;white-space:nowrap}
.ndti-ai__contact{padding:16px 16px 14px;border-top:1px solid var(--ai-line);background:#fbfcfd;font-size:14px}
.ndti-ai__contact p{margin:0 0 10px;line-height:1.5}
.ndti-ai__contact textarea{width:100%;resize:vertical;border:1px solid #d5dde3;border-radius:12px;padding:10px 12px;font:inherit;font-size:14.5px;min-height:96px;margin:0 0 10px}
.ndti-ai__contact-acts{display:flex;align-items:center;gap:14px}
.ndti-ai__contact .ndti-btn{padding:9px 16px;font-size:14px}
.ndti-ai__contact-note{color:var(--ai-green-d);font-weight:700}
.ndti-ai__contact-note.is-err{color:#b42318}
.ndti-ai__locked{padding:22px 20px 24px;font-size:14.5px;line-height:1.55;color:var(--ai-ink)}
.ndti-ai__locked p{margin:0 0 12px}
.ndti-ai__locked .ndti-btn{padding:9px 16px;font-size:14px}
.ndti-ai__panel.is-locked{height:auto}
@keyframes ndti-ai-spin{to{transform:rotate(360deg)}}
@keyframes ndti-ai-bounce{0%,80%,100%{transform:translateY(0);opacity:.5}40%{transform:translateY(-5px);opacity:1}}
@media (max-width:1024px){
  .ndti-ai__backdrop{display:none}
  .ndti-ai__panel{top:0;left:0;transform:none;width:100vw;width:100dvw;height:100vh;height:100dvh;max-height:100dvh;border-radius:0;border:0}
  .ndti-ai__panel.is-locked{height:auto;border-radius:0}
  body.ndti-ai-open{overflow:hidden}
}
@media (prefers-reduced-motion:reduce){.ndti-ai__tool::before,.ndti-ai__dots i{animation:none}.ndti-ai__log{scroll-behavior:auto}}
@media print{.ndti-ai{display:none}}
