.lab-v2-inventory-head{flex-wrap:wrap;gap:12px}
.lab-v2-inventory-head>.lab-v2-head-actions{min-width:0;max-width:100%;flex-wrap:wrap;justify-content:flex-end}
/* Rounded bubbles, yellow messages and the circular send action are approved Plotty treatments. */
.lab-chat-trigger{display:inline-flex;align-items:center;gap:7px;border-color:var(--text)}
.lab-chat-trigger .lab-chat-avatar{width:24px;height:24px}
.lab-chat-avatar{display:block;flex:0 0 auto;object-fit:contain}
.lab-chat-dialog{box-sizing:border-box;position:fixed;inset:auto;left:50%;top:calc(var(--lab-chat-viewport-top,0px) + var(--lab-chat-viewport-height,100dvh)/2);transform:translate(-50%,-50%);margin:0;width:min(760px,calc(100vw - 32px));max-width:none;height:min(780px,calc(var(--lab-chat-viewport-height,100dvh) - 48px));max-height:none;padding:0;border:1px solid var(--line-strong);border-radius:4px;background:var(--panel);color:var(--text);font-family:var(--font);overflow:hidden}
.lab-chat-dialog[open]{display:flex;flex-direction:column}
.lab-chat-dialog::backdrop{background:var(--scrim)}
.lab-chat-dialog [hidden]{display:none!important}
.lab-chat-dialog .ws-btn:disabled{opacity:1}
.lab-chat-head{display:flex;align-items:center;justify-content:space-between;gap:16px;min-height:80px;flex:0 0 auto;padding:16px 16px 16px 24px;border-bottom:1px solid var(--line);background:var(--panel)}
.lab-chat-identity{display:flex;align-items:center;gap:12px;min-width:0}
.lab-chat-identity>.lab-chat-avatar{width:40px;height:40px}
.lab-chat-identity-text{display:flex;flex-direction:column;gap:2px;min-width:0}
.lab-chat-identity h2{margin:0;font-size:20px;font-weight:600;line-height:1.3}
.lab-chat-scope{font-size:12px;line-height:1.4;color:var(--muted)}
.lab-chat-actions{display:flex;align-items:center;gap:8px;flex:0 0 auto}
.lab-chat-actions .ws-btn{height:36px;min-height:36px}
.lab-chat-new{display:inline-flex;align-items:center;gap:6px;padding:0 10px;font-size:12px}
.lab-chat-icon,.lab-chat-help{display:grid;place-items:center;box-sizing:border-box;width:36px;height:36px;padding:8px;border:1px solid transparent;border-radius:3px;background:transparent;color:var(--muted)}
.lab-chat-icon:hover,.lab-chat-help:hover{background:var(--panel-hover);color:var(--text)}
.lab-chat-help:focus-visible,.lab-chat-send:focus-visible{outline:2px solid var(--text);outline-offset:2px}
.lab-chat-dialog svg{width:18px;height:18px;flex:none;fill:none;stroke:currentColor;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round}
.lab-chat-log{flex:1;min-height:0;overflow:auto;overscroll-behavior:contain;overflow-anchor:none;padding:24px;display:flex;flex-direction:column;gap:28px;scrollbar-gutter:stable}
.lab-chat-empty{margin:auto;max-width:100%;width:100%;text-align:center;padding:24px 0}
.lab-chat-empty>.lab-chat-avatar{width:76px;height:76px;margin:0 auto 20px}
.lab-chat-empty h3{margin:0 0 14px;font-size:26px;font-weight:600;line-height:1.3}
.lab-chat-empty p{font-size:15px;line-height:1.6;color:var(--muted);margin:0 0 56px}
.lab-chat-start{display:flex;align-items:stretch;justify-content:center;gap:12px;max-width:610px;margin:auto}
.lab-chat-start .ws-btn{display:flex;align-items:center;gap:12px;flex:1;min-width:0;max-width:100%;height:auto;min-height:86px;padding:16px;text-align:left;white-space:normal;background:var(--bg);font-size:13px;font-weight:400;line-height:1.5}
.lab-chat-start svg{width:20px;height:20px;color:var(--muted)}
.lab-chat-message,.lab-chat-thinking{max-width:100%;min-width:0;flex:0 0 auto}
.lab-chat-message--user{align-self:flex-end;max-width:90%}
.lab-chat-message--user>.lab-chat-speaker,.lab-chat-label{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}
.lab-chat-message--user>.lab-chat-bubble{padding:16px 20px;border-radius:14px 14px 4px 14px;background:#ffdb00;color:#15171a}
.lab-chat-message--assistant,.lab-chat-thinking{display:grid;grid-template-columns:32px minmax(0,1fr);column-gap:12px;align-items:start;align-self:stretch}
.lab-chat-message--assistant>.lab-chat-avatar,.lab-chat-thinking>.lab-chat-avatar{width:32px;height:32px;grid-row:1 / span 2}
.lab-chat-speaker{margin:0 0 6px;font-size:12px;font-weight:600;line-height:1.5;color:var(--muted)}
.lab-chat-message--assistant>.lab-chat-bubble,.lab-chat-thinking>.lab-chat-bubble{grid-column:2}
.lab-chat-bubble{min-width:0;padding:20px;border-radius:4px 14px 14px 14px;background:var(--bg-subtle);color:var(--text)}
.lab-chat-copy{white-space:pre-wrap;overflow-wrap:anywhere;font-size:15px;line-height:1.55}
.lab-chat-items{display:flex;flex-wrap:wrap;gap:8px;margin-top:20px}
.lab-chat-item{display:inline-flex;align-items:center;justify-content:space-between;gap:12px;max-width:100%;min-width:0;height:auto!important;white-space:normal!important;text-align:left;padding:9px 12px!important;font-size:12px!important;border-radius:3px}
.lab-chat-item>span{overflow-wrap:anywhere;min-width:0}
.lab-chat-item svg{width:14px;height:14px;color:var(--muted)}
.lab-chat-thinking>.lab-chat-bubble{font-size:15px;line-height:1.55;color:var(--muted)}
.lab-chat-dots{display:inline-flex;gap:3px;margin-left:6px;vertical-align:middle}
.lab-chat-dots i{width:4px;height:4px;background:currentColor;border-radius:50%;animation:lab-chat-dot 1.2s ease-in-out infinite}
.lab-chat-dots i:nth-child(2){animation-delay:.15s}.lab-chat-dots i:nth-child(3){animation-delay:.3s}
@keyframes lab-chat-dot{0%,70%,100%{opacity:.3;transform:translateY(0)}35%{opacity:1;transform:translateY(-3px)}}
.lab-chat-compose{flex:0 0 auto;padding:16px 24px;background:var(--panel)}
.lab-chat-input-row{position:relative;border:1px solid var(--line-strong);border-radius:8px;background:var(--bg)}
.lab-chat-input-row:focus-within{border-color:var(--muted)}
.lab-chat-input-row--attachments .lab-chat-attach{position:absolute;left:12px;bottom:12px;display:grid;place-items:center;width:36px;height:36px;min-height:36px;padding:8px;border:1px solid transparent;background:transparent;color:var(--muted);border-radius:50%}
.lab-chat-input-row--attachments .lab-chat-attach:hover:not(:disabled){background:var(--bg-subtle);color:var(--text)}
.lab-chat-file-picker{position:fixed;inset:auto;box-sizing:border-box;width:264px;max-width:calc(100vw - 24px);margin:0;padding:6px;border:1px solid var(--line-strong);border-radius:4px;background:var(--panel);color:var(--text);box-shadow:0 4px 16px #0002;overflow:auto;z-index:4}
.lab-chat-file-choice{display:flex;align-items:center;gap:10px;width:100%;min-height:44px;padding:10px;border:0;border-radius:3px;background:transparent;color:var(--text);font:inherit;font-size:13px;line-height:1.4;text-align:left;cursor:pointer}
.lab-chat-file-choice:hover{background:var(--panel-hover)}
.lab-chat-file-choice:focus-visible{outline:2px solid var(--text);outline-offset:-2px;background:var(--bg-subtle)}
.lab-chat-file-choice svg{width:20px;height:20px;flex:none;fill:none;stroke:currentColor;stroke-width:1.5;stroke-linecap:round;stroke-linejoin:round}
.lab-chat-picker-limit{margin:6px -6px -6px;padding:9px 16px;border-top:1px solid var(--line);color:var(--muted);font-size:12px;line-height:1.4}
.lab-chat-dialog .lab-chat-input-row--attachments textarea.ws-input{min-height:108px;padding:16px 16px 58px}
.lab-chat-files{display:flex;gap:8px;max-width:100%;overflow-x:auto;overscroll-behavior:contain;padding-bottom:4px;margin-bottom:8px}
.lab-chat-file{display:flex;align-items:center;gap:8px;flex:0 1 240px;min-width:min(180px,100%);width:min(240px,100%);padding:6px;border:1px solid var(--line-strong);border-radius:4px;background:var(--bg);color:var(--text)}
.lab-chat-file-preview{display:block;width:36px;height:36px;object-fit:cover;flex:none;border-radius:3px}
.lab-chat-file-copy{display:flex;flex:1;min-width:0;flex-direction:column;gap:3px}
.lab-chat-file-name{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:12px;line-height:1.4}
.lab-chat-file-meta{font-size:11px;line-height:1.3;color:var(--muted)}
.lab-chat-file-remove{display:grid;place-items:center;flex:none;width:32px;height:32px;min-height:32px;padding:6px;border:0;background:transparent;color:var(--muted)}
.lab-chat-file-remove:hover:not(:disabled){background:var(--panel-hover);color:var(--danger)}
.lab-chat-file-error{margin:0 0 8px;color:var(--danger);font-size:12px;line-height:1.4;overflow-wrap:anywhere}
.lab-chat-file-error:empty{display:none}
.lab-chat-change-dialog{box-sizing:border-box;width:min(520px,calc(100vw - 32px));max-height:calc(100dvh - 32px);padding:24px;border:1px solid var(--line-strong);border-radius:4px;background:var(--panel);color:var(--text)}
.lab-chat-change-dialog::backdrop{background:var(--scrim)}
.lab-chat-change-dialog h2{margin:0 0 20px;font-size:20px;line-height:1.3;font-weight:600}
.lab-chat-change-dialog p{margin:0 0 20px;font-size:13px;line-height:1.5}
.lab-chat-change-actions{display:flex;justify-content:flex-end;gap:8px}
.lab-chat-compact .lab-chat-empty{display:none}
.lab-chat-dialog.lab-chat-compact .lab-chat-log{padding-top:12px;padding-bottom:12px}
.lab-chat-dialog.lab-chat-compact .lab-chat-compose{padding-top:8px;padding-bottom:8px}
.lab-chat-compact .lab-chat-files{padding-bottom:0;margin-bottom:4px}
.lab-chat-compact .lab-chat-file{padding:2px}
.lab-chat-dialog.lab-chat-compact .lab-chat-input-row--attachments textarea.ws-input{min-height:88px;max-height:88px;padding-top:8px;padding-bottom:48px}
.lab-chat-dialog .lab-chat-input-row textarea.ws-input{display:block;box-sizing:border-box;width:100%;min-height:88px;max-height:180px;resize:none;border:0;border-radius:8px;padding:16px 64px 16px 16px;background:transparent;box-shadow:none;outline:none;color:var(--text);font-family:var(--font);font-size:15px;line-height:1.5}
.lab-chat-dialog .lab-chat-input-row textarea.ws-input:focus{outline:none;box-shadow:none}
.lab-chat-send{position:absolute;right:12px;bottom:12px;display:grid;place-items:center;box-sizing:border-box;width:36px;height:36px;min-height:36px;padding:8px;border:0;border-radius:50%;background:#ffdb00;color:#15171a;cursor:pointer}
.lab-chat-send:hover:not(:disabled){background:#ffdb00;outline:1px solid var(--muted)}
.lab-chat-send:disabled{background:var(--bg-subtle);color:var(--muted);cursor:default}
.lab-chat-error-box{flex:0 0 auto;min-width:0}
.lab-chat-error-box>.lab-chat-speaker{color:var(--text)}
.lab-chat-error{color:var(--text);font-size:15px;line-height:1.55;margin:0 0 20px;overflow-wrap:anywhere}
.lab-chat-retry{display:inline-flex;align-items:center;gap:10px}
.lab-chat-compose .ai-processing-link{display:inline-block;margin-top:10px;font-size:11px;color:var(--muted);text-decoration:underline;text-underline-offset:3px}
@media(max-width:540px){
  .lab-chat-dialog{width:calc(100vw - 24px);height:calc(var(--lab-chat-viewport-height,100dvh) - 24px)}
  .lab-chat-head{gap:8px;padding:12px;min-height:80px}
  .lab-chat-identity{gap:10px}
  .lab-chat-identity>.lab-chat-avatar{width:32px;height:32px}
  .lab-chat-identity h2{font-size:18px}
  .lab-chat-scope{font-size:11px}
  .lab-chat-actions{gap:4px}
  .lab-chat-actions .ws-btn,.lab-chat-help{min-width:44px;width:44px;height:44px;min-height:44px}
  .lab-chat-new{padding:10px;border:1px solid transparent;background:transparent}
  .lab-chat-new>span{display:none}
  .lab-chat-log{padding:24px 12px;gap:28px}
  .lab-chat-empty{padding:8px 0}
  .lab-chat-empty p{margin-bottom:24px}
  .lab-chat-start{flex-direction:column;gap:10px}
  .lab-chat-start .ws-btn{min-height:60px}
  .lab-chat-message--assistant,.lab-chat-thinking{grid-template-columns:24px minmax(0,1fr);column-gap:8px}
  .lab-chat-message--assistant>.lab-chat-avatar,.lab-chat-thinking>.lab-chat-avatar{width:24px;height:24px}
  .lab-chat-bubble{padding:18px 16px}
  .lab-chat-compose{padding:12px}
  .lab-chat-send{width:44px;height:44px;min-height:44px}
  .lab-chat-dialog .lab-chat-input-row textarea.ws-input{min-height:108px;padding-right:72px}
  .lab-chat-item{min-height:44px}
  .lab-chat-retry{min-height:44px}
  .lab-chat-input-row--attachments .lab-chat-attach,.lab-chat-file-remove{width:44px;height:44px;min-height:44px}
  .lab-chat-change-actions .ws-btn{min-height:44px}
  .lab-v2-inventory-head>.ws-panel__title{flex-basis:100%}
  .lab-v2-inventory-head>.lab-v2-head-actions{width:100%;justify-content:flex-start;gap:8px}
}
@media(max-height:480px){.lab-chat-empty>.lab-chat-avatar{width:48px;height:48px;margin-bottom:12px}.lab-chat-empty p{margin-bottom:20px}.lab-chat-empty h3{font-size:22px}.lab-chat-compose{padding-top:8px;padding-bottom:8px}.lab-chat-dialog .lab-chat-input-row textarea.ws-input{min-height:72px}}
@media(prefers-reduced-motion:reduce){.lab-chat-dots i{animation:none;opacity:.6}}
