/* IranPhi market workspace, benchmarked against TradingView Markets (2026-10-18).
   Reference measurements and RTL adaptations: design-system/iranphi/benchmarks/tradingview-markets.md. */

@font-face{font-family:Vazirmatn;src:url('./fonts/vazirmatn-variable-33.003.woff2') format('woff2');font-weight:100 900;font-style:normal;font-display:swap}

:root{
  color-scheme:light;
  --bg:#fff;
  --surface:#fff;
  --surface-2:#f2f2f2;
  --line:#ebebeb;
  --line-strong:#d1d4dc;
  --ink:#0f0f0f;
  --text:#202124;
  --muted:#62666e;
  --faint:#727680;
  --brand:#2962ff;
  --brand-soft:#eef3ff;
  --up:#087a66;   --up-bg:#e6f4ef;
  --down:#f23645; --down-bg:#fff0f1;
  --down-label:#c42438;   /* darker than the chart line for small text */
  --flat-bg:#f2f2f2;
  --stale:#774915;
  --closed:#727680;
  --gold:#966900;
  --demo-bg:#f2f2f2; --demo-fg:#555963;
  --radius:12px;
  --header-height:64px;
  --sitenav-height:51px;
  --font:Vazirmatn,Tahoma,sans-serif;
}
:root[data-theme=dark]{
  color-scheme:dark;
  --bg:#131722; --surface:#131722; --surface-2:#1e222d; --line:#2a2e39; --line-strong:#434651;
  --ink:#f0f3fa; --text:#d1d4dc; --muted:#a3a6af; --faint:#8b909d; --brand:#80a4ff;
  --brand-soft:#232e49;
  --up:#42c9ad; --up-bg:#14352e; --down:#ff6978; --down-bg:#3a242c;
  --down-label:#ff6978;
  --flat-bg:#1e222d; --stale:#e6b954; --closed:#969aa5; --gold:#d7b15d;
  --demo-bg:#1e222d; --demo-fg:#a3a6af;
}
@media (prefers-color-scheme:dark){
  :root:not([data-theme=light]){
    color-scheme:dark;
    --bg:#131722; --surface:#131722; --surface-2:#1e222d; --line:#2a2e39; --line-strong:#434651;
    --ink:#f0f3fa; --text:#d1d4dc; --muted:#a3a6af; --faint:#8b909d; --brand:#80a4ff;
    --brand-soft:#232e49;
    --up:#42c9ad; --up-bg:#14352e; --down:#ff6978; --down-bg:#3a242c;
    --down-label:#ff6978;
    --flat-bg:#1e222d; --stale:#e6b954; --closed:#969aa5; --gold:#d7b15d;
    --demo-bg:#1e222d; --demo-fg:#a3a6af;
  }
}

*{box-sizing:border-box}
html{scroll-padding-top:calc(var(--header-height) + var(--sitenav-height) + 12px);-webkit-text-size-adjust:100%}
/* Digits stay proportional. Vazirmatn's tabular digits give every digit, even ۱,
   the widest cell: "۱۱۱۱۱۱۱" gets 2.3 times as wide and a number like ۳٬۵۴۰٬۰۰۰ about 28 % wider. */
body{margin:0;background:var(--bg);color:var(--text);font:15px/1.7 var(--font);-webkit-font-smoothing:antialiased}
h1,h2,p,ol{margin:0;padding:0}
ol{list-style:none}
a{color:inherit;text-decoration:none}
button,input{font:inherit;color:inherit}
button{background:none;border:0;padding:0;cursor:pointer}
:focus-visible{outline:2px solid var(--brand);outline-offset:3px;border-radius:6px}
svg{display:block}
[hidden]{display:none!important}
.sr-only{position:absolute;width:1px;height:1px;margin:-1px;overflow:hidden;clip:rect(0 0 0 0);border:0;white-space:nowrap}
.wrap{max-width:1320px;margin:0 auto;padding:0 32px}

