.ex-agent-root,
.ex-agent-panel,
.ex-agent-fab,
.ex-agent-foot input,
.ex-agent-gate input,
.ex-agent-foot button,
.ex-agent-gate button {
  font-family: 'Vazirmatn', Tahoma, sans-serif;
}

.ex-agent-root .ex-icon {
  display: inline-block;
  width: 1.25em;
  height: 1.25em;
  vertical-align: -0.2em;
  fill: none;
  stroke: currentColor;
  flex-shrink: 0;
}
.ex-icon-sm { width: 16px; height: 16px; }
.ex-icon-md { width: 20px; height: 20px; }
.ex-icon-lg { width: 24px; height: 24px; }

/* ─── 3D professional FAB + eye tracking ─── */
.ex-agent-fab {
  position: fixed; z-index: 85; inset-inline-end: 16px; bottom: 20px;
  width: 76px; height: 76px; border-radius: 26px; border: 0; cursor: pointer;
  background: transparent; padding: 0;
  perspective: 900px;
  -webkit-tap-highlight-color: transparent;
}
.ex-agent-fab-scene {
  position: relative; width: 100%; height: 100%;
  display: grid; place-items: center;
  transform-style: preserve-3d;
  animation: exFabFloat 4s ease-in-out infinite;
}
.ex-agent-fab-glow {
  position: absolute; inset: -8px;
  border-radius: 30px;
  background: radial-gradient(circle at 40% 30%, rgba(251,191,36,.5), rgba(15,23,42,.18) 48%, transparent 72%);
  filter: blur(12px);
  animation: exFabPulse 2.8s ease-in-out infinite;
  pointer-events: none;
}
.ex-agent-fab-ring,
.ex-agent-fab-ring-b {
  position: absolute; inset: 1px;
  border-radius: 24px;
  border: 1.5px solid rgba(251,191,36,.4);
  transform: translateZ(-14px) rotateX(62deg);
  animation: exFabRing 6s linear infinite;
  pointer-events: none;
}
.ex-agent-fab-ring-b {
  inset: -5px;
  border-color: rgba(148,163,184,.28);
  animation-duration: 9s;
  animation-direction: reverse;
  opacity: .65;
}
.ex-agent-fab-orb {
  position: relative; width: 68px; height: 68px;
  border-radius: 22px;
  background:
    linear-gradient(145deg, rgba(255,255,255,.38), transparent 40%),
    linear-gradient(165deg, #1e293b 0%, #0f172a 48%, #020617 100%);
  border: 1px solid rgba(251,191,36,.35);
  box-shadow:
    0 20px 40px rgba(15,23,42,.42),
    0 2px 0 rgba(255,255,255,.22) inset,
    0 -10px 22px rgba(0,0,0,.35) inset,
    0 0 0 1px rgba(15,23,42,.4);
  display: grid; place-items: center;
  transform-style: preserve-3d;
  overflow: hidden;
  transition: box-shadow .2s ease;
  will-change: transform;
}
.ex-agent-fab-orb-shine {
  position: absolute; inset: 0; z-index: 2;
  background: linear-gradient(115deg, transparent 28%, rgba(255,255,255,.28) 48%, transparent 62%);
  transform: translateX(-120%);
  animation: exFabShine 4.2s ease-in-out infinite;
  pointer-events: none;
}
.ex-agent-face {
  position: relative; z-index: 1; width: 52px; height: 52px;
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(255,255,255,.08), transparent 35%),
    linear-gradient(160deg, #243447 0%, #0f172a 100%);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.12), 0 8px 16px rgba(0,0,0,.25);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  transform: translateZ(22px);
  overflow: hidden;
}
.ex-agent-face-crest {
  position: absolute; top: 5px; width: 18px; height: 3px; border-radius: 99px;
  background: linear-gradient(90deg, #fbbf24, #f59e0b);
  box-shadow: 0 0 10px rgba(251,191,36,.55);
}
.ex-agent-face-glass {
  display: flex; align-items: center; justify-content: center; gap: 7px;
  margin-top: 4px;
  width: 40px; height: 18px; border-radius: 999px;
  background: linear-gradient(180deg, rgba(186,230,253,.55), rgba(56,189,248,.22));
  border: 1px solid rgba(125,211,252,.45);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.45), 0 2px 6px rgba(14,165,233,.2);
}
.ex-agent-eye {
  width: 9px; height: 9px; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #fff, #e2e8f0 55%, #94a3b8);
  display: grid; place-items: center;
  overflow: hidden;
  box-shadow: inset 0 0 0 1px rgba(15,23,42,.12);
}
.ex-agent-pupil {
  width: 4.5px; height: 4.5px; border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, #334155, #020617 70%);
  position: relative;
  transition: transform .08s linear;
  will-change: transform;
}
.ex-agent-pupil i {
  position: absolute; top: 1px; left: 1px;
  width: 1.5px; height: 1.5px; border-radius: 50%;
  background: #fff; opacity: .85; pointer-events: none;
}
.ex-agent-face-mouth {
  margin-top: 5px; width: 12px; height: 3px; border-radius: 99px;
  background: rgba(251,191,36,.75);
  box-shadow: 0 0 6px rgba(251,191,36,.35);
}
.ex-agent-face-badge {
  position: absolute; bottom: 4px; right: 5px;
  font-size: 7px; font-weight: 900; letter-spacing: .04em;
  color: #0f172a; background: linear-gradient(135deg,#fde68a,#f59e0b);
  border-radius: 4px; padding: 1px 3px; line-height: 1.2;
  box-shadow: 0 2px 4px rgba(0,0,0,.25);
}
.ex-agent-fab:hover .ex-agent-fab-orb {
  box-shadow:
    0 24px 48px rgba(15,23,42,.48),
    0 2px 0 rgba(255,255,255,.28) inset,
    0 -10px 22px rgba(0,0,0,.35) inset,
    0 0 0 1px rgba(251,191,36,.45);
}
.ex-agent-fab:active .ex-agent-fab-scene {
  animation: none;
  transform: translateY(2px) scale(.96);
}

@keyframes exFabFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-7px); }
}
@keyframes exFabRing {
  from { transform: translateZ(-14px) rotateX(62deg) rotateZ(0deg); }
  to { transform: translateZ(-14px) rotateX(62deg) rotateZ(360deg); }
}
@keyframes exFabPulse {
  0%, 100% { opacity: .5; transform: scale(1); }
  50% { opacity: .9; transform: scale(1.07); }
}
@keyframes exFabShine {
  0%, 40% { transform: translateX(-130%); }
  65%, 100% { transform: translateX(130%); }
}

