/* Golden Horseshoe Trade Matrix chatbot — all rules scoped to .ghtm */
.ghtm{--navy:#0B1426;--card:#13223F;--line:#1C3A66;--gold:#E3B04B;--gold2:#F6D67A;--teal:#2BB3A3;--txt:#EEF2FA;--muted:#A9B6D3;
  box-sizing:border-box;position:relative;display:flex;flex-direction:column;width:100%;max-width:920px;height:min(760px,88vh);margin:0 auto;
  background:radial-gradient(120% 60% at 80% 0%,#18305a 0%,var(--navy) 55%) var(--navy);color:var(--txt);border:1px solid var(--line);
  border-radius:20px;overflow:hidden;font:15px/1.55 -apple-system,BlinkMacSystemFont,"Segoe UI",Calibri,Roboto,Arial,sans-serif;
  box-shadow:0 20px 60px rgba(0,0,0,.45)}
.ghtm *,.ghtm *::before,.ghtm *::after{box-sizing:border-box}
.ghtm button{font:inherit;cursor:pointer}
/* header */
.ghtm-head{display:flex;align-items:center;gap:14px;padding:14px 18px;background:rgba(11,20,38,.85);border-bottom:1px solid var(--line);backdrop-filter:blur(6px)}
.ghtm-avatar{position:relative;width:54px;height:54px;flex:0 0 54px}
.ghtm-orb{position:absolute;inset:9px;border-radius:50%;background:radial-gradient(circle at 35% 35%,#FFF6D6,var(--gold2) 40%,#B07A26);
  box-shadow:0 0 18px rgba(246,214,122,.65);display:flex;align-items:center;justify-content:center;animation:ghtm-pulse 3.2s ease-in-out infinite}
.ghtm-orb svg{width:70%;height:70%}
.ghtm-ring{position:absolute;inset:0;border-radius:50%;border:2px dashed rgba(227,176,75,.55);animation:ghtm-spin 14s linear infinite}
.ghtm-ring.r2{inset:4px;border:1.5px solid rgba(43,179,163,.5);border-top-color:transparent;border-bottom-color:transparent;animation-duration:5s;animation-direction:reverse}
.ghtm-avatar.busy .ghtm-ring.r2{animation-duration:1.1s}
.ghtm-avatar.busy .ghtm-orb,.ghtm-avatar.talk .ghtm-orb{animation:ghtm-pulse .7s ease-in-out infinite}
@keyframes ghtm-spin{to{transform:rotate(360deg)}}
@keyframes ghtm-pulse{0%,100%{transform:scale(1);box-shadow:0 0 14px rgba(246,214,122,.5)}50%{transform:scale(1.07);box-shadow:0 0 28px rgba(246,214,122,.9)}}
.ghtm-ttl{flex:1;min-width:0}
.ghtm-name{font-family:Cambria,Georgia,"Times New Roman",serif;font-weight:700;font-size:19px;color:#fff;line-height:1.2}
.ghtm-tag{font-size:12px;color:var(--gold);letter-spacing:.04em;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.ghtm-ctrls{display:flex;align-items:center;gap:8px}
.ghtm-icon-btn{width:38px;height:38px;border-radius:50%;border:1px solid var(--line);background:var(--card);color:var(--muted);display:flex;align-items:center;justify-content:center;padding:0;transition:.2s}
.ghtm-icon-btn svg{width:20px;height:20px}
.ghtm-icon-btn .ghtm-wave{opacity:.35}
.ghtm-icon-btn.on{color:var(--navy);background:var(--gold);border-color:var(--gold)}
.ghtm-icon-btn.on .ghtm-wave{opacity:1}
.ghtm-lang{display:flex;border:1px solid var(--line);border-radius:999px;overflow:hidden;background:var(--card)}
.ghtm-lang button{border:0;background:transparent;color:var(--muted);padding:8px 12px;font-weight:700;font-size:13px;letter-spacing:.06em;transition:.2s}
.ghtm-lang button.on{background:var(--gold);color:var(--navy)}
/* log */
.ghtm-log{position:relative;flex:1;overflow-y:auto;padding:18px;scroll-behavior:smooth;display:flex;flex-direction:column;gap:14px}
.ghtm-log::-webkit-scrollbar{width:8px}.ghtm-log::-webkit-scrollbar-thumb{background:var(--line);border-radius:8px}
.ghtm-msg{flex-shrink:0;max-width:86%;animation:ghtm-in .45s cubic-bezier(.2,.8,.2,1) both}
@keyframes ghtm-in{from{opacity:0;transform:translateY(12px) scale(.98)}to{opacity:1;transform:none}}
.ghtm-user{align-self:flex-end;background:linear-gradient(135deg,var(--gold2),var(--gold));color:var(--navy);padding:10px 15px;border-radius:16px 16px 4px 16px;font-weight:600}
.ghtm-bot{align-self:flex-start;background:var(--card);border:1px solid var(--line);border-radius:16px 16px 16px 4px;overflow:hidden;box-shadow:0 6px 18px rgba(0,0,0,.25)}
.ghtm-welcome{max-width:100%}
.ghtm-fig{position:relative;aspect-ratio:16/9;max-height:260px;width:100%;overflow:hidden;background:#0B1426}
.ghtm-fig img{width:100%;height:100%;object-fit:cover;display:block;animation:ghtm-kb 14s ease-out both}
.ghtm-welcome .ghtm-fig{max-height:230px}
@keyframes ghtm-kb{from{transform:scale(1.12)}to{transform:scale(1)}}
.ghtm-h{font-family:Cambria,Georgia,serif;font-size:18px;font-weight:700;color:var(--gold2);padding:14px 18px 0}
.ghtm-body{padding:10px 18px 14px}
.ghtm-body p{margin:0 0 9px}
.ghtm-body p:last-child{margin-bottom:0}
.ghtm-body ul,.ghtm-body ol{margin:4px 0 10px;padding-left:20px}
.ghtm-body li{margin:4px 0}
.ghtm-body li::marker{color:var(--gold)}
.ghtm-body strong{color:#fff}
.ghtm-body .ghtm-note{font-size:13px;color:var(--muted);font-style:italic;border-top:1px dashed var(--line);padding-top:8px;margin-top:10px}
.ghtm-rel{display:flex;flex-wrap:wrap;gap:6px;align-items:center;padding:0 18px 14px}
.ghtm-rel-l{font-size:12px;color:var(--muted);margin-right:2px}
.ghtm-chip{border:1px solid rgba(227,176,75,.55);background:rgba(227,176,75,.08);color:var(--gold2);border-radius:999px;padding:6px 12px;font-size:13px;transition:.2s}
.ghtm-chip:hover,.ghtm-chip:focus-visible{background:var(--gold);color:var(--navy)}
.ghtm-watch{margin-top:10px;border:0;background:var(--teal);color:#fff;border-radius:999px;padding:9px 16px;font-weight:700}
/* tiles */
.ghtm-tiles-wrap{flex-shrink:0;transition:opacity .3s}
.ghtm-tiles-wrap.ghtm-collapsed{display:none}
.ghtm-label{font-size:12px;font-weight:700;letter-spacing:.18em;color:var(--gold);text-transform:uppercase;margin:4px 2px 10px}
.ghtm-tiles{display:grid;grid-template-columns:repeat(3,1fr);gap:10px}
.ghtm-tile{display:flex;align-items:center;gap:10px;text-align:left;border:1px solid var(--line);background:linear-gradient(160deg,#172a4d,var(--card));color:var(--txt);
  border-radius:14px;padding:12px;min-height:64px;transition:transform .2s,border-color .2s,box-shadow .2s;animation:ghtm-in .5s both}
.ghtm-tile:hover,.ghtm-tile:focus-visible{transform:translateY(-3px);border-color:var(--gold);box-shadow:0 8px 20px rgba(227,176,75,.18)}
.ghtm-tile-ic{flex:0 0 36px;height:36px;border-radius:50%;background:var(--gold);color:var(--navy);display:flex;align-items:center;justify-content:center;font-size:17px;font-weight:700}
.ghtm-tile:nth-child(even) .ghtm-tile-ic{background:var(--teal);color:#fff}
.ghtm-tile-tx{font-size:14px;font-weight:600;line-height:1.3}
.ghtm-tiles-mini{display:flex;flex-wrap:wrap;gap:6px;padding:14px}
/* typing */
.ghtm-typing{padding:14px 18px;display:flex;gap:5px}
.ghtm-typing span{width:8px;height:8px;border-radius:50%;background:var(--gold);animation:ghtm-dot 1s infinite}
.ghtm-typing span:nth-child(2){animation-delay:.15s}.ghtm-typing span:nth-child(3){animation-delay:.3s}
@keyframes ghtm-dot{0%,80%,100%{opacity:.25;transform:translateY(0)}40%{opacity:1;transform:translateY(-4px)}}
/* video */
.ghtm-video{position:relative;aspect-ratio:16/9;width:min(640px,80vw);margin:10px 18px 16px}
.ghtm-video iframe{position:absolute;inset:0;width:100%;height:100%;border:0;border-radius:10px}
.ghtm-video-el{display:block;width:min(640px,80vw);margin:10px 18px 16px;border-radius:10px;background:#000}
/* input */
.ghtm-input{display:flex;gap:8px;padding:12px 14px;border-top:1px solid var(--line);background:rgba(11,20,38,.9)}
.ghtm-input input{flex:1;min-width:0;background:var(--card);border:1px solid var(--line);color:#fff;border-radius:999px;padding:11px 16px;font:inherit;outline:none;transition:border-color .2s}
.ghtm-input input:focus{border-color:var(--gold)}
.ghtm-input input::placeholder{color:#7f8db0}
.ghtm-send,.ghtm-topics-btn{flex:0 0 44px;height:44px;border-radius:50%;border:0;display:flex;align-items:center;justify-content:center;padding:0}
.ghtm-send{background:var(--gold);color:var(--navy)}
.ghtm-send svg{width:20px;height:20px}
.ghtm-topics-btn{background:var(--card);border:1px solid var(--line);color:var(--gold);font-size:18px}
.ghtm-foot{font-size:11px;color:#7f8db0;text-align:center;padding:6px 12px 9px;background:rgba(11,20,38,.9)}
.ghtm button:focus-visible,.ghtm input:focus-visible{outline:2px solid var(--gold2);outline-offset:2px}
@media (max-width:640px){
  .ghtm{height:min(720px,92vh);border-radius:14px;font-size:14.5px}
  .ghtm-tiles{grid-template-columns:repeat(2,1fr)}
  .ghtm-tag{display:none}
  .ghtm-name{font-size:16px}
  .ghtm-fig{max-height:190px}
  .ghtm-msg{max-width:94%}
  .ghtm-head{padding:10px 12px;gap:10px}
}
@media (prefers-reduced-motion:reduce){.ghtm *{animation:none!important;transition:none!important}}
