/* ==========================================================================
   theme-fintech.css — the purple "fintech" redesign (Claude Design canvas
   «الان چند — طرح فین‌تک», RefDesktop / RefHome / PricePage).
   Loaded after ui.css on ui2 pages. It only re-skins: tokens, the header band,
   the rate board, cards and the phone bar. No layout or data changes.
   ========================================================================== */

/* ---------- tokens (light) ---------- */
body.ui2 {
  --c-ink: #5b5ce6;
  --c-brand: #5b5ce6;
  --c-ink-2: #4546c9;
  --c-ink-soft: #ececfd;
  --c-ink-deep: #23247a;
  --c-board: #5b5ce6;
  --c-board-line: rgba(255,255,255,.16);
  --c-board-muted: #e2e2ff;
  --c-text: #17182b;
  --c-muted: #6b6e85;
  --c-bg: #f3f4fa;
  --c-surface: #fff;
  --c-surface-2: #f7f8fc;
  --c-line: #eceef6;
  --c-line-2: #e0e2ee;
  --c-up: #127a43;
  --c-down: #b42335;
  --c-up-bg: #e5f6ec;
  --c-down-bg: #fdebed;
  --c-up-on-board: #c8f5d9;
  --c-down-on-board: #ffd2d8;
  --c-focus: #5b5ce6;
  --c-glow: rgba(40,40,90,.08);
  --r-1: 10px;
  --r-2: 16px;
  --r-3: 24px;
  --sh-card: 0 8px 24px rgba(40,40,90,.06);
  --sh-lift: 0 12px 32px rgba(40,40,90,.10);
  --ac-primary-text: #5b5ce6;
  background: var(--c-bg);
}
/* dark mode keeps ui.css's palette, with the purple accent */
html[data-theme="dark"] body.ui2 {
  --c-ink: #a5a6ff; --c-ink-2: #c3c4ff; --c-ink-soft: #24264d; --c-ink-deep: #e2e2ff;
  --c-board: #2b2c7a; --c-brand: #4546c9; --sh-card: none; --sh-lift: none;
}
@media (prefers-color-scheme: dark) {
  html:not([data-theme="light"]) body.ui2 {
    --c-ink: #a5a6ff; --c-ink-2: #c3c4ff; --c-ink-soft: #24264d; --c-ink-deep: #e2e2ff;
    --c-board: #2b2c7a; --c-brand: #4546c9; --sh-card: none; --sh-lift: none;
  }
}

/* ---------- header: a purple band that carries on into the rate board ---------- */
body.ui2 .alanHeader { background: var(--c-board); }
body.ui2 .alanHeader + .l-wrap:has(.c-ticker),
body.ui2 .alanHeader + .l-wrap:has(.c-ticker) ~ .l-wrap:first-of-type { position: relative; }
body.ui2 .alanHeader + .l-wrap:has(.c-ticker)::before {
  content: ""; position: absolute; inset-block: 0 0; inset-inline: calc(50% - 50vw);
  background: var(--c-board); border-end-start-radius: 40px; border-end-end-radius: 40px; z-index: -1;
}
body.ui2 .alanHeader + .l-wrap:has(.c-ticker) { padding-block-end: var(--s-5); isolation: isolate; }