/* ---- top ---- */
.demo-bar{background:var(--demo-bg);color:var(--demo-fg);font-size:12px;text-align:center;padding:5px 16px}
.note{margin:0 0 20px;padding:11px 14px;border:1px solid var(--line-strong);border-radius:12px;background:var(--surface);font-size:13px;color:var(--muted)}
.skip-link:focus{position:fixed;top:8px;right:12px;z-index:50;width:auto;height:auto;margin:0;padding:9px 16px;clip:auto;background:var(--ink);color:var(--bg);border-radius:8px}
.demo-bar b{font-weight:700;margin-inline-end:6px}
.top{position:sticky;top:0;z-index:30;background:var(--bg);border-bottom:1px solid var(--line)}
.top-in{height:calc(var(--header-height) - 1px);display:flex;align-items:center;justify-content:space-between;gap:16px}
.brand{display:flex;align-items:center;gap:10px;font-size:25px;font-weight:800;color:var(--ink);letter-spacing:-.01em}
.mark{color:var(--ink);display:block}
.mark svg{width:22px;height:28px}
.top-end{display:flex;align-items:center;gap:10px}
.global-search{display:flex;align-items:center;gap:10px;flex:1;min-width:120px;max-width:560px;height:40px;padding:0 12px 0 8px;margin-inline:auto;background:var(--surface-2);border:1px solid transparent;border-radius:999px}
.global-search:focus-within{border-color:var(--brand)}
.global-search input{flex:1;min-width:0;height:100%;padding:0;border:0;outline:0;background:none;color:var(--ink);font-size:14px;direction:rtl}
.global-search input::placeholder{color:var(--muted)}
.global-search button{display:grid;place-items:center;width:30px;height:38px;flex:none;color:var(--muted)}
.global-search svg{width:19px;height:19px;fill:none;stroke:currentColor;stroke-width:1.6;stroke-linecap:round}
.global-search kbd{font:12px/1.4 system-ui,sans-serif;color:var(--muted);white-space:nowrap;direction:ltr}
.live{display:inline-flex;align-items:center;gap:8px;height:34px;padding:0 13px;border:1px solid var(--line);border-radius:999px;background:var(--surface);font-size:12.5px;color:var(--muted);white-space:nowrap}
.live i{width:7px;height:7px;border-radius:50%;background:var(--faint);transition:background-color .3s}
.live[data-state=live]{color:var(--ink)}
.live[data-state=live] i{background:var(--up);animation:pulse 2.4s ease-out infinite}
.live[data-state=slow] i{background:var(--stale)}
.live[data-state=offline] i{background:var(--down)}
.live[data-state=closed] i{background:var(--closed)}
@keyframes pulse{0%{box-shadow:0 0 0 0 color-mix(in srgb,var(--up) 45%,transparent)}70%{box-shadow:0 0 0 7px transparent}100%{box-shadow:0 0 0 0 transparent}}
.icon-btn{width:40px;height:40px;border-radius:50%;border:0;background:var(--surface);display:grid;place-items:center;color:var(--muted);transition:color .15s,background-color .15s}
.icon-btn:hover{color:var(--ink);border-color:var(--line-strong)}
.icon-btn svg{width:17px;height:17px;fill:none;stroke:currentColor;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round}
.i-sun{display:none}
:root[data-theme=dark] .i-sun{display:block}
:root[data-theme=dark] .i-moon{display:none}

/* ---- heading ---- */
.head{display:flex;justify-content:space-between;align-items:flex-end;gap:24px;padding:40px 0 28px}
.eyebrow{font-size:13px;color:var(--muted);margin-bottom:2px}
h1{font-size:48px;line-height:1.3;font-weight:650;color:var(--ink);letter-spacing:0}
.head-meta{display:flex;flex-direction:column;align-items:flex-end;gap:1px;font-size:13px;color:var(--muted)}
#lastChange{color:var(--ink)}
/* the home page starts closer to the top: no eyebrow, a smaller title, the date is in the header */
.head.compact{align-items:baseline;padding:14px 0 12px}
.head.compact h1{font-size:26px;line-height:1.4}
.head.compact .head-meta{display:block;font-size:12.5px}
.today{font-size:12.5px;color:var(--muted);white-space:nowrap}

