/* ===================== ویجت قیمت‌های زنده ===================== */
.tm-prices{
	--pr-card:#fff;--pr-fg:var(--color-text,#191b1f);--pr-mut:var(--color-text-light,#6b7280);
	--pr-line:var(--color-border,#e6e8ec);--pr-soft:#f3f5f9;
	--pr-up:#16a34a;--pr-down:#e11d48;--pr-flat:#94a3b8;
	--pr-g1:var(--color-primary,#0f62fe);--pr-g2:#7c3aed;
	container-type:inline-size;
	background:var(--pr-card);border:1px solid var(--pr-line);border-radius:16px;
	overflow:hidden;margin-bottom:20px;color:var(--pr-fg);
	box-shadow:0 8px 24px -14px rgba(15,23,42,.25);
	animation:tm-pr-in .6s cubic-bezier(.2,.8,.2,1) both;
}
:root[data-theme="dark"] .tm-prices{--pr-card:var(--color-surface,#14171c);--pr-soft:rgba(255,255,255,.06);--pr-flat:#64748b}

/* ---- هدر ---- */
.tm-pr-head{
	position:relative;display:flex;align-items:center;justify-content:space-between;gap:10px;
	padding:14px 16px;color:#fff;overflow:hidden;
	background:linear-gradient(120deg,var(--pr-g1),var(--pr-g2),var(--pr-g1));background-size:220% 100%;
	animation:tm-pr-shift 9s ease-in-out infinite alternate;
}
.tm-pr-head::before,.tm-pr-head::after{
	content:"";position:absolute;border-radius:50%;background:rgba(255,255,255,.16);filter:blur(2px);pointer-events:none;
}
.tm-pr-head::before{width:90px;height:90px;left:-20px;top:-40px;animation:tm-pr-float 6s ease-in-out infinite}
.tm-pr-head::after{width:60px;height:60px;left:70px;bottom:-34px;animation:tm-pr-float 7.5s ease-in-out -2s infinite}
.tm-pr-title{display:flex;align-items:center;gap:9px;position:relative;z-index:1}
.tm-pr-title h3{margin:0;padding:0;border:0;font-size:15px;font-weight:800;color:#fff}
.tm-pr-live{position:relative;width:9px;height:9px;border-radius:50%;background:#4ade80;flex:0 0 9px}
.tm-pr-live::after{content:"";position:absolute;inset:-5px;border-radius:50%;border:2px solid #4ade80;opacity:0;animation:tm-pr-pulse 1.8s ease-out infinite}
.tm-prices.is-stale .tm-pr-live,.tm-prices.is-offline .tm-pr-live{background:#fbbf24}
.tm-prices.is-stale .tm-pr-live::after,.tm-prices.is-offline .tm-pr-live::after{border-color:#fbbf24}

.tm-pr-timer{position:relative;z-index:1;width:26px;height:26px}
.tm-pr-timer svg{width:100%;height:100%;transform:rotate(-90deg)}
.tm-pr-timer circle{fill:none;stroke-width:3.5}
.tm-pr-timer .bg{stroke:rgba(255,255,255,.28)}
.tm-pr-timer .fg{stroke:#fff;stroke-linecap:round;stroke-dasharray:100;stroke-dashoffset:100}
.tm-pr-timer.run .fg{animation:tm-pr-ring var(--pr-poll,60s) linear forwards}

/* ---- تب‌ها ---- */
.tm-pr-tabs{position:relative;display:flex;gap:2px;margin:12px 12px 4px;padding:4px;background:var(--pr-soft);border-radius:12px}
.tm-pr-tabs[hidden]{display:none}
.tm-pr-tabs button{
	position:relative;z-index:1;flex:1;padding:7px 4px;font-size:12.5px;font-weight:700;color:var(--pr-mut);
	border-radius:9px;transition:color .25s;white-space:nowrap;
}
.tm-pr-tabs button.on{color:var(--pr-fg)}
.tm-pr-tabs button:focus-visible{outline:2px solid var(--pr-g1);outline-offset:1px}
.tm-pr-ind{
	position:absolute;z-index:0;top:4px;bottom:4px;left:0;border-radius:9px;background:var(--pr-card);
	box-shadow:0 2px 8px -2px rgba(15,23,42,.3);transition:transform .35s cubic-bezier(.3,.9,.3,1),width .35s cubic-bezier(.3,.9,.3,1);
}

/* ---- ردیف‌ها ---- */
.tm-pr-list{display:flex;flex-direction:column;padding:6px 8px 4px;margin:0;max-height:min(440px,62vh);overflow-y:auto;overscroll-behavior:contain;scrollbar-width:thin;scrollbar-color:rgba(148,163,184,.5) transparent}
.tm-pr-list::-webkit-scrollbar{width:5px}
.tm-pr-list::-webkit-scrollbar-thumb{background:rgba(148,163,184,.45);border-radius:9px}
.tm-pr-list.has-more{-webkit-mask-image:linear-gradient(#000 calc(100% - 30px),transparent);mask-image:linear-gradient(#000 calc(100% - 30px),transparent)}
.tm-pr-row{
	display:grid;grid-template-columns:38px minmax(0,1fr) auto auto;align-items:center;gap:10px;
	padding:9px 8px;border-radius:12px;list-style:none;position:relative;
	transition:background .2s,transform .2s;
	animation:tm-pr-row .5s cubic-bezier(.2,.8,.2,1) both;animation-delay:calc(var(--n,0) * 60ms);
}
.tm-pr-row:hover{background:var(--pr-soft);transform:translateX(-2px)}
.tm-pr-row + .tm-pr-row::before{content:"";position:absolute;top:0;right:54px;left:8px;height:1px;background:var(--pr-line);opacity:.6}
.tm-pr-row.flash-up{animation:tm-pr-flash-up 1.3s ease-out}
.tm-pr-row.flash-down{animation:tm-pr-flash-down 1.3s ease-out}

.tm-pr-ico{
	width:38px;height:38px;border-radius:12px;display:grid;place-items:center;color:#fff;
	box-shadow:0 6px 14px -6px rgba(0,0,0,.45);transition:transform .3s;
}
.tm-pr-row:hover .tm-pr-ico{transform:rotate(-8deg) scale(1.06)}
.tm-pr-ico svg{width:20px;height:20px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
.tm-pr-ico.g-crypto{background:linear-gradient(135deg,#f59e0b,#f97316)}
.tm-pr-ico.g-currency{background:linear-gradient(135deg,#10b981,#0d9488)}
.tm-pr-ico.g-gold{background:linear-gradient(135deg,#eab308,#d97706)}

.tm-pr-name{display:flex;flex-direction:column;min-width:0;line-height:1.5}
.tm-pr-name b{font-size:13.5px;font-weight:700;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.tm-pr-name small{font-size:11px;color:var(--pr-mut);direction:ltr;text-align:right;min-height:1em}

.tm-pr-spark{width:58px;height:26px;color:var(--pr-flat)}
.tm-pr-spark.up{color:var(--pr-up)}
.tm-pr-spark.down{color:var(--pr-down)}
.tm-pr-spark svg{width:100%;height:100%;overflow:visible;display:block}
.tm-pr-spark .l{fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round;stroke-dasharray:1;stroke-dashoffset:1;animation:tm-pr-draw 1.1s .15s ease-out forwards}
.tm-pr-spark .a{fill:currentColor;opacity:0;animation:tm-pr-fade .8s .7s ease-out forwards}
.tm-pr-spark.none{visibility:hidden}

.tm-pr-val{display:flex;flex-direction:column;align-items:flex-end;gap:2px;min-width:78px}
.tm-pr-price{display:flex;align-items:baseline;gap:4px;white-space:nowrap}
.tm-pr-price i{font-style:normal;font-size:14px;font-weight:800;font-variant-numeric:tabular-nums}
.tm-pr-price em{font-style:normal;font-size:10.5px;color:var(--pr-mut)}
.tm-pr-chg{
	display:inline-flex;align-items:center;gap:3px;padding:1px 7px;border-radius:99px;
	font-size:11px;font-weight:700;font-variant-numeric:tabular-nums;color:var(--pr-flat);background:rgba(148,163,184,.16);
}
.tm-pr-chg svg{width:11px;height:11px;fill:none;stroke:currentColor;stroke-width:2.6;stroke-linecap:round;stroke-linejoin:round}
.tm-pr-chg.up{color:var(--pr-up);background:rgba(22,163,74,.13)}
.tm-pr-chg.down{color:var(--pr-down);background:rgba(225,29,72,.13)}
.tm-pr-chg.up svg{animation:tm-pr-bob-up 1.6s ease-in-out infinite}
.tm-pr-chg.down svg{animation:tm-pr-bob-down 1.6s ease-in-out infinite}
.tm-pr-chg:empty{display:none}

.tm-pr-msg{padding:22px 14px;text-align:center;font-size:13px;color:var(--pr-mut);list-style:none}

/* ---- اسکلت بارگذاری ---- */
.tm-pr-row.is-skel{animation:none}
.tm-pr-row.is-skel:hover{background:none;transform:none}
.tm-pr-row.is-skel .tm-pr-ico,.tm-pr-row.is-skel b,.tm-pr-row.is-skel small{
	background:linear-gradient(90deg,var(--pr-soft) 25%,rgba(148,163,184,.28) 50%,var(--pr-soft) 75%);
	background-size:200% 100%;animation:tm-pr-shimmer 1.4s linear infinite;border-radius:8px;box-shadow:none;
}
.tm-pr-row.is-skel b{display:block;height:12px;width:80px}
.tm-pr-row.is-skel small{display:block;height:9px;width:44px;margin-top:5px}
.tm-pr-row.is-skel .tm-pr-val{grid-column:3 / 5}
.tm-pr-row.is-skel .tm-pr-val b{width:70px}

/* ---- فوتر ---- */
.tm-pr-foot{display:flex;align-items:center;justify-content:center;gap:8px;padding:8px 16px 12px;font-size:11px;color:var(--pr-mut)}
.tm-prices.is-stale .tm-pr-upd,.tm-prices.is-offline .tm-pr-upd{color:#d97706;font-weight:700}
.tm-pr-note{padding:0 16px 12px;margin:-4px 0 0;font-size:10.5px;line-height:1.7;color:var(--pr-mut)}

@container (max-width:290px){
	.tm-pr-spark{display:none}
	.tm-pr-row{grid-template-columns:38px minmax(0,1fr) auto}
}

/* ---- انیمیشن‌ها ---- */
@keyframes tm-pr-in{from{opacity:0;transform:translateY(14px)}to{opacity:1;transform:none}}
@keyframes tm-pr-row{from{opacity:0;transform:translateX(16px)}to{opacity:1;transform:none}}
@keyframes tm-pr-shift{from{background-position:0 0}to{background-position:100% 0}}
@keyframes tm-pr-float{0%,100%{transform:translate(0,0)}50%{transform:translate(14px,10px)}}
@keyframes tm-pr-pulse{0%{transform:scale(.6);opacity:.9}100%{transform:scale(1.6);opacity:0}}
@keyframes tm-pr-ring{from{stroke-dashoffset:100}to{stroke-dashoffset:0}}
@keyframes tm-pr-draw{to{stroke-dashoffset:0}}
@keyframes tm-pr-fade{to{opacity:.14}}
@keyframes tm-pr-shimmer{from{background-position:200% 0}to{background-position:-200% 0}}
@keyframes tm-pr-flash-up{0%{background:rgba(22,163,74,.28)}100%{background:transparent}}
@keyframes tm-pr-flash-down{0%{background:rgba(225,29,72,.26)}100%{background:transparent}}
@keyframes tm-pr-bob-up{0%,100%{transform:translateY(1px)}50%{transform:translateY(-2px)}}
@keyframes tm-pr-bob-down{0%,100%{transform:translateY(-1px)}50%{transform:translateY(2px)}}

@media (prefers-reduced-motion:reduce){
	.tm-prices,.tm-prices *,.tm-prices *::before,.tm-prices *::after{animation:none!important;transition:none!important}
	.tm-pr-spark .l{stroke-dashoffset:0}
	.tm-pr-spark .a{opacity:.14}
}
