
/* FASE 384 — schemi compatti */
.tcai384-library,.tcai384-library *{box-sizing:border-box}
.tcai384-controls{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px;margin:12px 0}
.tcai384-controls label{font-weight:600;font-size:13px;color:#233c51;display:flex;flex-direction:column;gap:6px}
.tcai384-controls input,.tcai384-controls select{width:100%;min-width:0;border:1px solid #b2c1d0;border-radius:8px;padding:10px;background:white;color:#123}
.tcai384-meta{font-size:13px;color:#496074;margin:8px 0 14px}
.tcai384-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(245px,1fr));gap:12px;margin-bottom:14px}
.tcai384-tile{border:1px solid #d3dce7;padding:13px;border-radius:13px;background:#fff;min-width:0}
.tcai384-tile .tcai384-title{display:flex;flex-direction:column;gap:3px;color:#172a3b}
.tcai384-type{font-size:12px;color:#65788b;font-weight:600}
.tcai384-tile p{font-size:13px;color:#394f63;margin:8px 0;line-height:1.45}
.tcai384-fold{border:1px solid #ced9e4;border-radius:9px;overflow:hidden;background:#f5f9fc}
.tcai384-fold summary,.tcai384-chat-fold summary{cursor:pointer;padding:11px 12px;min-height:44px;display:flex;align-items:center;font-size:13px;font-weight:700;color:#16416d;list-style:none}
.tcai384-fold summary::-webkit-details-marker,.tcai384-chat-fold summary::-webkit-details-marker{display:none}
.tcai384-fold summary::after,.tcai384-chat-fold summary::after{content:'⌄';margin-left:auto;font-size:19px}
.tcai384-fold[open] summary::after,.tcai384-chat-fold[open] summary::after{content:'⌃'}
.tcai384-visual,.tcai384-chat-preview{padding:8px 10px 11px;text-align:center}
.tcai384-visual img,.tcai384-chat-preview img{display:block;object-fit:contain;width:min(100%,320px);height:auto;max-height:275px;margin:0 auto 9px;cursor:zoom-in;background:#f1f5f9;border-radius:10px}
.tcai384-visual button,.tcai384-chat-preview button{min-height:38px;padding:7px 11px}
.tcai384-copy{padding:3px 12px 9px}.tcai384-copy p{margin:4px 0}
.tcai384-ask{margin-top:10px;min-height:40px;width:100%}
.tcai384-chat{border:1px solid #d5e1ec;border-radius:12px;padding:10px;margin-top:14px;background:#f8fbfd}
.tcai384-chatheading{font-weight:700;font-size:13px;color:#233e56;margin:0 0 8px}
.tcai384-chat-fold{background:white;border:1px solid #d9e1e9;border-radius:8px;margin:5px 0;overflow:hidden}
.tcai384-chat-fold summary{font-weight:600}
.tcai384-seeall{min-height:42px;margin-top:8px}
.tcai384-overlay{position:fixed;inset:0;z-index:99999;background:rgba(4,15,27,.84);display:flex;justify-content:center;align-items:center;padding:12px;overflow:auto}
.tcai384-modal{background:white;color:#172a3c;border-radius:15px;padding:12px;width:min(100%,640px);max-height:95vh;overflow:auto}
.tcai384-modalhead{display:flex;align-items:center;justify-content:space-between;gap:8px;margin-bottom:8px}
.tcai384-modalhead button{min-height:44px;white-space:nowrap}
.tcai384-modal img{width:100%;height:auto;display:block;max-height:69vh;object-fit:contain;background:#f1f5f9;border-radius:8px}
.tcai384-modal p{font-size:13px;line-height:1.4;margin:8px 0}
@media(max-width:650px){.tcai384-controls{grid-template-columns:1fr 1fr}.tcai384-controls label:last-child{grid-column:1/-1}.tcai384-grid{grid-template-columns:1fr}.tcai384-modalhead strong{font-size:14px}}

/* FASE 386: il foglio generale nasconde i tag section; il catalogo deve rimanere visibile. */
#page.active #content .tcai384-library{display:block}