@media screen and (min-width: 780px) {
  body.ui2 .deskMenuTop {
    background: transparent; box-shadow: none; margin-top: 0; border-radius: 0;
    padding-block: 14px; padding-inline: var(--s-4);
  }
  body.ui2 .navMenu {
    background: rgba(255,255,255,.14); border-radius: 16px; padding: 5px; gap: 2px; align-items: center;
  }
  body.ui2 .navMenu a, body.ui2 .navMenu .c-mega > summary {
    color: #fff; margin: 0; padding: 9px 14px; border-radius: 12px; font-size: .9375rem;
  }
  body.ui2 .navMenu a:before { display: none; }
  body.ui2 .navMenu a:hover, body.ui2 .navMenu .c-mega > summary:hover { color: #fff; background: rgba(255,255,255,.14); }
  body.ui2 .navMenu a:is([aria-current="page"],[aria-current="true"]),
  body.ui2 .navMenu .c-mega > summary[aria-current="true"] {
    background: #fff; color: var(--c-brand); font-weight: 700;
  }
  body.ui2 .navMenu .dot { display: none; }
  body.ui2 .acNavLogo img { background: #fff; border-radius: 50%; padding: 4px; inline-size: 48px; block-size: 48px; }
  body.ui2 .alanHeader .c-theme { background: rgba(255,255,255,.18); color: #fff; border: 0; border-radius: 12px; }
}

/* ---------- rate board: translucent tiles on the purple band ---------- */
body.ui2 .c-ticker {
  background: transparent; box-shadow: none; gap: 10px; overflow: visible; margin-block-start: var(--s-2);
}
body.ui2 .c-ticker li { border: 0 !important; }
body.ui2 .c-ticker a {
  background: rgba(255,255,255,.14); border-radius: 18px; padding: 12px 14px; color: #fff;
}
body.ui2 .c-ticker a:hover { background: rgba(255,255,255,.22); }
body.ui2 .c-ticker__name { color: var(--c-board-muted); }
body.ui2 .c-ticker__val { font-weight: 800; }
@media (max-width: 767px) {
  body.ui2 .c-ticker { margin-inline: 0; padding-block-end: 2px; overflow-x: auto; }
  body.ui2 .c-ticker li { min-inline-size: 42%; }
}

/* ---------- page head ---------- */
body.ui2 .c-pagehead h1 { font-weight: 800; }
body.ui2 .c-stale { border-radius: var(--r-pill); }

/* ---------- cards ---------- */
body.ui2 :is(.c-ptable, .c-board, .c-conv--bar .c-conv__bar, .c-goldcalc, .c-chart, .c-perf, .c-history,
             .c-panel, .c-facts, .c-related, .c-prose, .c-tv, .c-fng, .c-stock, .c-xlist, .c-kv) {
  border: 0; border-radius: var(--r-3); box-shadow: var(--sh-card); background: var(--c-surface);
}
body.ui2 .c-ptable-wrap { border-radius: var(--r-3); box-shadow: var(--sh-card); }
body.ui2 .c-ptable-wrap .c-ptable { box-shadow: none; }
body.ui2 .c-ptable thead th { background: var(--c-surface-2); color: var(--c-muted); font-weight: 600; }
body.ui2 .c-ptable tbody tr:hover td { background: var(--c-surface-2); }
body.ui2 .c-tile {
  border: 0; border-radius: 20px; box-shadow: var(--sh-card); transition: transform var(--m-fast) var(--m-ease), box-shadow var(--m-fast);
}
body.ui2 .c-tile:hover { transform: translateY(-2px); box-shadow: var(--sh-lift); }
body.ui2 .c-sec h2 { font-weight: 800; }
body.ui2 .c-sec__more { color: var(--c-ink); font-weight: 700; }

/* change as a soft pill wherever it stands alone */
body.ui2 :is(.c-tile__chg, .c-hero__chg > span, .c-brow__chg).c-up,
body.ui2 :is(.c-tile__chg, .c-hero__chg > span, .c-brow__chg).c-down {
  display: inline-flex; align-items: center; gap: 2px; border-radius: var(--r-pill); padding: 1px 9px; font-weight: 700;
}
body.ui2 :is(.c-tile__chg, .c-brow__chg).c-up { background: var(--c-up-bg); }
body.ui2 :is(.c-tile__chg, .c-brow__chg).c-down { background: var(--c-down-bg); }

/* buttons and chips */
body.ui2 .c-btn { border-radius: 12px; }
body.ui2 .c-chip, body.ui2 .c-mchips a { border-radius: var(--r-pill); }

/* converter bar: white card, purple result */
body.ui2 .c-conv--bar .c-conv__res { background: var(--c-ink-soft); color: var(--c-ink-deep); border-radius: 18px; }
body.ui2 .c-conv--bar .c-conv__res * { color: inherit; }

/* ---------- price hero (single pages): the purple price card ---------- */
body.ui2 .c-hero {
  background: var(--c-brand); color: #fff; border: 0; border-radius: 28px; box-shadow: var(--sh-lift);
}
body.ui2 .c-hero :is(.c-hero__label, .c-hero__note, .c-hero__unit, dt) { color: #e2e2ff; }
body.ui2 .c-hero__value { font-weight: 900; }
body.ui2 .c-hero__chg > span.c-up { background: #e5f6ec; color: #0b5a30; }
body.ui2 .c-hero__chg > span.c-down { background: #fdebed; color: #9a1c2b; }
body.ui2 .c-hero__sub { border-block-start: 0; padding-block-start: 0; }
body.ui2 .c-hero__sub > div { background: rgba(255,255,255,.14); border-radius: 16px; padding: 12px 14px; }
body.ui2 .c-hero__sub dd { color: #fff; font-weight: 800; }
body.ui2 .c-hero__sub dd.c-up { color: #c8f5d9; }
body.ui2 .c-hero__sub dd.c-down { color: #ffd2d8; }
body.ui2 .c-hero .c-btn--ghost { color: #fff; border-color: rgba(255,255,255,.35); }
body.ui2 .c-hero__spark :is(path, polyline) { stroke: #fff; }

/* ---------- phone bar: white, purple active item, raised converter button ---------- */
@media screen and (max-width: 779px) {
  body.ui2 .navMenu {
    background: var(--c-surface); box-shadow: 0 -6px 20px rgba(40,40,90,.08); border-radius: 22px 22px 0 0;
  }
  body.ui2 .navMenu a { color: var(--c-muted); }
  body.ui2 .navMenu a:is([aria-current="page"],[aria-current="true"]) { color: var(--c-ink); }
  body.ui2 .navMenu a:is([aria-current="page"],[aria-current="true"]) .navShort { border-block-end-color: var(--c-ink); }
  body.ui2 .navMenu .c-ic { --ic-knock: var(--c-surface); }
  body.ui2 .navMenu a.ConvertMenu .c-ic {
    inline-size: 52px; block-size: 52px; inset-block-start: -26px; inset-inline-start: calc(50% - 26px);
    padding: 13px; box-sizing: border-box; border-radius: 50%; background: var(--c-brand); color: #fff;
    box-shadow: 0 8px 20px rgba(91,92,230,.35); --ic-knock: var(--c-brand);
  }
}

/* ---------- footer ---------- */
body.ui2 .footerDarkBox { background: #17182b; border-radius: 28px 28px 0 0; }

/* ---------- fixes found in testing ---------- */
body.ui2 .c-hero .c-star { color: #fff; }
body.ui2 .c-hero .c-star .c-ic { --ic-knock: var(--c-brand); }
body.ui2 .c-hero__spark:has(svg:empty) { display: none; }
@media screen and (max-width: 779px) {
  /* the phone header row is part of the purple band too */
  body.ui2 :is(.alanHeader, .HeaderInner, .deskMenuTop) { background: var(--c-board); box-shadow: none; }
  body.ui2 .acNavLogo img { background: #fff; border-radius: 50%; padding: 3px; }
  body.ui2 .alanHeader .c-theme { background: rgba(255,255,255,.18); color: #fff; border: 0; border-radius: 12px; }
}
body.ui2 .c-hero .c-hero__acts .c-btn.c-btn--ghost { color: #fff; background: rgba(255,255,255,.14); border-color: transparent; }
body.ui2 .c-hero .c-hero__acts .c-btn.c-btn--ghost:hover { background: rgba(255,255,255,.24); }
body.ui2 .c-hero .c-hero__acts .c-star[aria-pressed="true"] { color: #ffd166; }

/* ---------- brief sections (partials/ui/doc-sections.php, jump-nav.php) ---------- */
body.ui2 .c-sample {
  display: inline-flex; align-items: center; vertical-align: middle; margin-inline-start: 8px;
  padding: 2px 10px; border-radius: var(--r-pill); background: #fff4d6; color: #8a5a00;
  border: 1px dashed #e0b44c; font-size: .75rem; font-weight: 700; line-height: 1.6;
}
html[data-theme="dark"] body.ui2 .c-sample { background: #3a2f12; color: #ffd98a; border-color: #8a6a20; }
@media (prefers-color-scheme: dark) { html:not([data-theme="light"]) body.ui2 .c-sample { background: #3a2f12; color: #ffd98a; border-color: #8a6a20; } }
body.ui2 .c-docsec.is-sample .c-panel { outline: 1px dashed var(--c-line-2); outline-offset: -1px; }
body.ui2 .c-docsec .c-panel { padding: var(--s-4); }
body.ui2 .c-docsec__note { margin: var(--s-3) 0 0; color: var(--c-muted); font-size: .8125rem; }
body.ui2 .c-xstats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin: 0; }
body.ui2 .c-xstats > div { background: var(--c-surface-2); border-radius: 16px; padding: 12px 14px; }
body.ui2 .c-xstats dt { color: var(--c-muted); font-size: .8125rem; font-weight: 500; margin-bottom: 4px; }
body.ui2 .c-xstats dd { margin: 0; font-weight: 800; font-size: 1.05rem; color: var(--c-text); }
body.ui2 .c-xunit { color: var(--c-muted); font-weight: 500; font-size: .75rem; }
body.ui2 .c-docsec .c-ptable-wrap { box-shadow: none; }
body.ui2 .c-xtable th[scope="row"] { font-weight: 600; text-align: start; }
body.ui2 .c-xform { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
body.ui2 .c-xform :is(input, select) {
  min-height: 44px; border: 1px solid var(--c-line-2); border-radius: 12px; padding: 0 12px;
  background: var(--c-surface); color: var(--c-text); font: inherit;
}
body.ui2 .c-xform input { flex: 1 1 200px; }
body.ui2 .c-btn[disabled] { opacity: .55; cursor: not-allowed; }
body.ui2 .c-xtext { margin: 0 0 var(--s-3); }
body.ui2 .c-xlist { margin: 0; padding-inline-start: 1.2em; line-height: 2; }
body.ui2 .c-xcomments { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
body.ui2 .c-xcomments li { background: var(--c-surface-2); border-radius: 16px; padding: 12px 14px; }
body.ui2 .c-xcomments b { margin-inline-end: 8px; }
body.ui2 .c-xcomments p { margin: 6px 0 0; }
body.ui2 .c-jump { display: flex; gap: 8px; overflow-x: auto; padding-block: var(--s-2); scrollbar-width: none; }
body.ui2 .c-jump[hidden] { display: none; }
body.ui2 .c-jump .c-chip { white-space: nowrap; background: var(--c-surface); box-shadow: var(--sh-card); color: var(--c-ink); font-weight: 600; }
body.ui2 .c-muted { color: var(--c-muted); }
body.ui2 .c-samplebar {
  margin: var(--s-2) 0; padding: 10px 14px; border-radius: 16px; background: #fff4d6; color: #6b4600;
  border: 1px dashed #e0b44c; font-size: .875rem;
}
html[data-theme="dark"] body.ui2 .c-samplebar { background: #3a2f12; color: #ffd98a; border-color: #8a6a20; }
@media (prefers-color-scheme: dark) { html:not([data-theme="light"]) body.ui2 .c-samplebar { background: #3a2f12; color: #ffd98a; border-color: #8a6a20; } }
body.ui2 .c-xchart { display: block; inline-size: 100%; block-size: 180px; }
body.ui2 .c-xout { font-weight: 800; font-size: 1.1rem; color: var(--c-ink); }
body.ui2 .c-xdefs { margin: 0; display: grid; gap: 4px 16px; }
body.ui2 .c-xdefs dt { font-weight: 700; margin-top: 8px; }
body.ui2 .c-xdefs dd { margin: 0; color: var(--c-muted); }

/* ---------- home: header and rate board are one purple block ---------- */
body.ui2 .alanHeader + .l-wrap:has(.c-ticker) { padding-block-start: 1px; margin-block-start: -1px; }
body.ui2 .alanHeader + .l-wrap:has(.c-ticker) > .c-ticker:first-child { margin-block-start: 0; }
/* the dollar in large figures above the cards (partials/ui/ticker.php, home only) */
body.ui2 .c-lead-price {
  display: flex; flex-direction: column; align-items: flex-start; gap: 6px; text-align: start;
  padding-block: var(--s-3) var(--s-4); color: #fff;
}
body.ui2 .c-lead-price:hover { color: #fff; }
body.ui2 .c-lead-price__name { font-size: .9375rem; color: var(--c-board-muted); }
body.ui2 .c-lead-price__val { font-size: clamp(2.5rem, 6vw, 4rem); font-weight: 900; line-height: 1.1; font-variant-numeric: tabular-nums; }
body.ui2 .c-lead-price__unit { font-size: clamp(1rem, 2vw, 1.375rem); font-weight: 500; }
body.ui2 .c-lead-price__chg {
  display: inline-flex; align-items: center; gap: 4px; padding: 4px 14px; border-radius: var(--r-pill);
  background: rgba(255,255,255,.18); font-size: .875rem; color: #fff;
}
body.ui2 .c-lead-price + .c-ticker { margin-block-start: 0; }
@media (min-width: 1100px) {
  body.ui2 .c-ticker--row { grid-template-columns: repeat(7, minmax(0, 1fr)); }
}
body.ui2 .c-lead-price__chg.c-up bdi { color: var(--c-up-on-board); }
body.ui2 .c-lead-price__chg.c-down bdi { color: var(--c-down-on-board); }
/* no change against yesterday: no pill (ui.js swaps the class when the rate moves) */
body.ui2 .c-lead-price__chg:is(.c-flat, .c-no_change), body.ui2 .c-lead-price__chg:has(bdi:empty) { display: none; }
/* stale prices: an amber alarm under the caption */
body.ui2 .c-lead-price__alarm {
  display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border-radius: var(--r-pill);
  background: #ffe7a3; color: #5c3b00; font-size: .8125rem; font-weight: 700;
}
body.ui2 .c-lead-price__alarm[hidden] { display: none; }
body.ui2 .c-lead-price__name [hidden] { display: none; }

/* ---------- language picker: one translucent pill like the theme button, white menu ---------- */
/* the header's menus (language, markets) must open above the rate board, whose wrapper is its own layer */
body.ui2 .alanHeader { position: relative; z-index: 30; }
body.ui2 .alanHeader .acDropList { background: none; border: 0; padding: 0; box-shadow: none; }
body.ui2 .alanHeader .acDropList > summary {
  display: inline-flex; align-items: center; gap: 8px; block-size: 44px; padding: 0 14px; box-sizing: border-box;
  border-radius: 12px; background: rgba(255,255,255,.18); color: #fff; font-size: .9375rem; font-weight: 600;
  cursor: pointer; transition: background-color var(--m-fast, .15s);
}
body.ui2 .alanHeader .acDropList > summary::-webkit-details-marker { display: none; }
body.ui2 .alanHeader .acDropList > summary:hover,
body.ui2 .alanHeader .acDropList[open] > summary { background: rgba(255,255,255,.28); }
body.ui2 .alanHeader .acDropList > summary::after {
  content: ""; inline-size: 7px; block-size: 7px; border: solid currentColor; border-width: 0 2px 2px 0;
  transform: translateY(-2px) rotate(45deg); opacity: .8; transition: transform .15s;
}
body.ui2 .alanHeader .acDropList[open] > summary::after { transform: translateY(2px) rotate(-135deg); }
body.ui2 .alanHeader .acDropList .flag { border-radius: 4px; overflow: hidden; }
body.ui2 .alanHeader .acDropList .selectLang {
  inset-block-start: calc(100% + 8px); inset-inline-end: 0; inset-inline-start: auto; min-inline-size: 150px;
  padding: 6px !important; background: var(--c-surface); border-radius: 16px; box-shadow: 0 12px 32px rgba(40,40,90,.18);
}
body.ui2 .alanHeader .acDropList:not([open]) .selectLang { display: none !important; }
body.ui2 .alanHeader .acDropList .selectLang > span {
  display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 0; margin: 0; border-radius: 10px;
}
body.ui2 .alanHeader .acDropList .selectLang a {
  flex: 1; padding: 10px 12px; color: var(--c-text); font-weight: 600; font-size: .9375rem;
}
body.ui2 .alanHeader .acDropList .selectLang > span:has(a:hover) { background: var(--c-ink-soft); }
body.ui2 .alanHeader .acDropList .selectLang > span .flag { margin-inline-end: 12px; }

/* ---------- markets mega menu: the header-link pill rules stop at the panel ---------- */
@media screen and (min-width: 780px) {
  body.ui2 .navMenu .c-mega__panel {
    border: 0; border-radius: 24px; box-shadow: 0 16px 40px rgba(40,40,90,.18); inset-block-start: calc(100% + 10px);
  }
  body.ui2 .navMenu .c-mega__panel a {
    color: var(--c-text); background: none; padding: 0 8px; margin-inline: -8px; border-radius: 10px;
    font-size: .875rem; font-weight: 500;
  }
  body.ui2 .navMenu .c-mega__panel a:hover { color: var(--c-ink); background: var(--c-ink-soft); text-decoration: none; }
  body.ui2 .navMenu .c-mega__panel :is(a.c-mega__head, span.c-mega__head) {
    color: var(--c-ink); font-weight: 800; font-size: .9375rem; display: flex; align-items: center; min-block-size: 36px;
  }
  body.ui2 .navMenu .c-mega__panel .c-mega__sub a { color: var(--c-ink); font-weight: 700; }
}
/* the headline caption and alarm wrap on phones instead of running off the edge */
body.ui2 .c-lead-price { max-inline-size: 100%; min-inline-size: 0; }
body.ui2 .c-lead-price__name, body.ui2 .c-lead-price__alarm { max-inline-size: 100%; white-space: normal; overflow-wrap: anywhere; }

/* home hero: H1, then the dollar caption on a single line */
body.ui2 .c-lead-price-wrap { padding-block-start: var(--s-3); }
body.ui2 .c-lead-price__h1 { margin: 0; color: #fff; font-size: clamp(1.125rem, 2.6vw, 1.5rem); font-weight: 800; line-height: 1.4; }
body.ui2 .c-lead-price-wrap .c-lead-price { padding-block-start: var(--s-2); }
body.ui2 .c-lead-price__name {
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; overflow-wrap: normal;
  font-size: clamp(.6875rem, 3.1vw, .9375rem);
}

/* ---------- home: «روند دلار» + «تبدیل سریع», pulled up over the purple hero ---------- */
body.ui2 .alanHeader + .l-wrap:has(.c-lead-price) { padding-block-end: 88px; }
body.ui2 .c-hometop {
  position: relative; z-index: 1; margin-block-start: -64px;
  display: flex; flex-wrap: wrap; gap: 24px; align-items: stretch;
}
body.ui2 .c-trend, body.ui2 .c-qconv {
  min-inline-size: 0; background: var(--c-surface); border-radius: 28px; padding: 24px; box-shadow: var(--sh-lift);
}
body.ui2 .c-trend { flex: 999 1 600px; display: flex; flex-direction: column; gap: 12px; }
body.ui2 .c-qconv { flex: 1 1 320px; display: flex; flex-direction: column; gap: 14px; }
body.ui2 .c-trend__head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; }
body.ui2 .c-trend__title { display: flex; align-items: center; gap: 10px; }
body.ui2 .c-trend__title h2, body.ui2 .c-conv__title { margin: 0; font-size: 1.1875rem; font-weight: 800; color: var(--c-text); }
body.ui2 .c-trend__chg { display: inline-flex; font-size: .75rem; font-weight: 700; padding: 3px 10px; border-radius: var(--r-pill); }
body.ui2 .c-trend__chg.c-up { background: var(--c-up-bg); color: var(--c-up); }
body.ui2 .c-trend__chg.c-down { background: var(--c-down-bg); color: var(--c-down); }
body.ui2 .c-trend__chg.c-flat { background: var(--c-surface-2); color: var(--c-muted); }
body.ui2 .c-trend__tabs { display: flex; gap: 4px; padding: 4px; border-radius: 14px; background: var(--c-surface-2); font-size: .8125rem; }
body.ui2 .c-trend__tabs label {
  display: grid; place-items: center; block-size: 36px; padding: 0 14px; border-radius: 10px; color: var(--c-muted); cursor: pointer;
}
body.ui2 .c-trend__tabs input:checked + label { background: var(--c-brand); color: #fff; font-weight: 700; }
body.ui2 .c-trend__tabs input:focus-visible + label { outline: 2px solid var(--c-focus); outline-offset: 2px; }
body.ui2 .c-trend__axis { direction: ltr; display: flex; justify-content: space-between; margin-block-start: 6px; font-size: .75rem; color: var(--c-muted); }

/* the converter bar, stacked inside the card at every width */
body.ui2 .c-qconv .c-conv--bar { margin: 0; padding: 0; border: 0; border-radius: 0; background: none; box-shadow: none; display: flex; flex-direction: column; gap: 14px; }
body.ui2 .c-qconv .c-conv--bar .c-conv__bar {
  grid-template-columns: minmax(0, 1fr) 44px minmax(0, 1fr);
  grid-template-areas: "amt amt amt" "from swap to" "res res res" "go go go"; gap: 10px;
}
body.ui2 .c-qconv .c-conv__seg { min-block-size: 58px; padding: 6px 12px; border: 1px solid var(--c-line-2); border-radius: 14px; background: var(--c-surface-2); }
body.ui2 .c-qconv .c-conv__amt::after { content: none; }
body.ui2 .c-qconv .c-conv--bar .c-conv__amt input { font-size: 1.125rem; font-weight: 700; color: var(--c-text); }
body.ui2 .c-qconv .c-conv--bar .c-conv__sel select { font-size: .875rem; padding-inline: 30px 12px; }
body.ui2 .c-qconv .c-conv__res { margin: 0; padding: 14px 16px; border-radius: 16px; background: var(--c-ink-soft); color: var(--c-ink-deep); }
body.ui2 .c-qconv .c-conv__res b { font-size: 1.625rem; font-weight: 900; color: var(--c-ink-deep); }
body.ui2 .c-qconv .c-conv__res output span, body.ui2 .c-qconv .c-conv__meta { color: var(--c-ink-2); }
body.ui2 .c-qconv .c-conv__link { color: var(--c-ink-2); }
body.ui2 .c-qconv__cta { display: flex; block-size: 50px; border-radius: 16px; background: var(--c-brand); font-size: .9375rem; font-weight: 800; margin-block-start: auto; }
@media (max-width: 779px) {
  body.ui2 .c-trend, body.ui2 .c-qconv { padding: 18px; border-radius: 24px; }
  body.ui2 .c-trend__plot svg { block-size: 170px; }
  body.ui2 .c-trend__tabs label { padding: 0 10px; }
}
/* the purple band's full-bleed background is 100vw, scrollbar included: clip it, no sideways scroll */
html:has(body.ui2), body.ui2 { overflow-x: clip; }

/* «روند» chart: asset menu, hover readout, draw-in (partials/ui/trend-chart.php) */
body.ui2 .c-trend__pick { position: relative; }
body.ui2 .c-trend__pick > summary { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; list-style: none; border-radius: 10px; }
body.ui2 .c-trend__pick > summary::-webkit-details-marker { display: none; }
body.ui2 .c-trend__pick > summary:focus-visible { outline: 2px solid var(--c-focus); outline-offset: 4px; }
body.ui2 .c-trend__pick h2 span { color: var(--c-ink); }
body.ui2 .c-trend__caret {
  inline-size: 8px; block-size: 8px; border: solid var(--c-ink); border-width: 0 2px 2px 0;
  transform: translateY(-3px) rotate(45deg); transition: transform .15s;
}
body.ui2 .c-trend__pick[open] .c-trend__caret { transform: translateY(1px) rotate(-135deg); }
body.ui2 .c-trend__menu {
  position: absolute; z-index: 5; inset-block-start: calc(100% + 8px); inset-inline-start: 0; min-inline-size: 210px;
  margin: 0; padding: 6px; list-style: none; background: var(--c-surface); border-radius: 16px; box-shadow: 0 12px 32px rgba(40,40,90,.18);
}
body.ui2 .c-trend__menu button {
  display: block; inline-size: 100%; padding: 10px 12px; border: 0; border-radius: 10px; background: none;
  color: var(--c-text); font: inherit; font-size: .9375rem; font-weight: 600; text-align: start; cursor: pointer;
}
body.ui2 .c-trend__menu button:hover { background: var(--c-surface-2); }
body.ui2 .c-trend__menu button[aria-pressed="true"] { background: var(--c-ink-soft); color: var(--c-ink); }
html:not(.js) body.ui2 :is(.c-trend__menu, .c-trend__caret, .c-trend__tabs) { display: none; }
html:not(.js) body.ui2 .c-trend__pick > summary { cursor: default; }

body.ui2 .c-trend__plot { position: relative; margin: 0; color: var(--c-brand); }
body.ui2 .c-trend__plot svg { display: block; inline-size: 100%; block-size: 220px; touch-action: pan-y; cursor: crosshair; }
body.ui2 .c-trend__plot svg line { stroke: var(--c-line); }
body.ui2 .c-trend__cross {
  position: absolute; inset-block: 0 28px; inline-size: 0; border-inline-start: 1px dashed var(--c-ink); opacity: .5; pointer-events: none;
}
body.ui2 .c-trend__dot {
  position: absolute; inline-size: 12px; block-size: 12px; margin: -6px 0 0 -6px; border-radius: 50%;
  background: var(--c-brand); box-shadow: 0 0 0 3px var(--c-surface), 0 2px 8px rgba(40,40,90,.3); pointer-events: none;
}
body.ui2 .c-trend__tip {
  position: absolute; display: flex; flex-direction: column; gap: 2px; padding: 8px 12px; border-radius: 12px;
  background: var(--c-text); color: var(--c-surface); font-size: .75rem; white-space: nowrap; pointer-events: none;
  box-shadow: 0 8px 20px rgba(23,24,43,.25);
}
body.ui2 .c-trend__tip b { font-size: .9375rem; font-weight: 800; }
body.ui2 .c-trend__cross, body.ui2 .c-trend__dot { left: 0; }
body.ui2 :is(.c-trend__cross, .c-trend__dot, .c-trend__tip)[hidden] { display: none; }

/* draw-in: the line is revealed from the oldest day to today, the fill fades in under it */
body.ui2 .c-trend__plot.is-waiting svg { clip-path: inset(0 100% 0 0); }
body.ui2 .c-trend__plot.is-drawing svg { animation: c-trend-reveal .9s cubic-bezier(.22, .61, .36, 1) both; }
body.ui2 .c-trend__plot.is-drawing .c-trend__area { animation: c-trend-fade 1.1s ease-out both; }
@keyframes c-trend-reveal { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0 0 0 0); } }
@keyframes c-trend-fade { from { opacity: 0; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
  body.ui2 .c-trend__plot.is-drawing svg, body.ui2 .c-trend__plot.is-drawing .c-trend__area { animation: none; }
  body.ui2 .c-trend__plot.is-waiting svg { clip-path: none; }
}
/* the axis runs oldest-left like the line, but each label keeps Persian word order */
body.ui2 .c-trend__axis span { direction: rtl; unicode-bidi: isolate; }
body.ui2 .c-trend__tip { direction: rtl; }

/* quick converter card: the rate line and the page link each get their own line, never «…» */
body.ui2 .c-qconv .c-conv__meta { flex-direction: column; align-items: flex-start; gap: 4px; white-space: normal; }
body.ui2 .c-qconv .c-conv__meta > span { overflow: visible; text-overflow: clip; }
body.ui2 .c-qconv .c-conv__res output { flex-wrap: wrap; white-space: normal; }
body.ui2 .c-qconv .c-conv__res b { overflow: visible; text-overflow: clip; }
/* room for «دلار آمریکا» in the narrow from/to boxes: slimmer box and select padding */
body.ui2 .c-qconv :is(.c-conv__from, .c-conv__to) { padding-inline: 8px; }
body.ui2 .c-qconv .c-conv--bar .c-conv__sel select { padding-inline: 28px 10px; }
/* side by side the converter card keeps at least 360px, so its from/to names fit */
body.ui2 .c-trend { flex-basis: 560px; }
body.ui2 .c-qconv { flex-basis: 360px; }
body.ui2 .c-hometop > :is(.c-trend, .c-qconv) { margin: 0; }
