/* AXESS Human Touch – independent, non-modal interface. */
#aht { --aht-blue:#126eb6; margin:10px 0 0; display:flex; flex-direction:column; align-items:flex-end; gap:7px; color:#18324e; }
#aht .aht-controls {display:flex; align-items:center; gap:8px; max-width:100%;}
#aht .aht-label {display:flex; flex-direction:column; text-align:right; line-height:1.25;}
#aht .aht-label strong {font-size:12px; color:#264967;}
#aht .aht-label small {font-size:11px; color:#526b82;}
#aht #aht-face {display:grid;place-items:center;flex:none;width:52px;height:52px;min-height:52px;min-width:52px;padding:2px;border-radius:50%;border:1px solid #b5d5eb;background:#fff;box-shadow:0 2px 6px #18324e12;touch-action:manipulation;user-select:none;-webkit-touch-callout:none;}
#aht #aht-face>svg {width:46px;height:46px;max-width:none;overflow:visible;}
#aht .aht-face-disc {fill:#d9effc;stroke:#126eb6;stroke-width:1.5;}
#aht .aht-eye {fill:#173c60;transform-box:fill-box;transform-origin:center;}
#aht .aht-cheek {fill:#edb3b0;opacity:.8;}
#aht .aht-mouth {stroke:#173c60;stroke-width:2.4;stroke-linecap:round;fill:none;}
#aht .aht-smile {opacity:0;}
#aht .aht-animate .aht-eye {animation:aht-blink 1.9s ease-in-out 1;}
#aht .aht-animate .aht-mouth-normal {animation:aht-normal-mouth 1.9s ease-in-out 1;}
#aht .aht-animate .aht-smile {animation:aht-big-smile 1.9s ease-in-out 1;}
@keyframes aht-blink {0%,19%,33%,64%,78%,100%{transform:scaleY(1)} 25%,71%{transform:scaleY(.08)}}
@keyframes aht-normal-mouth {0%,100%{opacity:1} 15%,88%{opacity:0}}
@keyframes aht-big-smile {0%,100%{opacity:0} 15%,88%{opacity:1}}
#aht[data-mode=off] .aht-face-disc {fill:#e9edf0;stroke:#8796a2;}
#aht[data-mode=off] .aht-eye {fill:#677684;}
#aht[data-mode=off] .aht-mouth {stroke:#677684;}
#aht[data-mode=off] .aht-cheek {fill:#b8c0c6;}
#aht[data-mode=off] .aht-label strong {color:#677684;}
#aht #aht-settings {width:40px;height:40px;min-height:40px;flex:none;padding:7px;background:#fff;border:1px solid #c8d9e9;color:#526b82;}
#aht .aht-panel {width:min(310px,100%);border:1px solid #c8d9e9;border-left:3px solid var(--aht-blue);border-radius:11px;padding:12px;background:#fff;box-shadow:0 3px 12px #18324e0b;}
#aht .aht-panel-head {display:flex;justify-content:space-between;align-items:center;gap:6px;}
#aht .aht-panel-head strong {font-size:14px;color:var(--aht-blue);}
#aht button.aht-close:not(.metric-card):not(.eye):not(#toast-close) {width:34px;height:34px;min-height:34px;padding:3px;background:#fff;color:#526b82;border-color:#dce7f2;font-size:20px;}
#aht .aht-panel p {font-size:14px;margin:6px 0 0;line-height:1.45;}
#aht .aht-panel fieldset {border:0;padding:0;margin:6px 0;min-width:0;}
#aht .aht-panel legend {font-size:12px;color:#526b82;padding:0;}
#aht .aht-panel label {display:flex;align-items:center;gap:8px;margin:8px 0;font-weight:400;font-size:14px;cursor:pointer;}
#aht .aht-panel input {width:17px;height:17px;flex:none;accent-color:var(--aht-blue);margin:0;}
#aht .aht-panel .aht-privacy {font-size:12px;color:#526b82;}
/* Fixed anchor, independent of page scrolling. Panels are positioned beside it. */
#aht {position:fixed;left:0;top:0;z-index:10;margin:0;display:block;width:max-content;max-width:calc(100vw - 24px);}
#aht .aht-controls {padding:4px 6px;border:1px solid #dce7f2;border-radius:32px;background:#fff;box-shadow:0 2px 9px #18324e18;}
#aht #aht-face {touch-action:none;cursor:grab;}
#aht.aht-dragging #aht-face {cursor:grabbing;}
#aht .aht-panel {position:absolute;width:min(310px,calc(100vw - 24px));max-width:none;overflow:auto;overscroll-behavior:contain;box-shadow:0 5px 20px #18324e26;}
#aht #aht-reset-position {font-size:12px;padding:6px 10px;min-height:32px;}
@media(max-width:720px){#aht .aht-label{display:none;}#aht .aht-controls{gap:4px;padding:3px;}#aht #aht-settings{width:36px;height:36px;min-height:36px;}}
@media(prefers-reduced-motion:reduce){#aht *{animation:none!important;transition:none!important;}}

/* Approved AXESS monitor mascot. Resting image is static; only the short on-demand gesture animates. */
#aht #aht-face {width:100px;min-width:100px;height:70px;min-height:70px;padding:2px;border-radius:14px;border:0;background:transparent;box-shadow:none;overflow:visible;}
#aht .aht-mascot {position:relative;display:block;width:96px;height:64px;pointer-events:none;user-select:none;transform-origin:50% 85%;}
#aht .aht-mascot img {position:absolute;inset:0;width:100%;height:100%;object-fit:contain;max-width:none;pointer-events:none;user-select:none;}
#aht .aht-monitor-motion {position:absolute;inset:0;visibility:hidden;}
#aht .aht-monitor-wave {transform-origin:77% 54%;}
#aht .aht-monitor-wink {opacity:0;}
#aht .aht-animate .aht-monitor-rest {visibility:hidden;}
#aht .aht-animate .aht-monitor-motion {visibility:visible;}
#aht .aht-animate .aht-mascot {animation:aht-monitor-nod 1.9s ease-in-out 1;}
#aht .aht-animate .aht-monitor-wave {animation:aht-monitor-wave 1.9s ease-in-out 1;}
#aht .aht-animate .aht-monitor-wink {animation:aht-monitor-wink 1.9s linear 1;}
@keyframes aht-monitor-nod {0%,100%{transform:none}25%,65%{transform:translateY(-3px) rotate(-2deg)}45%,80%{transform:translateY(-1px) rotate(1deg)}}
@keyframes aht-monitor-wave {0%,100%{transform:none}20%,55%{transform:rotate(-9deg)}37%,73%{transform:rotate(8deg)}}
@keyframes aht-monitor-wink {0%,19%,38%,100%{opacity:0}23%,34%{opacity:1}}
#aht[data-mode=off] .aht-mascot {filter:grayscale(1);opacity:.65;}
@media(max-width:720px){#aht #aht-face{width:80px;min-width:80px;height:56px;min-height:56px;}#aht .aht-mascot{width:78px;height:52px;}}
@media(prefers-reduced-motion:reduce){#aht .aht-animate .aht-monitor-rest{visibility:visible;}#aht .aht-animate .aht-monitor-motion{visibility:hidden;}}

/* Personalizzazione AHT: nessuna modifica alle schermate operative. */
#aht #aht-automatic {border-top:1px solid #dce7f2;padding-top:6px;margin-top:12px;}
#aht #aht-automatic legend {font-weight:600;color:#264967;}
#aht .aht-panel .aht-select-label {justify-content:space-between;font-size:12px;margin-left:25px;gap:6px;}
#aht .aht-panel select {width:auto;min-width:100px;max-width:145px;font-size:12px;min-height:32px;padding:4px 8px;}
#aht #aht-automatic:disabled {opacity:.55;}

#aht #aht-preview {font-size:12px;padding:6px 10px;min-height:32px;margin:2px 0 8px;}

/* Automatic side docking: same mascot and controls, narrow vertical layout. */
#aht:is([data-dock=left],[data-dock=right]) .aht-controls{flex-direction:column;align-items:center;width:112px;box-sizing:border-box;gap:4px;padding:8px 4px;border-radius:20px;}
#aht:is([data-dock=left],[data-dock=right]) .aht-label{display:flex;text-align:center;max-width:100%;overflow-wrap:anywhere;}
#aht:is([data-dock=left],[data-dock=right]) .aht-label strong{font-size:11px;}
#aht:is([data-dock=left],[data-dock=right]) .aht-label small{font-size:10px;}
@media(max-width:720px){#aht:is([data-dock=left],[data-dock=right]) .aht-controls{width:90px;padding:5px 3px;border-radius:16px;}#aht:is([data-dock=left],[data-dock=right]) .aht-label{display:none;}}
