/* /price/{slug} - Phase 19 rewrite. Markup + behaviour: Views/Price/PriceLanding.cshtml.
   Scoped under .pr-page; tokens from css/ds/tokens.css; shared .tf-tick-up/down for the live flash. */
.pr-page { position: relative; isolation: isolate; color: var(--ds-text); padding: clamp(1rem, 2.4vw, 1.75rem) 0 3rem; }
.pr-page::before { content: ""; position: absolute; inset: 0 0 auto; height: 420px; z-index: -1; pointer-events: none;
  background: radial-gradient(560px 240px at 88% 0%, hsl(199 89% 55% / .13), transparent 70%), radial-gradient(480px 220px at 8% 12%, hsl(45 95% 55% / .09), transparent 70%); }
.pr-page svg { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.pr-wrap { display: flex; flex-direction: column; gap: 1.1rem; }
.pr-num { font-variant-numeric: tabular-nums; }
.pr-muted { color: var(--ds-text-2); font-size: .8rem; font-weight: 600; margin: 0; }
.pr-page .is-up { color: var(--ds-up-ink); }
.pr-page .is-down { color: var(--ds-down-ink); }

/* ---------- cards / buttons ---------- */
.pr-card { background: var(--ds-surface-1); border: 1px solid var(--ds-line); border-radius: var(--ds-r-xl); padding: clamp(1rem, 2vw, 1.4rem); box-shadow: var(--ds-shadow-1); min-width: 0; }
.pr-card__head { display: flex; align-items: flex-start; justify-content: space-between; gap: .75rem; flex-wrap: wrap; margin-bottom: .9rem; }
.pr-h2 { margin: 0 0 .2rem; font-size: clamp(1.02rem, 1.6vw, 1.18rem); font-weight: 900; line-height: 1.5; }
.pr-h3 { margin: 0 0 .7rem; font-size: .95rem; font-weight: 900; }
.pr-btn { display: inline-flex; align-items: center; justify-content: center; gap: .45rem; min-height: 44px; padding: .55rem 1rem; border-radius: var(--ds-r-md); font-weight: 800; font-size: .88rem; text-decoration: none; white-space: nowrap; cursor: pointer;
  color: var(--ds-text); background: var(--ds-surface-1); border: 1px solid var(--ds-line); font-family: inherit; transition: var(--ds-t-hover); }
.pr-btn svg { width: 18px; height: 18px; flex: none; }
.pr-btn:hover { transform: translateY(var(--ds-lift-1)); border-color: hsl(199 89% 48% / .45); color: var(--ds-text); }
.pr-btn--pri { color: #fff; border-color: transparent; background: linear-gradient(135deg, hsl(199 89% 44%), hsl(217 88% 56%)); box-shadow: 0 10px 22px -10px hsl(199 89% 48% / .8); }
.pr-btn--pri:hover { color: #fff; box-shadow: 0 14px 26px -10px hsl(199 89% 48% / .95); }
.pr-btn--ghost { background: transparent; }
.pr-btn--ghost:hover { background: var(--ds-surface-2); }
.pr-btn:focus-visible, .pr-seg button:focus-visible, .pr-faq summary:focus-visible, .pr-chips a:focus-visible, .pr-links a:focus-visible { outline: 2px solid hsl(199 89% 48%); outline-offset: 2px; }

/* ---------- hero ---------- */
.pr-hero { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 1.1rem; align-items: stretch; }
.pr-quote { background: var(--ds-surface-1); border: 1px solid var(--ds-line); border-radius: var(--ds-r-xl); padding: clamp(1.1rem, 2.4vw, 1.6rem); box-shadow: var(--ds-shadow-2); display: flex; flex-direction: column; gap: .9rem; min-width: 0; position: relative; overflow: hidden; }
.pr-quote::after { content: ""; position: absolute; inset: auto -30% -60% auto; width: 60%; aspect-ratio: 1; border-radius: 50%; background: radial-gradient(closest-side, hsl(199 89% 55% / .10), transparent); pointer-events: none; }
.pr-quote__id { display: flex; align-items: center; gap: .85rem; min-width: 0; }
.pr-ic { width: 52px; height: 52px; flex: none; border-radius: var(--ds-r-lg); display: grid; place-items: center; background: var(--ds-surface-2); border: 1px solid var(--ds-line); overflow: hidden; }
.pr-ic img { width: 40px; height: 40px; object-fit: contain; }
.pr-ic__txt { font-weight: 1000; font-size: .8rem; letter-spacing: .02em; color: var(--ds-text-2); direction: ltr; }
.pr-flags { position: relative; width: 40px; height: 40px; }
.pr-flags img { position: absolute; width: 26px; height: 26px; border-radius: 50%; object-fit: cover; border: 2px solid var(--ds-surface-1); }
.pr-flags img:first-child { top: 0; inset-inline-end: 0; }
.pr-flags img:last-child { bottom: 0; inset-inline-start: 0; }
.pr-quote__names { min-width: 0; }
.pr-title { margin: 0; font-size: clamp(1.35rem, 3.2vw, 2rem); font-weight: 1000; line-height: 1.35; }
.pr-sub { margin: .15rem 0 0; color: var(--ds-text-2); font-size: .85rem; font-weight: 600; }
.pr-price { display: flex; align-items: baseline; flex-wrap: wrap; gap: .25rem .55rem; }
.pr-price__val { font-size: clamp(2rem, 6vw, 3.1rem); font-weight: 1000; line-height: 1.1; letter-spacing: -.01em; font-variant-numeric: tabular-nums; border-radius: var(--ds-r-sm); }
.pr-price__unit { font-size: .95rem; font-weight: 800; color: var(--ds-text-2); }
.pr-quote__meta { display: flex; align-items: center; flex-wrap: wrap; gap: .5rem .7rem; }
.pr-delta { display: inline-flex; align-items: center; gap: .25rem; padding: .25rem .65rem; border-radius: var(--ds-r-pill); font-weight: 900; font-size: .85rem; font-variant-numeric: tabular-nums; background: var(--ds-surface-2); color: var(--ds-text-2); }
.pr-delta.is-up { background: var(--ds-up-soft); color: var(--ds-up-ink); }
.pr-delta.is-down { background: var(--ds-down-soft); color: var(--ds-down-ink); }
.pr-delta.is-up::before { content: "▲"; font-size: .6rem; }
.pr-delta.is-down::before { content: "▼"; font-size: .6rem; }
.pr-live { display: inline-flex; align-items: center; gap: .4rem; margin-inline-start: auto; padding: .25rem .65rem; border-radius: var(--ds-r-pill); font-size: .72rem; font-weight: 700; color: var(--ds-text-2); background: var(--ds-surface-2); border: 1px solid var(--ds-line); }
.pr-live b { font-weight: 900; color: var(--ds-text); font-variant-numeric: tabular-nums; }
.pr-live i { width: 7px; height: 7px; border-radius: 50%; background: var(--ds-text-3); position: relative; }
.pr-live[data-state="on"] i { background: hsl(152 65% 42%); }
.pr-live[data-state="on"] i::after { content: ""; position: absolute; inset: -4px; border-radius: 50%; border: 2px solid hsl(152 65% 42% / .5); animation: pr-ping 1.6s ease-out infinite; }
.pr-live[data-state="stale"] { color: hsl(35 90% 40%); border-color: hsl(40 95% 55% / .35); }
.pr-live[data-state="stale"] i { background: hsl(38 92% 50%); }
@keyframes pr-ping { from { transform: scale(.6); opacity: 1; } to { transform: scale(1.6); opacity: 0; } }

.pr-range { display: flex; flex-direction: column; gap: .45rem; }
.pr-range__bar { position: relative; height: 8px; border-radius: var(--ds-r-pill); background: linear-gradient(90deg, hsl(0 72% 56% / .55), hsl(45 90% 55% / .55), hsl(152 60% 42% / .55)); }
[dir="rtl"] .pr-range__bar { background: linear-gradient(270deg, hsl(0 72% 56% / .55), hsl(45 90% 55% / .55), hsl(152 60% 42% / .55)); }
.pr-range__bar i { position: absolute; top: 50%; width: 16px; height: 16px; margin-inline-start: -8px; transform: translateY(-50%); border-radius: 50%; background: var(--ds-surface-1); border: 3px solid var(--ds-text); box-shadow: var(--ds-shadow-2); transition: inset-inline-start .6s cubic-bezier(.2,.7,.2,1); }
.pr-range__ends { display: flex; justify-content: space-between; gap: .5rem; }
.pr-range__ends span { display: flex; flex-direction: column; gap: .05rem; }
.pr-range__ends span:last-child { text-align: end; }
.pr-range__ends small { font-size: .7rem; color: var(--ds-text-2); font-weight: 700; }
.pr-range__ends b { font-size: .85rem; font-weight: 900; }
.pr-cta { display: flex; flex-wrap: wrap; gap: .55rem; margin-top: .1rem; }

.pr-stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .65rem; align-content: stretch; }
.pr-stat { background: var(--ds-surface-1); border: 1px solid var(--ds-line); border-radius: var(--ds-r-lg); padding: .85rem .95rem; display: flex; flex-direction: column; gap: .2rem; box-shadow: var(--ds-shadow-1); min-width: 0; }
.pr-stat span { font-size: .74rem; font-weight: 800; color: var(--ds-text-2); }
.pr-stat b { font-size: clamp(.98rem, 1.6vw, 1.12rem); font-weight: 1000; overflow-wrap: anywhere; }
.pr-stat b em { font-style: normal; }
.pr-stat small { font-size: .7rem; color: var(--ds-text-2); font-weight: 600; }
.pr-split { display: block; height: 6px; border-radius: var(--ds-r-pill); background: var(--ds-down-ink); opacity: .85; overflow: hidden; margin-top: .25rem; }
.pr-split i { display: block; height: 100%; background: var(--ds-up-ink); }

.pr-lead { margin: 0; padding: .9rem 1.1rem; border-radius: var(--ds-r-lg); background: var(--ds-surface-2); border-inline-start: 4px solid hsl(199 89% 48%); color: var(--ds-text); font-size: .92rem; line-height: 2; font-weight: 600; }

/* ---------- chart ---------- */
.pr-seg { display: inline-flex; gap: 3px; padding: 3px; border-radius: var(--ds-r-md); background: var(--ds-surface-2); border: 1px solid var(--ds-line); }
.pr-seg button { border: 0; background: transparent; color: var(--ds-text-2); font: inherit; font-size: .78rem; font-weight: 800; padding: .4rem .75rem; min-height: 34px; border-radius: var(--ds-r-sm); cursor: pointer; transition: background-color .15s, color .15s; }
.pr-seg button:hover { color: var(--ds-text); }
.pr-seg button[aria-selected="true"] { background: var(--ds-surface-1); color: var(--ds-text); box-shadow: var(--ds-shadow-1); }
.pr-chart__box { position: relative; height: clamp(240px, 34vw, 340px); }
.pr-chart__more { display: inline-block; margin-top: .75rem; font-size: .8rem; font-weight: 800; color: hsl(199 89% 40%); text-decoration: none; }
.dark-theme .pr-chart__more, .dark .pr-chart__more { color: hsl(199 89% 62%); }
.pr-chart__more:hover { text-decoration: underline; }
.pr-empty { display: flex; flex-direction: column; align-items: center; text-align: center; gap: .35rem; padding: 2rem 1rem; color: var(--ds-text-2); font-size: .85rem; }
.pr-empty svg { width: 34px; height: 34px; opacity: .6; }
.pr-empty b { color: var(--ds-text); font-weight: 900; }

/* ---------- layout below the chart ---------- */
.pr-grid { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 1.1rem; align-items: start; }
.pr-main { display: flex; flex-direction: column; gap: 1.1rem; min-width: 0; }
.pr-side { display: flex; flex-direction: column; gap: 1.1rem; position: sticky; top: 96px; min-width: 0; }

/* history table */
.pr-table-wrap { overflow-x: auto; margin: 0 -.25rem; }
.pr-table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: .84rem; }
.pr-table th, .pr-table td { padding: .6rem .55rem; text-align: start; white-space: nowrap; border-bottom: 1px solid var(--ds-line-soft); }
.pr-table thead th { font-size: .72rem; font-weight: 800; color: var(--ds-text-2); background: var(--ds-surface-2); border-bottom: 0; }
.pr-table thead th:first-child { border-start-start-radius: var(--ds-r-md); border-end-start-radius: var(--ds-r-md); }
.pr-table thead th:last-child { border-start-end-radius: var(--ds-r-md); border-end-end-radius: var(--ds-r-md); }
.pr-table tbody th { font-weight: 800; }
.pr-table td { color: var(--ds-text-2); font-weight: 600; }
.pr-table tbody tr:hover td, .pr-table tbody tr:hover th { background: var(--ds-surface-2); }
.pr-table .pr-strong { color: var(--ds-text); font-weight: 900; }
.pr-table tr.pr-more { display: none; }
.pr-table.is-open tr.pr-more { display: table-row; }
.pr-chg { display: flex; align-items: center; gap: .5rem; font-weight: 900; font-variant-numeric: tabular-nums; }
.pr-chg > i { flex: 1; min-width: 36px; max-width: 70px; height: 5px; border-radius: var(--ds-r-pill); background: var(--ds-surface-2); overflow: hidden; }
.pr-chg > i > i { display: block; height: 100%; border-radius: inherit; background: currentColor; opacity: .75; }
.pr-chg.is-flat { color: var(--ds-text-2); }
.pr-table-toggle { margin-top: .75rem; width: 100%; }

.pr-prose p { margin: 0; color: var(--ds-text-2); line-height: 2.1; font-size: .92rem; font-weight: 600; max-width: 75ch; }
.pr-drivers { list-style: none; counter-reset: d; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .6rem; }
.pr-drivers li { counter-increment: d; position: relative; padding: .8rem .9rem .8rem .9rem; padding-inline-start: 2.6rem; border-radius: var(--ds-r-lg); background: var(--ds-surface-2); color: var(--ds-text-2); font-size: .85rem; line-height: 1.9; font-weight: 600; }
.pr-drivers li::before { content: counter(d, persian); position: absolute; inset-inline-start: .8rem; top: .8rem; width: 1.4rem; height: 1.4rem; border-radius: var(--ds-r-xs); display: grid; place-items: center; font-size: .74rem; font-weight: 900; color: hsl(199 89% 40%); background: hsl(199 89% 48% / .14); }

.pr-faq { display: flex; flex-direction: column; gap: .5rem; }
.pr-faq details { border: 1px solid var(--ds-line); border-radius: var(--ds-r-lg); background: var(--ds-surface-1); overflow: hidden; transition: border-color .15s; }
.pr-faq details[open] { border-color: hsl(199 89% 48% / .4); background: var(--ds-surface-2); }
.pr-faq summary { list-style: none; display: flex; align-items: center; justify-content: space-between; gap: .75rem; padding: .85rem 1rem; cursor: pointer; font-weight: 800; font-size: .9rem; min-height: 44px; }
.pr-faq summary::-webkit-details-marker { display: none; }
.pr-faq summary svg { width: 18px; height: 18px; flex: none; color: var(--ds-text-2); transition: transform .2s; }
.pr-faq details[open] summary svg { transform: rotate(180deg); }
.pr-faq p { margin: 0; padding: 0 1rem 1rem; color: var(--ds-text-2); font-size: .86rem; line-height: 2; font-weight: 600; }

/* side */
.pr-promo { background: linear-gradient(160deg, hsl(199 89% 48% / .12), transparent 60%), var(--ds-surface-1); display: flex; flex-direction: column; gap: .6rem; }
.pr-promo b { font-size: 1rem; font-weight: 900; }
.pr-promo ul { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: .35rem; font-size: .82rem; color: var(--ds-text-2); font-weight: 600; }
.pr-promo li::before { content: "✓"; color: var(--ds-up-ink); font-weight: 900; margin-inline-end: .45rem; }
.pr-chips { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: .4rem; }
.pr-chips a { display: inline-flex; align-items: center; min-height: 36px; padding: .35rem .8rem; border-radius: var(--ds-r-pill); background: var(--ds-surface-2); border: 1px solid var(--ds-line); color: var(--ds-text); text-decoration: none; font-size: .8rem; font-weight: 800; transition: border-color .15s, transform .15s; }
.pr-chips a:hover { border-color: hsl(199 89% 48% / .5); transform: translateY(-1px); }
.pr-links { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .25rem; }
.pr-links a { display: flex; align-items: center; gap: .6rem; padding: .55rem .6rem; border-radius: var(--ds-r-md); text-decoration: none; color: var(--ds-text); transition: background-color .15s; }
.pr-links a:hover { background: var(--ds-surface-2); }
.pr-links img { width: 44px; height: 44px; border-radius: var(--ds-r-sm); object-fit: cover; flex: none; border: 1px solid var(--ds-line); }
.pr-links span { display: flex; flex-direction: column; gap: .1rem; font-size: .84rem; font-weight: 800; line-height: 1.6; min-width: 0; }
.pr-links small { font-size: .7rem; color: var(--ds-text-2); font-weight: 600; }
.pr-links em { font-style: normal; font-size: .68rem; font-weight: 900; margin-inline-end: .3rem; }

/* ---------- responsive ---------- */
@media (max-width: 1023px) {
  .pr-hero { grid-template-columns: 1fr; }
  .pr-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .pr-grid { grid-template-columns: 1fr; }
  .pr-side { position: static; }
}
@media (max-width: 640px) {
  .pr-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .5rem; }
  .pr-stat { padding: .7rem .75rem; }
  .pr-live { margin-inline-start: 0; }
  .pr-cta .pr-btn { flex: 1 1 auto; }
  .pr-cta .pr-btn--pri { flex-basis: 100%; }
  .pr-drivers { grid-template-columns: 1fr; }
  .pr-card__head .pr-seg { width: 100%; }
  .pr-seg button { flex: 1; }
  /* phones: date / close / change only - the chart tooltip carries open/high/low */
  .pr-table th:nth-child(2), .pr-table td:nth-child(2), .pr-table th:nth-child(3), .pr-table td:nth-child(3),
  .pr-table th:nth-child(4), .pr-table td:nth-child(4) { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .pr-live i::after { animation: none; }
  .pr-range__bar i, .pr-btn, .pr-chips a { transition: none; }
}
html.dark-theme .pr-drivers li::before { color: hsl(199 89% 66%); background: hsl(199 89% 48% / .18); }