/* ---- key instruments ---- */
.strip{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:8px;margin-bottom:14px}
.tile{display:grid;grid-template-columns:auto minmax(0,1fr) auto;align-items:center;column-gap:10px;padding:8px 12px;background:var(--surface);border:1px solid var(--line);border-radius:12px}
.tile-main{min-width:0}
.tile-name{display:block;font-size:12.5px;line-height:1.5;color:var(--muted);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.tile-name:hover{color:var(--ink)}
.tile-price{display:flex;align-items:baseline;gap:5px}
.tile-price b{font-size:19px;line-height:1.35;font-weight:700;color:var(--ink);letter-spacing:-.01em;border-radius:6px;padding:0 4px;margin-inline-start:-4px;white-space:nowrap}
.tile-price small{font-size:10.5px;color:var(--faint);white-space:nowrap}
.tile-side{display:flex;flex-direction:column;align-items:flex-end;gap:3px}
.tile .chg{height:22px;padding:0 8px;font-size:11.5px}
.tile .spark{width:58px;height:18px}
.strip .tile .ico.asset-pictogram{width:34px;height:34px}

.ico{flex:none;display:grid;place-items:center;width:32px;height:32px;border-radius:10px;background:var(--surface-2);border:1px solid var(--line);font-size:12.5px;font-weight:700;color:var(--ink);line-height:1;letter-spacing:0}
.ico.k-gold,.ico.k-coin{color:var(--gold)}
.tile .ico{width:26px;height:26px;border-radius:8px;font-size:11px}

/* ---- trend and change ---- */
.spark{display:block;overflow:visible}
.spark path{vector-effect:non-scaling-stroke}
.spark .line{fill:none;stroke:var(--spark);stroke-width:1.7;stroke-linejoin:round;stroke-linecap:round}
.spark .area{fill:var(--spark);opacity:.1;stroke:none}
.spark.up{--spark:var(--up)} .spark.down{--spark:var(--down)} .spark.flat{--spark:var(--faint)}
.grid .spark .area{display:none}
.chg{display:inline-flex;align-items:center;gap:5px;height:26px;padding:0 2px;border-radius:4px;font-size:13px;font-weight:500;direction:ltr;unicode-bidi:isolate}
.chg.up{color:var(--up);background:none}
.chg.down{color:var(--down-label);background:none}
.chg.down .tri{fill:var(--down)}
.chg.flat{color:var(--muted);background:none}
.tri{width:8px;height:8px;fill:currentColor}

/* ---- layout ---- */
.layout{display:grid;grid-template-columns:minmax(0,1fr) 316px;gap:20px;align-items:start;margin-bottom:56px}
.sheet{background:var(--surface);border:0;border-radius:0;overflow:clip}
.toolbar{display:flex;align-items:center;gap:12px;padding:14px 0;border-bottom:1px solid var(--line);flex-wrap:wrap}
.chips{display:flex;gap:6px;flex-wrap:wrap}
.chip{height:34px;padding:0 15px;border-radius:999px;border:1px solid var(--line);background:var(--surface);font-size:13.5px;color:var(--muted);transition:color .15s,border-color .15s,background-color .15s}
.chip:hover{color:var(--ink);border-color:var(--line-strong)}
.chip[aria-selected=true]{background:var(--surface-2);border-color:var(--surface-2);color:var(--ink);font-weight:650}
.tools{display:flex;align-items:center;gap:10px;margin-inline-start:auto}
.search{display:flex;align-items:center;gap:8px;height:34px;width:190px;padding:0 12px;border-radius:999px;background:var(--surface-2);border:1px solid var(--line);color:var(--faint)}
.search:focus-within{border-color:var(--brand);color:var(--muted)}
.search svg{width:16px;height:16px;fill:none;stroke:currentColor;stroke-width:1.7;stroke-linecap:round}
.search input{border:0;background:none;outline:0;width:100%;min-width:0;font-size:13px;color:var(--ink)}
.search input::placeholder{color:var(--faint)}
.seg{display:inline-flex;padding:2px;border:1px solid var(--line);border-radius:999px;background:var(--surface-2)}
.seg button{height:28px;padding:0 12px;border-radius:999px;font-size:12.5px;color:var(--muted)}
.seg button[aria-pressed=true]{background:var(--surface);color:var(--ink);font-weight:650;box-shadow:0 0 0 1px var(--line)}

/* ---- table ---- */
.grid{width:100%;border-collapse:collapse;table-layout:fixed}
.grid thead th{position:sticky;top:calc(var(--header-height) + 50px);z-index:5;background:var(--surface);padding:12px;border-bottom:1px solid var(--line);font-size:12px;font-weight:500;color:var(--muted);text-align:right;white-space:nowrap}
.grid td{padding:10px 12px;height:60px;border-bottom:1px solid var(--line);vertical-align:middle}
.grid tbody tr:last-child td{border-bottom:0}
.grid tbody tr:not(.grp):hover td{background:var(--surface-2)}
.grid tr.grp th{padding:14px 12px 8px;background:var(--surface);border-bottom:1px solid var(--line);font-size:12px;font-weight:650;color:var(--muted);text-align:right}
.grid tr.grp th span{margin-inline-start:8px;font-weight:500;color:var(--faint)}
.c-asset{width:24%} .c-price{width:19%} .c-chg{width:12%} .c-spark{width:12%} .c-range{width:21%} .c-time{width:12%}
.asset{display:flex;align-items:center;gap:12px;min-width:0}
.asset .ico{width:36px;height:36px;border-radius:11px}
.nm{min-width:0}
.nm strong{display:block;font-size:14.5px;font-weight:650;color:var(--ink);line-height:1.5;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.nm small{display:block;font-size:11.5px;color:var(--muted);line-height:1.4;letter-spacing:.3px}
.c-price b{display:block;width:fit-content;font-size:17px;font-weight:700;color:var(--ink);border-radius:6px;padding:0 5px;margin-inline-start:-5px;line-height:1.5}
.c-price small{display:block;font-size:12px;line-height:1.4;color:var(--muted)}
.c-spark .spark{width:84px;height:28px}
.range{width:100%;max-width:176px;direction:ltr}
.range svg{width:100%;height:8px;overflow:visible}
.range line{vector-effect:non-scaling-stroke;stroke-linecap:round}
.trk{stroke:var(--line-strong);stroke-width:3}
.dot{stroke:var(--ink);stroke-width:3}
.rl{display:flex;justify-content:space-between;gap:10px;margin-top:5px;font-size:10.5px;color:var(--muted)}
.quote-time{display:inline-flex;align-items:center;gap:6px;font-size:12px;color:var(--muted);white-space:nowrap}
.quote-time i{width:6px;height:6px;border-radius:50%;background:var(--up)}
.quote-time.stale{color:var(--stale)} .quote-time.stale i{background:var(--stale)}
.quote-time.closed i,.quote-time.unavailable i{background:var(--closed)}
tr.is-stale .c-price b,.tile.is-stale .tile-price b{color:var(--faint)}
tr.is-closed .c-price b,.tile.is-closed .tile-price b{color:var(--closed)}
[data-tick]::after{font-size:9px;margin-inline-start:5px;vertical-align:middle}
[data-tick=up]::after{content:'▲';color:var(--up)}
[data-tick=down]::after{content:'▼';color:var(--down)}

.sheet-foot{display:flex;justify-content:space-between;align-items:center;gap:12px;padding:13px 16px;border-top:1px solid var(--line);font-size:12px;color:var(--muted)}
.legend{display:inline-flex;align-items:center;gap:6px}
.legend i{width:6px;height:6px;border-radius:50%;margin-inline-start:8px}
.legend i.ok{background:var(--up)} .legend i.stale{background:var(--stale)} .legend i.closed{background:var(--closed)}
.empty{padding:56px 16px;text-align:center;color:var(--muted)}
.empty strong{display:block;font-size:15px;color:var(--ink);font-weight:650}
.empty p{margin:4px 0 16px;font-size:13px}

/* ---- right rail ---- */
.rail{display:flex;flex-direction:column;gap:14px;position:sticky;top:84px}
.card{padding:18px;background:var(--surface);border:1px solid var(--line);border-radius:var(--radius)}
.card h2{display:flex;justify-content:space-between;align-items:baseline;margin-bottom:14px;font-size:14px;font-weight:700;color:var(--ink)}
.card h2 small{font-size:11.5px;font-weight:400;color:var(--muted)}
.mood{width:100%;height:8px;border-radius:4px;overflow:hidden;direction:ltr}
.mood .up{fill:var(--up)} .mood .flat{fill:var(--line-strong)} .mood .down{fill:var(--down)}
.mood-key{display:flex;justify-content:space-between;margin-top:12px;font-size:12.5px;color:var(--muted)}
.mood-key b{font-size:15px;font-weight:700;margin-inline-end:3px}
.mood-key .up b{color:var(--up)} .mood-key .down b{color:var(--down-label)} .mood-key .flat b{color:var(--ink)}
.movers li{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:10px 0;border-top:1px solid var(--line)}
.movers li:first-child{border-top:0;padding-top:0}
.movers li:last-child{padding-bottom:0}
.movers .nm strong{font-size:13.5px}
.movers .none{display:block;font-size:13px;color:var(--muted);border:0;padding:0}

/* ---- footer ---- */
.foot{border-top:1px solid var(--line)}
.foot-in{display:flex;align-items:center;justify-content:space-between;gap:16px;padding-top:22px;padding-bottom:30px;font-size:12px;color:var(--muted)}
.foot-brand{font-size:17px;font-weight:800;color:var(--ink)}
.en{direction:ltr;font-family:system-ui,sans-serif;letter-spacing:.3px}

/* ---- responsive ---- */
@media (max-width:1100px){
  .layout{grid-template-columns:1fr}
  .rail{position:static;display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px}
  .c-range,.grid th.c-range{display:none}
  .c-asset{width:30%} .c-price{width:24%} .c-chg{width:17%} .c-spark{width:17%} .c-time{width:12%}
}
@media (max-width:820px){
  .wrap{padding:0 18px}
  .strip{display:flex;overflow-x:auto;scroll-snap-type:x mandatory;gap:8px;margin:0 -18px 14px;padding:0 18px 4px;scrollbar-width:none}
  .strip::-webkit-scrollbar{display:none}
  /* on a phone a tile is a small column: icon and name, price, change and trend */
  .tile{flex:0 0 160px;scroll-snap-align:start;grid-template-columns:auto minmax(0,1fr);grid-template-areas:"ico name" "price price" "side side";row-gap:4px;padding:9px 11px}
  .tile-main{display:contents}
  .tile .ico{grid-area:ico}
  .tile-name{grid-area:name}
  .tile-price{grid-area:price}
  .tile-side{grid-area:side;flex-direction:row;align-items:center;justify-content:space-between}
  .strip .tile .ico.asset-pictogram{width:28px;height:28px}
  .tile-price b{font-size:17px}
  .head:not(.compact){flex-direction:column;align-items:flex-start;padding:26px 0 18px}
  .head.compact{padding:12px 0 10px}
  .head.compact h1{font-size:22px}
  h1{font-size:28px}
  .head-meta{align-items:flex-start}
  .rail{grid-template-columns:1fr}
  .tools{width:100%;margin-inline-start:0}
  .search{flex:1;width:auto}
  .chips{flex-wrap:nowrap;overflow-x:auto;width:100%;scrollbar-width:none;margin:0 -2px;padding:0 2px}
  .chips::-webkit-scrollbar{display:none}
  .chip{flex:none}
  .c-time,.grid th.c-time{display:none}
  .c-asset{width:36%} .c-price{width:30%} .c-chg{width:20%} .c-spark{width:14%}
  .c-spark .spark{width:52px}
  .grid td{padding:10px 8px;height:64px}
  .grid thead th{padding:9px 8px}
  .nm small{display:none}
  .nm strong{white-space:normal;font-size:13px;line-height:1.4;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical}
  .asset{gap:9px}
  .asset .ico{width:32px;height:32px}
  .c-price b{font-size:15px}
  .chg{padding:0 7px;font-size:12px}
  .foot-in{flex-wrap:wrap}
}
@media (max-width:620px){
  .today{display:none}
}
@media (max-width:1000px){
  .top-end .today{display:none}
}
@media (max-width:700px){
  :root{--header-height:113px}
  .top-in{display:grid;grid-template-columns:1fr auto;gap:8px 12px;padding-block:8px}
  .global-search{grid-column:1/-1;grid-row:2;width:100%;max-width:none;margin:0;height:40px}
  .top-end{justify-content:flex-end}
  .top-end .live{height:32px;padding:0 9px;font-size:11.5px}
  .global-search kbd{display:none}
}
@media (max-width:520px){
  :root{--sitenav-height:47px}
  .live span{max-width:84px;overflow:hidden;text-overflow:ellipsis}
  .c-asset{width:33%} .c-price{width:27%} .c-chg{width:24%} .c-spark{width:16%}
  .c-spark .spark{width:100%;max-width:44px;height:24px}
  .grid td,.grid thead th{padding-inline:6px}
  .chg .tri{display:none} /* the + or − in the text still says the direction */
  .chg{font-size:11.5px;padding:0 7px}
}
@media (prefers-reduced-motion:reduce){
  *,*::before,*::after{animation:none!important;transition:none!important;scroll-behavior:auto!important}
}

/* ---- headline strip under the header (templates/ticker.html, ticker.js) ---- */
.ticker{display:flex;align-items:stretch;height:40px;border-bottom:1px solid var(--line);background-color:var(--surface-2);background-image:linear-gradient(110deg,color-mix(in srgb,var(--brand) 4%,var(--surface)) 0%,color-mix(in srgb,var(--brand) 2%,var(--surface)) 48%,color-mix(in srgb,var(--brand) 6%,var(--surface)) 100%);font-size:13px;overflow:hidden}
.ticker-label{flex:none;position:relative;z-index:1;display:flex;align-items:center;gap:8px;padding:0 16px;border-inline-end:1px solid var(--line);background:transparent;font-weight:700;color:var(--ink)}
.ticker-label i{width:7px;height:7px;border-radius:50%;background:var(--brand)} /* no pulse: the headlines are not live */
.ticker-view{flex:1;min-width:0;overflow:hidden;direction:ltr;-webkit-mask-image:linear-gradient(to right,transparent,#000 28px,#000 calc(100% - 28px),transparent);mask-image:linear-gradient(to right,transparent,#000 28px,#000 calc(100% - 28px),transparent)}
/* DOM order is newest first; row-reverse puts the newest at the right edge of
   each round, so as the line moves to the right the newest enters first */
.ticker-track{display:flex;flex-direction:row-reverse;align-items:center;width:max-content;height:100%;margin:0;padding:0;list-style:none;animation:ticker var(--ticker-dur,160s) linear infinite}
.ticker-track li{flex:none;direction:rtl;padding-inline:20px;white-space:nowrap}
.ticker-track li::before{content:'';display:inline-block;width:5px;height:5px;margin-inline-end:9px;border-radius:50%;background:var(--brand);vertical-align:middle}
.ticker-track a{color:var(--text)}
.ticker-track a:hover,.ticker-track a:focus-visible{color:var(--ink);text-decoration:underline;text-underline-offset:4px}
.ticker:hover .ticker-track,.ticker:focus-within .ticker-track,.ticker.is-paused .ticker-track{animation-play-state:paused}
.ticker-toggle{flex:none;display:grid;place-items:center;width:40px;border-inline-start:1px solid var(--line);color:var(--muted)}
.ticker-toggle:hover{color:var(--ink)}
.ticker-toggle svg{width:16px;height:16px;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}
.ticker-toggle .i-play{display:none;fill:currentColor}
.ticker-toggle[aria-pressed=true] .i-pause{display:none}
.ticker-toggle[aria-pressed=true] .i-play{display:block}
@keyframes ticker{from{transform:translateX(-50%)}to{transform:translateX(0)}}
@media (max-width:620px){
  .ticker{font-size:12.5px}
  .ticker-label{padding:0 11px}
  .ticker-track li{padding-inline:14px}
}
/* reduced motion: nothing moves; the line is an ordinary scrollable row, newest at the right */
@media (prefers-reduced-motion:reduce){
  .ticker-view{direction:rtl;overflow-x:auto;scrollbar-width:thin;-webkit-mask-image:none;mask-image:none}
  .ticker-track{flex-direction:row;direction:rtl;transform:none}
  .ticker-track li[aria-hidden=true]{display:none}
}

/* ---- hover card on the market pulse bar (home.js: who is behind each segment) ---- */
.market-mood{position:relative}
.mood-hit{padding-block:10px;margin-block:-10px;cursor:pointer}
.mood rect{transition:opacity .15s}
.mood[data-hover] rect{opacity:.35}
.mood[data-hover=up] .up,.mood[data-hover=flat] .flat,.mood[data-hover=down] .down{opacity:1}
.mood-key span{border-radius:6px;cursor:default}
.mood-tip{position:absolute;z-index:20;min-width:230px;max-width:min(340px,100%);padding:11px 14px;border-radius:12px;background:var(--ink);color:var(--bg);font-size:12.5px;line-height:1.8;box-shadow:0 10px 28px rgba(0,0,0,.22);pointer-events:none}
.mood-tip>b{display:block;margin-bottom:6px;font-size:13px;font-weight:650}
.mood-tip ol{margin:0;padding:0;list-style:none;display:grid;gap:4px}
.mood-tip li{display:flex;align-items:center;justify-content:space-between;gap:16px}
.mood-tip li>span:first-child{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.mood-tip p{margin:6px 0 0;opacity:.75}
@media (prefers-reduced-motion:reduce){.mood rect{transition:none}}

/* ---- change pills: the percent change is a tinted pill wherever it appears (tables, lists, cards) ---- */
:root{--chg-up:#4650d8;--chg-up-bg:#eceefe;--chg-down:#d4468f;--chg-down-bg:#fdecf4;--chg-down-text:#b8337a}
:root[data-theme=dark]{--chg-up:#9aa3ff;--chg-up-bg:#242a52;--chg-down:#ff86bd;--chg-down-bg:#3d2433;--chg-down-text:#ff86bd}
@media (prefers-color-scheme:dark){:root:not([data-theme=light]){--chg-up:#9aa3ff;--chg-up-bg:#242a52;--chg-down:#ff86bd;--chg-down-bg:#3d2433;--chg-down-text:#ff86bd}}
.chg{height:24px;padding:0 9px;border-radius:999px;font-size:12.5px;font-weight:650}
.chg.up{color:var(--chg-up);background:var(--chg-up-bg)}
.chg.down{color:var(--chg-down-text);background:var(--chg-down-bg)}
.chg.flat{color:var(--muted);background:var(--flat-bg)}
.chg .tri,.chg.down .tri{fill:currentColor}
body .universe-change{padding:1px 8px;border-radius:999px;font-weight:650}
body .universe-change.up{color:var(--chg-up);background:var(--chg-up-bg)}
body .universe-change.down{color:var(--chg-down-text);background:var(--chg-down-bg)}
body .universe-change.flat{color:var(--muted);background:var(--flat-bg)}

/* switching a tab cross-fades instead of flashing (static/tab-nav.js skips it for every other navigation) */
@view-transition{navigation:auto}
::view-transition-old(root),::view-transition-new(root){animation-duration:.14s}
@media(prefers-reduced-motion:reduce){::view-transition-group(*),::view-transition-old(*),::view-transition-new(*){animation:none!important}}

/* A chart with nothing to draw keeps its shape: a faint grey line and a plain
   note over it, so an empty state never collapses the layout around it. The
   server-rendered kind is .chart-void (template "chart-ghost"); the drawn kind
   is [data-void] on the chart or its canvas (static/chart-void.js). */
.chart-ghost{position:absolute;inset:0;width:100%;height:100%;pointer-events:none}
.chart-ghost path,.chart-void-line{fill:none;stroke:var(--muted);stroke-width:2.5;stroke-linecap:round;stroke-linejoin:round;stroke-dasharray:3 9;opacity:.32;vector-effect:non-scaling-stroke}
.chart-void{position:relative;display:grid;place-items:center;min-height:240px;overflow:hidden;text-align:center;border:1px dashed var(--line);border-radius:14px;background:transparent!important}
.chart-void-note{position:relative;display:grid;gap:6px;max-width:min(560px,90%);padding:16px;pointer-events:none;user-select:none}
.chart-void-note strong{font-size:clamp(19px,2.6vw,28px)!important;font-weight:700!important;line-height:1.6;color:var(--muted)!important;opacity:.6}
.chart-void-note p{margin:0;font-size:13px;line-height:1.9;color:var(--muted);opacity:.55}
.chart-void-note:not(:has(strong)){font-size:clamp(19px,2.6vw,28px);font-weight:700;line-height:1.6;color:var(--muted);opacity:.6}
.chart-void-label{position:absolute;inset:0;display:grid;place-items:center;padding:16px;text-align:center;direction:rtl;pointer-events:none;user-select:none;font-size:clamp(19px,2.6vw,28px);font-weight:700;line-height:1.6;color:var(--muted);opacity:.6}
.chart-void-label small{display:block;font-size:12.5px;font-weight:400;opacity:.9}
/* the interactive charts */
.universe-chart-canvas[data-void] .universe-chart-line{stroke:var(--muted);stroke-width:2.5;stroke-dasharray:3 9;stroke-linecap:round;opacity:.32}
.universe-chart-canvas[data-void] .universe-chart-area{display:none}
.universe-chart-canvas[data-void] .universe-chart-message{background:transparent;pointer-events:none;font-size:clamp(19px,2.6vw,28px)!important;font-weight:700;color:var(--muted);opacity:.6}
.chart[data-void]{position:relative}
.chart[data-void] .line{stroke:var(--muted);stroke-width:2.5;stroke-dasharray:3 9;stroke-linecap:round;opacity:.32}
.chart[data-void] .area{display:none}
.chart[data-void] .cursor-line,.chart[data-void] .cursor-dot,.chart[data-void] .tip{display:none!important}
.market-strip-spark[data-direction=void] .mini-line{stroke:var(--muted);opacity:.35;stroke-dasharray:2 4}
.market-strip-spark[data-direction=void] .mini-area{display:none}
.lm-chart-stage[data-void] #lm-main-line{stroke:var(--lm-muted,#8a8f99);stroke-width:2.5;stroke-dasharray:3 9;opacity:.35}
.lm-chart-stage[data-void] #lm-main-area,.lm-chart-stage[data-void] #lm-main-dot{display:none}
.lm-chart-stage[data-void] #lm-chart-empty{font-size:clamp(19px,2.6vw,28px);font-weight:700;opacity:.6;pointer-events:none}
.chart-void-label{background:transparent}
