/* MineralFunds.com additions on top of the shared MineralPrices.com styles */

/* header ticker tape, as on MineralPrices.com: LIVE badge, metal badges and coloured change pills */
.mf-ticker { display: flex; align-items: stretch; height: 44px; }
.tk-live { flex: none; display: flex; align-items: center; gap: 7px; padding: 0 14px; background: var(--navy); color: #fff; font-family: var(--table); font-size: 13px; font-weight: 800; letter-spacing: .04em; position: relative; z-index: 1; }
.tk-dot { width: 9px; height: 9px; border-radius: 50%; background: #ef3c46; animation: tkDot 1.4s ease-in-out infinite; }
@keyframes tkDot { 0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(239,60,70,.55); } 50% { opacity: .55; box-shadow: 0 0 0 5px rgba(239,60,70,0); } }
.tk-view { flex: 1; min-width: 0; overflow: hidden; display: flex; align-items: center; }
.mf-ticker .track { padding: 0; align-items: center; }
.mf-ticker .item { gap: 8px; padding: 0 18px; }
.mf-ticker .item .lbl { font-weight: 700; }
.mf-ticker .item strong { font-weight: 600; letter-spacing: .01em; }
.mf-ticker .chg { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 12.5px; font-weight: 700; white-space: nowrap; }
.mf-ticker .chg.up { background: #e3f6f0; color: var(--up-ink); }
.mf-ticker .chg.down { background: #fdecee; color: var(--down-ink); }
.mf-ticker .chg.flat, .mf-ticker .chg:empty { background: transparent; padding: 0; }
.mf-ticker strong.tick-up { animation: tkUp 1.2s ease-out; } .mf-ticker strong.tick-down { animation: tkDown 1.2s ease-out; }
@keyframes tkUp { 0%, 30% { color: var(--up-ink); } 100% { color: #1b1f27; } }
@keyframes tkDown { 0%, 30% { color: var(--down-ink); } 100% { color: #1b1f27; } }
@media (prefers-reduced-motion: reduce) { .tk-dot { animation: none; } .tk-view { overflow-x: auto; } }

/* fund tables: ticker in bold before the fund name; rows aren't clickable */
.ptable tbody tr { cursor: default; }
.ptable .ic { font-size: 8.5px; }
.ptable .tk { font-weight: 700; color: var(--navy); min-width: 42px; }
.ptable .nm { white-space: normal; }
.ptable .un:empty { display: none; }
.ptable tr.flash td.last { animation: tickUp 1.2s ease-out; }
.fund-hint { margin-top: 12px; }

/* card icons for the extra colour groups */
.etf-ic.critical { background: var(--g-critical); }
.etf-ic.precious { background: var(--g-precious); }

/* home section headings link to their hub pages */
.section-head h2 a.h-link { color: inherit; text-decoration: none; }
.section-head h2 a.h-link:hover { text-decoration: underline; text-decoration-color: var(--gold); text-underline-offset: 6px; }


/* fund tables: one line per fund; long names are shortened with … (full name shows on hover) */
.ptable td.name .nmw { flex-wrap: nowrap; min-width: 0; }
.ptable td.name { width: 100%; max-width: 0; }
.ptable .nm { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; flex: 0 1 auto; }
.ptable .ic, .ptable .tk { flex: none; }
.ptable .tagk, .ptable .un { white-space: nowrap; flex: none; }
.ptable td.as, .ptable td.mer { color: #767b85; }
.ptable th, .ptable td:not(.name) { white-space: nowrap; }
.ptable td.name { min-width: 260px; }
.ticker-tv .tradingview-widget-container > div, .ticker-tv .tradingview-widget-container iframe { width: 100% !important; max-width: none !important; }

/* dropdown menus: each page name on one line */
.sub a { white-space: nowrap; }
@media (min-width: 1221px) { .sub { width: max-content; } }

/* home page summaries */
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin: 0 0 16px; }
.stat { border: 1px solid #e0e3e8; border-top: 3px solid var(--gold); border-radius: 0 0 10px 10px; padding: 12px 16px; background: var(--surface); }
.stat-l { display: block; font-family: var(--table); font-size: 12.5px; color: #767b85; }
.stat-v { display: block; font-family: var(--table); font-size: 24px; font-weight: 600; color: var(--navy); margin-top: 2px; }
.stat-v.up { color: var(--up-ink); } .stat-v.down { color: var(--down-ink); }
@media (max-width: 760px) { .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.stable { min-width: 680px; }
.stable tbody tr { cursor: default; }
.stable td.name a { color: var(--navy); text-decoration: none; }
.stable td.name a:hover { text-decoration: underline; text-decoration-color: var(--gold); text-underline-offset: 3px; }
.stable tr.grp th { text-align: left; padding: 14px 16px 6px; font-family: var(--brand); font-size: 17px; font-weight: 700; color: var(--navy); border-top: 1px solid #e0e3e8; background: #fafbfd; }
.stable tbody tr.grp:first-child th { border-top: 0; }
.stable tr.subtot td { font-weight: 600; background: #f7f8fb; }
.stable tr.total td { font-weight: 700; color: var(--navy); border-top: 2px solid var(--navy); background: var(--gold-soft, #fbf3dc); }
.stable td.sh { min-width: 120px; }
.ccyn { color: #767b85; margin-left: 6px; }
.gloss { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px 24px; margin: 0; }
.gloss div { border-left: 3px solid var(--gold); padding: 2px 0 2px 12px; }
.gloss dt { font-family: var(--table); font-weight: 700; color: var(--navy); font-size: 14px; }
.gloss dd { margin: 0; color: #5f6470; font-size: 16px; }
@media (max-width: 760px) { .gloss { grid-template-columns: 1fr 1fr; } }


/* ===== Home page: World ETFs and ETFs by exchange ===== */
.mf-block { margin-top: 44px; }
.mf-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px 40px; flex-wrap: wrap; margin-bottom: 18px; }
.mf-head h2 { font-family: var(--display); font-size: clamp(28px, 3.4vw, 38px); line-height: 1.1; color: var(--navy); margin: 0; }
.mf-eyebrow { margin: 0 0 6px; font-family: var(--table); font-size: 12px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: #9a7413; }
.mf-sub { margin: 0; max-width: 46ch; color: var(--ink-soft); font-size: 16px; }

.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 18px; }
.kpi { position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 16px 18px 14px; overflow: hidden; }
.kpi::before { content: ""; position: absolute; inset: 0 0 auto; height: 4px; background: linear-gradient(90deg, var(--gold), #f2cf6b); }
.kpi:first-child { background: var(--navy); border-color: var(--navy); }
.kpi:first-child .kpi-l, .kpi:first-child .kpi-s { color: rgba(255,255,255,.72); }
.kpi:first-child .kpi-v { color: #fff; }
.kpi-l { display: block; font-family: var(--table); font-size: 12.5px; font-weight: 500; color: var(--ink-soft); }
.kpi-v { display: block; font-family: var(--table); font-size: 30px; font-weight: 700; letter-spacing: -.01em; color: var(--navy); margin: 4px 0 2px; }
.kpi-v.up { color: var(--up-ink); } .kpi-v.down { color: var(--down-ink); }
.kpi-s { display: block; font-family: var(--table); font-size: 12px; color: var(--ink-faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 860px) { .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } .kpi-v { font-size: 24px; } }

.mf-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; box-shadow: 0 1px 2px rgba(20,32,32,.04), 0 8px 24px -16px rgba(0,0,128,.18); }
.mf-scroll { overflow-x: auto; }
.mf-table { width: 100%; border-collapse: collapse; font-family: var(--table); font-size: 14px; min-width: 900px; }
.mf-table th, .mf-table td { padding: 10px 9px; white-space: nowrap; }
.mf-table thead th { position: sticky; top: 0; background: #f7f8fb; color: var(--ink-soft); font-size: 11.5px; font-weight: 600; letter-spacing: .03em; text-transform: uppercase; border-bottom: 1px solid var(--line); line-height: 1.25; vertical-align: bottom; }
.mf-table thead th small { font-size: 11px; font-weight: 500; text-transform: none; letter-spacing: 0; color: var(--ink-faint); }
.mf-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.mf-table .cat { text-align: left; }
.mf-table tbody tr.item td { border-bottom: 1px solid #eef1f4; }
.mf-table tbody tr.item:hover td { background: #f5f7fc; }
.mf-table .strong { font-weight: 600; color: var(--ink); }
.mf-table .soft { color: #6b7480; }
.mf-table td.cat a { color: var(--navy); font-weight: 500; text-decoration: none; }
.mf-table td.cat a:hover { text-decoration: underline; text-decoration-color: var(--gold); text-decoration-thickness: 2px; text-underline-offset: 3px; }
.mf-table .ic { display: inline-grid; place-items: center; width: 24px; height: 24px; margin-right: 10px; border-radius: 50%; font-family: var(--display); font-size: 10px; font-weight: 700; color: #1a1a2e; background: var(--g-precious); vertical-align: middle; }
.mf-table tr.base .ic { background: var(--g-base); } .mf-table tr.lev .ic { background: var(--g-pgm); }

/* group headings and subtotals */
.mf-table tr.g-head th { text-align: left; padding: 18px 14px 8px; background: var(--surface); border-bottom: 1px solid var(--line); }
.mf-table tr.g-head .g-name { font-family: var(--display); font-size: 19px; font-weight: 700; color: var(--navy); padding-left: 12px; border-left: 4px solid var(--gold); }
.mf-table tr.g-head.base .g-name { border-left-color: #d98e5a; } .mf-table tr.g-head.lev .g-name { border-left-color: var(--navy); }
.mf-table tr.g-head .g-desc { margin-left: 12px; font-family: var(--table); font-size: 12.5px; font-weight: 400; color: var(--ink-faint); }
.mf-table tr.g-tot td { background: #f4f6fa; font-weight: 700; color: var(--navy); border-bottom: 1px solid var(--line); }

/* totals */
.mf-table tfoot tr.grand td { background: var(--navy); color: #fff; font-weight: 700; font-size: 15px; padding-top: 14px; padding-bottom: 14px; }
.mf-table tfoot .pill.up { background: rgba(18,163,131,.25); color: #b8f2e2; } .mf-table tfoot .pill.down { background: rgba(239,60,70,.28); color: #ffd1d4; }

/* change pills and share bars */
.pill { display: inline-flex; align-items: center; gap: 4px; padding: 3px 8px; border-radius: 999px; font-size: 12.5px; font-weight: 600; line-height: 1.2; }
.pill span { font-size: 8px; }
.pill.up { background: #e3f6f0; color: var(--up-ink); } .pill.down { background: #fdecee; color: var(--down-ink); } .pill.flat { background: #eef1f4; color: var(--ink-soft); }
.share { min-width: 118px; }
.share .sbar { display: inline-block; vertical-align: middle; width: 56px; height: 6px; margin-right: 8px; border-radius: 3px; background: #eceff3; overflow: hidden; }
.share .sbar span { display: block; height: 100%; border-radius: 3px; background: linear-gradient(90deg, var(--gold), #f2cf6b); }
.share .sv { display: inline-block; min-width: 44px; }
.mf-table tr.g-tot .share .sbar span { background: var(--navy); }
.mf-note { margin: 10px 2px 0; font-family: var(--table); font-size: 12.5px; color: var(--ink-faint); }

/* exchanges */
.mf-ex { min-width: 760px; }
.tag-us { display: inline-block; margin-left: 8px; padding: 1px 6px; border-radius: 4px; background: var(--navy); color: #fff; font-size: 10px; font-weight: 700; letter-spacing: .05em; vertical-align: 1px; }
.mf-ex tr.us .share .sbar span { background: var(--navy); }
.mf-table .ccy { text-align: left; }
.ccy-code { display: inline-block; min-width: 40px; padding: 2px 6px; margin-right: 8px; border-radius: 4px; background: #eef1f6; color: var(--navy); font-size: 11.5px; font-weight: 700; text-align: center; }
.ccy-name { color: #6b7480; }
.par { color: var(--ink-faint); }

/* product types */
.mf-types { margin-top: 22px; }
.mf-types h3 { font-family: var(--display); font-size: 20px; color: var(--navy); margin: 0 0 10px; }
.mf-types ul { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.pt { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.pt-code { flex: none; min-width: 64px; padding: 4px 8px; border-radius: 6px; text-align: center; font-family: var(--table); font-size: 12px; font-weight: 700; background: #eef1f6; color: var(--navy); }
.pt-name { font-size: 16px; color: var(--ink); }
.pt.sharia .pt-code { background: #006600; color: #ffc000; } .pt.ucits .pt-code { background: var(--navy); color: #fff; } .pt.digital .pt-code { background: #e0303c; color: #fff; }
@media (max-width: 860px) { .mf-types ul { grid-template-columns: 1fr 1fr; } }
@media (max-width: 520px) { .mf-types ul { grid-template-columns: 1fr; } }

/* ===== Live prices: status bar, tick flashes and bolder changes ===== */
.live-bar { position: sticky; top: 56px; z-index: 5; display: flex; align-items: center; flex-wrap: wrap; gap: 6px 14px; margin: 0 0 14px; padding: 9px 14px; border: 1px solid var(--line); border-radius: 999px; background: rgba(255,255,255,.96); backdrop-filter: blur(6px); font-family: var(--table); font-size: 13px; color: var(--ink-soft); box-shadow: 0 4px 14px -10px rgba(0,0,128,.35); }
.lv-dot { width: 10px; height: 10px; border-radius: 50%; background: #a9b4b2; flex: none; }
.lv-text { font-weight: 700; letter-spacing: .06em; text-transform: uppercase; font-size: 12px; color: var(--ink); }
.lv-time { font-variant-numeric: tabular-nums; }
.lv-moves { margin-left: auto; color: var(--navy); font-weight: 600; }
.live-bar[data-state="live"] .lv-dot { background: #12a383; box-shadow: 0 0 0 0 rgba(18,163,131,.6); }
.live-bar[data-state="live"].beat .lv-dot { animation: lvPulse 1s ease-out; }
.live-bar[data-state="live"] .lv-text { color: #06876c; }
.live-bar[data-state="retry"] .lv-dot { background: #e4b338; } .live-bar[data-state="retry"] .lv-text { color: #9a7413; }
.live-bar[data-state="paused"] .lv-dot { background: #a9b4b2; }
@keyframes lvPulse { 0% { box-shadow: 0 0 0 0 rgba(18,163,131,.65); } 100% { box-shadow: 0 0 0 9px rgba(18,163,131,0); } }
@media (max-width: 640px) { .live-bar { border-radius: 12px; top: 8px; } .lv-moves { margin-left: 0; width: 100%; } }

/* a row flashes green or red when its price moves */
.ptable tbody tr.tick-up td { animation: rowUp 1.6s ease-out; }
.ptable tbody tr.tick-down td { animation: rowDown 1.6s ease-out; }
@keyframes rowUp { 0%, 25% { background: #c9f0e3; } 100% { background: transparent; } }
@keyframes rowDown { 0%, 25% { background: #fbd3d6; } 100% { background: transparent; } }
.ptable tr.tick-up td.last, .ptable tr.tick-down td.last { animation-duration: 2.2s; }
.ptable td.last { font-weight: 700; }
.tick { display: inline-block; margin-right: 5px; font-size: 9px; vertical-align: 2px; }
.tick.up { color: var(--up-ink); } .tick.down { color: var(--down-ink); }

/* day change and % change as coloured pills */
.ptable td.chg.up, .ptable td.chg.down, .ptable td.ch.up, .ptable td.ch.down { font-weight: 700; }
.ptable td.ch.up, .ptable td.ch.down { padding-top: 0; padding-bottom: 0; }
.ptable td.ch.up span.cp, .ptable td.ch.down span.cp { display: inline-block; padding: 3px 8px; border-radius: 999px; }
.ptable td.ch.up span.cp { background: #e3f6f0; color: var(--up-ink); }
.ptable td.ch.down span.cp { background: #fdecee; color: var(--down-ink); }
@media (prefers-reduced-motion: reduce) { .ptable tbody tr.tick-up td, .ptable tbody tr.tick-down td, .live-bar.beat .lv-dot { animation: none; } }

/* the price itself turns green after a rise and red after a fall, until its next move */
.ptable td.last.p-up { color: var(--up-ink); }
.ptable td.last.p-down { color: var(--down-ink); }