@media (prefers-reduced-motion: reduce) {
  .ex-agent-fab-scene,
  .ex-agent-fab-ring,
  .ex-agent-fab-ring-b,
  .ex-agent-fab-glow,
  .ex-agent-fab-orb-shine { animation: none !important; }
  .ex-agent-pupil { transition: none; }
}

.ex-agent-panel {
  position: fixed; z-index: 86; inset-inline-end: 16px; bottom: 104px;
  width: min(100vw - 24px, 400px); height: min(72vh, 560px);
  background: #fff; border: 2px solid #e2e8f0; border-radius: 1.5rem;
  box-shadow: 0 30px 80px rgba(15,23,42,.28);
  display: flex; flex-direction: column; overflow: hidden;
  direction: rtl; text-align: right;
}
.ex-agent-head {
  padding: 14px 16px; background: linear-gradient(120deg, #0f172a, #1e293b);
  color: #fff; display: flex; align-items: center; justify-content: space-between; gap: 8px;
}
.ex-agent-head-main { display: flex; align-items: center; gap: 10px; min-width: 0; }
.ex-agent-head-ico {
  width: 40px; height: 40px; border-radius: 14px;
  display: inline-flex; align-items: center; justify-content: center;
  background: linear-gradient(145deg, #fbbf24, #f59e0b); color: #0f172a; flex-shrink: 0;
  box-shadow: 0 8px 16px rgba(0,0,0,.25), inset 0 1px 0 rgba(255,255,255,.45);
}
.ex-agent-head h3 { margin: 0; font-size: 14px; font-weight: 900; }
.ex-agent-head p { margin: 2px 0 0; font-size: 10px; opacity: .8; font-weight: 700; }
.ex-agent-close {
  border: 0; background: rgba(255,255,255,.1); color: #fff;
  width: 36px; height: 36px; border-radius: 12px; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
}
.ex-agent-close:hover { background: rgba(255,255,255,.18); }

.ex-agent-body { flex: 1; overflow: auto; padding: 14px; background: #f8fafc; }
.ex-agent-bubble {
  max-width: 92%; margin-bottom: 10px; padding: 10px 12px; border-radius: 1rem;
  font-size: 12px; font-weight: 700; line-height: 1.75;
}
.ex-agent-bubble.user {
  margin-inline-start: auto; background: #0f172a; color: #fff;
  border-bottom-left-radius: .35rem;
}
.ex-agent-bubble.bot {
  background: #fff; border: 1px solid #e2e8f0; color: #0f172a;
  border-bottom-right-radius: .35rem;
}
.ex-agent-bubble.bot .ex-agent-msg p { margin: 0 0 .55rem; }
.ex-agent-bubble.bot .ex-agent-msg ul { margin: .2rem 0 .6rem; padding-inline-start: 1.1rem; }
.ex-agent-thinking {
  display: inline-flex; align-items: center; gap: .45rem; color: #b45309;
}
.ex-agent-thinking-ico {
  display: inline-flex; animation: exAgentSpin 1.2s linear infinite;
}
@keyframes exAgentSpin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.ex-agent-hint {
  font-size: 11px; font-weight: 800; color: #b45309; background: #fffbeb;
  border: 1px dashed #f59e0b; border-radius: .9rem; padding: 8px 10px; margin-bottom: 10px;
}

.ex-agent-foot {
  padding: 10px; border-top: 1px solid #e2e8f0; background: #fff;
  display: flex; gap: 8px; align-items: center;
}
.ex-agent-foot input, .ex-agent-gate input {
  flex: 1; border: 2px solid #e2e8f0; border-radius: .9rem; padding: .7rem .85rem;
  font-size: 12px; font-weight: 800; font-family: inherit;
}
.ex-agent-foot input:focus, .ex-agent-gate input:focus {
  outline: none; border-color: #f59e0b; box-shadow: 0 0 0 3px rgba(245,158,11,.15);
}
.ex-agent-send, .ex-agent-primary, .ex-agent-gate button {
  border: 0; border-radius: .9rem; padding: .7rem 1rem; font-size: 12px; font-weight: 900;
  background: linear-gradient(90deg,#fbbf24,#f59e0b); color: #0f172a; cursor: pointer;
  font-family: inherit;
}
.ex-agent-send {
  width: 44px; height: 44px; padding: 0;
  display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.ex-agent-send:disabled, .ex-agent-primary:disabled { opacity: .55; cursor: not-allowed; }

.ex-agent-gate { padding: 16px; display: grid; gap: 8px; }
.ex-agent-gate label {
  font-size: 11px; font-weight: 900; color: #334155;
  display: inline-flex; align-items: center; gap: .35rem;
}
.ex-agent-gate-lead {
  font-size: 11px; font-weight: 700; color: #64748b; line-height: 1.7; margin: 0 0 4px;
}
.ex-agent-err { font-size: 11px; font-weight: 800; color: #e11d48; margin: 0; }
.ex-agent-primary { width: 100%; display: inline-flex; align-items: center; justify-content: center; }

/* Glass option chips */
.ex-agent-options {
  display: flex; flex-wrap: wrap; gap: .45rem; margin-top: .75rem;
}
.ex-agent-chip {
  appearance: none; border: 1px solid rgba(255,255,255,.55);
  border-radius: 999px; cursor: pointer; text-align: right;
  padding: .55rem .85rem; min-height: 40px;
  display: inline-flex; flex-direction: column; align-items: flex-start; gap: .1rem;
  background: linear-gradient(145deg, rgba(255,255,255,.72), rgba(255,255,255,.28));
  backdrop-filter: blur(14px) saturate(1.35);
  -webkit-backdrop-filter: blur(14px) saturate(1.35);
  box-shadow:
    0 8px 22px rgba(15,23,42,.08),
    inset 0 1px 0 rgba(255,255,255,.75),
    inset 0 -1px 0 rgba(15,23,42,.04);
  color: #0f172a; font-family: inherit; transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}
.ex-agent-chip:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(15,23,42,.14), inset 0 1px 0 rgba(255,255,255,.85);
  border-color: rgba(251,191,36,.65);
}
.ex-agent-chip:active { transform: translateY(0) scale(.98); }
.ex-agent-chip-label { font-size: .72rem; font-weight: 900; line-height: 1.3; }
.ex-agent-chip-hint { font-size: .58rem; font-weight: 700; color: #64748b; }
.ex-agent-chip.tone-price {
  background: linear-gradient(145deg, rgba(254,243,199,.85), rgba(255,255,255,.35));
  border-color: rgba(251,191,36,.45);
}
.ex-agent-chip.tone-listing {
  background: linear-gradient(145deg, rgba(209,250,229,.85), rgba(255,255,255,.35));
  border-color: rgba(52,211,153,.4);
}
.ex-agent-chip.tone-wiki {
  background: linear-gradient(145deg, rgba(219,234,254,.85), rgba(255,255,255,.35));
  border-color: rgba(96,165,250,.45);
}

/* Clickable listing / link cards */
.ex-agent-cards {
  display: grid; gap: .55rem; margin-top: .75rem;
}
.ex-agent-card {
  display: grid; grid-template-columns: 72px 1fr; gap: .65rem; align-items: stretch;
  text-decoration: none; color: inherit; border: 0; width: 100%; cursor: pointer;
  padding: .4rem; border-radius: 1rem; text-align: right; font-family: inherit;
  background: linear-gradient(145deg, rgba(255,255,255,.88), rgba(248,250,252,.55));
  border: 1px solid rgba(226,232,240,.9);
  box-shadow: 0 10px 24px rgba(15,23,42,.07), inset 0 1px 0 rgba(255,255,255,.9);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}
.ex-agent-card:hover {
  transform: translateY(-2px);
  border-color: rgba(251,191,36,.55);
  box-shadow: 0 14px 30px rgba(15,23,42,.12);
}
.ex-agent-card-media {
  display: block; width: 72px; height: 72px; border-radius: .85rem; overflow: hidden;
  background: linear-gradient(135deg,#0f172a,#1e293b); flex-shrink: 0;
}
.ex-agent-card-media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ex-agent-card-media.is-empty {
  background:
    radial-gradient(circle at 30% 25%, rgba(251,191,36,.45), transparent 55%),
    linear-gradient(145deg,#0f172a,#334155);
}
.ex-agent-card-body { display: flex; flex-direction: column; gap: .15rem; min-width: 0; padding: .15rem .25rem .15rem 0; }
.ex-agent-card-badge {
  align-self: flex-start; font-size: .55rem; font-weight: 900;
  color: #92400e; background: #fef3c7; border-radius: 999px; padding: .12rem .4rem;
}
.ex-agent-card.type-listing .ex-agent-card-badge { color: #065f46; background: #d1fae5; }
.ex-agent-card.type-price .ex-agent-card-badge { color: #92400e; background: #fde68a; }
.ex-agent-card.type-link .ex-agent-card-badge { color: #1e3a8a; background: #dbeafe; }
.ex-agent-card-title {
  font-size: .78rem; font-weight: 900; color: #0f172a; line-height: 1.4;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.ex-agent-card-meta { font-size: .62rem; font-weight: 700; color: #64748b; }
.ex-agent-card-price { font-size: .78rem; font-weight: 900; color: #047857; margin-top: auto; }

/* Live price panel from /prices */
.ex-agent-price-panel{
  margin-top:.75rem;border-radius:1.1rem;overflow:hidden;
  background:linear-gradient(160deg,#0f172a 0%,#1e293b 55%,#0f172a 100%);
  border:1px solid rgba(251,191,36,.35);
  box-shadow:0 14px 32px rgba(15,23,42,.22), inset 0 1px 0 rgba(255,255,255,.08);
}
.ex-agent-price-panel-head{
  display:flex;align-items:flex-start;justify-content:space-between;gap:.75rem;
  padding:.85rem .9rem .65rem;border-bottom:1px solid rgba(255,255,255,.08);
}
.ex-agent-price-kicker{
  display:block;font-size:.58rem;font-weight:900;color:#fbbf24;letter-spacing:.02em;margin-bottom:.2rem;
}
.ex-agent-price-panel-head strong{display:block;font-size:.82rem;font-weight:900;color:#fff}
.ex-agent-price-all{
  flex-shrink:0;font-size:.65rem;font-weight:900;color:#0f172a;text-decoration:none;
  background:linear-gradient(135deg,#fde68a,#f59e0b);border-radius:.65rem;padding:.4rem .65rem;
}
.ex-agent-price-empty{
  margin:0;padding:.9rem;font-size:.72rem;font-weight:700;color:#cbd5e1;line-height:1.7;
}
.ex-agent-price-rows{display:grid;gap:.45rem;padding:.65rem .7rem}
.ex-agent-price-row{
  display:flex;align-items:center;justify-content:space-between;gap:.7rem;
  text-decoration:none;color:inherit;border-radius:.85rem;padding:.65rem .7rem;
  background:rgba(255,255,255,.06);border:1px solid rgba(255,255,255,.08);
  transition:background .15s ease,border-color .15s ease,transform .15s ease;
}
.ex-agent-price-row:hover{
  background:rgba(251,191,36,.12);border-color:rgba(251,191,36,.35);transform:translateY(-1px);
}
.ex-agent-price-row-main{min-width:0;display:flex;flex-direction:column;gap:.15rem}
.ex-agent-price-row-title{
  font-size:.74rem;font-weight:900;color:#fff;line-height:1.4;
  display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;
}
.ex-agent-price-row-meta{font-size:.58rem;font-weight:700;color:#94a3b8}
.ex-agent-price-row-side{text-align:left;flex-shrink:0;display:flex;flex-direction:column;align-items:flex-end;gap:.2rem}
.ex-agent-price-amount{font-size:.82rem;font-weight:900;color:#fde68a;direction:ltr}
.ex-agent-price-amount small{font-size:.58rem;font-weight:800;color:#cbd5e1}
.ex-agent-price-change{
  font-size:.58rem;font-weight:900;border-radius:999px;padding:.12rem .4rem;
  background:rgba(148,163,184,.2);color:#e2e8f0;
}
.ex-agent-price-change.is-up{background:rgba(16,185,129,.2);color:#6ee7b7}
.ex-agent-price-change.is-down{background:rgba(244,63,94,.2);color:#fda4af}
.ex-agent-price-cta{
  display:block;text-align:center;text-decoration:none;font-size:.72rem;font-weight:900;
  color:#0f172a;background:linear-gradient(90deg,#fbbf24,#f59e0b);
  padding:.75rem .9rem;border-top:1px solid rgba(255,255,255,.08);
}

@media (max-width: 640px) {
  .ex-agent-fab { bottom: 78px; }
  .ex-agent-panel { bottom: 160px; height: min(68vh, 520px); }
}

@media (prefers-reduced-motion: reduce) {
  .ex-agent-fab-scene,
  .ex-agent-fab-orb,
  .ex-agent-fab-ring,
  .ex-agent-fab-glow,
  .ex-agent-fab-orb-shine { animation: none !important; }
}
