/* Visual language adapted from the Genesis FX Markets reference:
   near-black navy canvas, glass panels with inset highlight, pill controls,
   mint/green accent, light-weight large numerals with a white->grey gradient. */
:root {
  --bg: #05070D;
  --ink: #E8ECF5;
  --ink-2: rgba(232, 236, 245, .72);
  --ink-3: rgba(232, 236, 245, .48);
  --line: rgba(255, 255, 255, .08);
  --line-2: rgba(255, 255, 255, .14);
  --glass: rgba(18, 18, 18, .35);
  --glass-grad: linear-gradient(rgba(255, 255, 255, .06), rgba(255, 255, 255, .015));
  --accent: #10BC83;
  --accent-2: #00B38C;
  --mint: #CFF2E6;
  --deep: rgba(2, 27, 19, .55);
  --up: #10BC83;
  --down: #F2676B;
  --warn: #F0B65A;
  --gold: #E3C07E;
  --r-card: 20px;
  --r-ctl: 999px;
  --shadow-in: inset 0 1px 0 rgba(255, 255, 255, .12), inset 0 -1px 0 rgba(255, 255, 255, .03);
  --font: "Schibsted Grotesk", "IBM Plex Sans Arabic", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-ar: "IBM Plex Sans Arabic", "Schibsted Grotesk", system-ui, "Segoe UI", Tahoma, sans-serif;
  --gutter: clamp(16px, 4vw, 40px);
  --asst-w: 400px;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); }
body { font-family: var(--font); font-size: 15px; line-height: 1.5; -webkit-font-smoothing: antialiased; min-height: 100vh; overflow-x: hidden; }
html[lang="ar"] body { font-family: var(--font-ar); }
button, input { font: inherit; color: inherit; }
a { color: inherit; text-decoration: none; }
[hidden] { display: none !important; }
.muted { color: var(--ink-3); }
.fine { color: var(--ink-3); font-size: 12.5px; margin: 12px 0 0; }
.num { font-family: "Schibsted Grotesk", system-ui, sans-serif; font-variant-numeric: tabular-nums; letter-spacing: -.01em; unicode-bidi: isolate; direction: ltr; }
html[dir="rtl"] .num { text-align: right; }
bdi { unicode-bidi: isolate; }
:focus-visible { outline: 2px solid var(--mint); outline-offset: 2px; border-radius: 8px; }

.bg-glow { position: fixed; inset: 0; pointer-events: none; z-index: -1;
  background:
    radial-gradient(60% 40% at 50% -5%, rgba(16, 188, 131, .16), transparent 70%),
    radial-gradient(30% 25% at 90% 10%, rgba(227, 192, 126, .06), transparent 70%),
    radial-gradient(rgba(255, 255, 255, .055) 1px, transparent 1px) 0 0 / 22px 22px;
  mask-image: linear-gradient(#000, rgba(0, 0, 0, .25) 70%, transparent);
}

/* ---------- top bar ---------- */
.topbar { position: sticky; top: 0; z-index: 30; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px;
  padding: 12px var(--gutter); background: linear-gradient(var(--bg), rgba(5, 7, 13, .75)); backdrop-filter: blur(10px); }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 500; letter-spacing: .01em; }
.pillnav { display: flex; gap: 2px; padding: 4px; border-radius: 14px; background: var(--glass); background-image: var(--glass-grad);
  border: 1px solid var(--line-2); box-shadow: var(--shadow-in); }
.pillnav a { padding: 7px 16px; border-radius: var(--r-ctl); color: #C4C4C4; font-size: 14px; transition: background .2s, color .2s; }
.pillnav a:hover { color: var(--ink); }
.pillnav a[aria-current="page"] { background: rgba(255, 255, 255, .09); color: var(--ink); }
.top-actions { display: flex; justify-content: flex-end; align-items: center; gap: 8px; }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 40px; padding: 0 18px; border-radius: var(--r-ctl);
  border: 1px solid var(--line-2); background: transparent; cursor: pointer; font-size: 14px; white-space: nowrap; transition: transform .15s, background .2s, border-color .2s; }
.btn:active { transform: scale(.98); }
.btn.primary { background: linear-gradient(180deg, #F4FFFA, #CFF2E6); color: var(--bg); border-color: transparent; box-shadow: 0 0 0 1px rgba(207, 242, 230, .25), 0 8px 30px -10px rgba(16, 188, 131, .6); font-weight: 500; }
.btn.primary:hover { background: #fff; }
.btn.ghost:hover { border-color: rgba(255, 255, 255, .3); background: rgba(255, 255, 255, .04); }
.btn.sm { height: 32px; padding: 0 14px; font-size: 13px; }
.btn.lg { height: 48px; padding: 0 26px; font-size: 15px; }
.ibtn { width: 34px; height: 34px; border-radius: 10px; border: 1px solid var(--line-2); background: rgba(255, 255, 255, .03); cursor: pointer; display: inline-grid; place-items: center; font-size: 15px; }
.ibtn:hover { background: rgba(255, 255, 255, .08); }

/* ---------- badges & status ---------- */
.badge { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 12px; border-radius: var(--r-ctl); font-size: 12px;
  background: var(--deep); border: 1px solid rgba(255, 255, 255, .18); color: var(--mint); white-space: nowrap; }
.badge.sm { height: 22px; padding: 0 9px; font-size: 11px; }
.badge.demo { background: rgba(240, 182, 90, .12); border-color: rgba(240, 182, 90, .45); color: #F6CF8C; }
.badge.mint::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 10px var(--accent); }
.status-pill { display: inline-flex; align-items: center; gap: 7px; height: 30px; padding: 0 12px; border-radius: var(--r-ctl); font-size: 12.5px; border: 1px solid var(--line-2); background: rgba(255, 255, 255, .03); white-space: nowrap; }
.status-pill.sm { height: 22px; padding: 0 9px; font-size: 11.5px; }
.status-pill i { width: 8px; height: 8px; border-radius: 50%; background: var(--ink-3); }
.status-pill[data-s="live"] { color: var(--mint); border-color: rgba(16, 188, 131, .45); background: rgba(16, 188, 131, .08); }
.status-pill[data-s="live"] i { background: var(--accent); box-shadow: 0 0 0 0 rgba(16, 188, 131, .7); animation: pulse 1.8s infinite; }
.status-pill[data-s="delayed"] { color: #F6CF8C; border-color: rgba(240, 182, 90, .45); background: rgba(240, 182, 90, .08); }
.status-pill[data-s="delayed"] i { background: var(--warn); }
.status-pill[data-s="closed"] { color: var(--ink-2); }
.status-pill[data-s="closed"] i { background: #8A8A8A; }
.status-pill[data-s="reconnecting"] { color: #F7A3A6; border-color: rgba(242, 103, 107, .45); background: rgba(242, 103, 107, .08); }
.status-pill[data-s="reconnecting"] i { background: var(--down); animation: blink 1s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(16, 188, 131, .6); } 70% { box-shadow: 0 0 0 7px rgba(16, 188, 131, 0); } 100% { box-shadow: 0 0 0 0 rgba(16, 188, 131, 0); } }
@keyframes blink { 50% { opacity: .3; } }

.demo-banner { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 0 var(--gutter) 6px; padding: 8px 14px; border-radius: 14px;
  border: 1px dashed rgba(240, 182, 90, .35); color: var(--ink-2); font-size: 13px; }
.demo-ctrl .muted { white-space: nowrap; }
.demo-ctrl { display: inline-flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-inline-start: auto; }
.demo-ctrl button { height: 26px; padding: 0 10px; border-radius: var(--r-ctl); border: 1px solid var(--line-2); background: transparent; cursor: pointer; font-size: 12px; }
.demo-ctrl button[aria-pressed="true"] { background: rgba(255, 255, 255, .1); }

/* ---------- layout ---------- */
.layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px; padding: 0 var(--gutter) 24px; max-width: 1440px; margin: 0 auto; }
.layout.with-asst { grid-template-columns: minmax(0, 1fr) var(--asst-w); }
main { min-width: 0; }
.screen { animation: fadeUp .35s ease; }
@keyframes fadeUp { from { opacity: .55; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.card { position: relative; border-radius: var(--r-card); background: var(--glass); background-image: var(--glass-grad); border: 1px solid var(--line-2); box-shadow: var(--shadow-in); padding: 20px; }
.card h2 { margin: 0; font-size: 15px; font-weight: 500; color: var(--ink-2); }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }

.hero-head { text-align: center; padding: clamp(18px, 5vw, 48px) 0 clamp(16px, 3vw, 28px); }
.h-grad { margin: 14px 0 8px; font-weight: 400; font-size: clamp(30px, 5.2vw, 60px); line-height: 1.05; letter-spacing: -.02em;
  background: radial-gradient(120% 60% at 50% 50%, #fff 0%, #999 100%); -webkit-background-clip: text; background-clip: text; color: transparent; }
html[lang="ar"] .h-grad { letter-spacing: 0; line-height: 1.25; }
.status-line { margin: 0; color: var(--ink-3); font-size: 13.5px; min-height: 1.5em; }

.hero-cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.price-card { cursor: pointer; transition: border-color .2s, transform .2s; }
.price-card:hover { border-color: rgba(207, 242, 230, .35); transform: translateY(-2px); }
.price-card header { display: flex; align-items: center; gap: 10px; color: var(--ink-2); font-size: 14px; }
.sym { font-family: "Schibsted Grotesk", system-ui, sans-serif; font-size: 12px; color: var(--mint); padding: 3px 9px; border-radius: var(--r-ctl); background: var(--deep); border: 1px solid rgba(255, 255, 255, .14); }
.price-card header .badge { margin-inline-start: auto; }
.big { font-size: clamp(40px, 6.4vw, 72px); font-weight: 400; line-height: 1.05; margin: 18px 0 2px;
  background: radial-gradient(120% 70% at 30% 40%, #fff 0%, #A8ADB6 100%); -webkit-background-clip: text; background-clip: text; color: transparent; }
.big.flash-up { animation: flashUp .6s; } .big.flash-down { animation: flashDown .6s; }
@keyframes flashUp { 0% { text-shadow: 0 0 24px rgba(16, 188, 131, .9); } 100% { text-shadow: none; } }
@keyframes flashDown { 0% { text-shadow: 0 0 24px rgba(242, 103, 107, .9); } 100% { text-shadow: none; } }
.unit { color: var(--ink-3); font-size: 13px; }
.chg { margin-top: 10px; font-size: 14px; min-height: 1.5em; }
.up { color: var(--up); } .down { color: var(--down); } .flat { color: var(--ink-2); }
.meta { display: flex; flex-wrap: wrap; gap: 6px 22px; margin: 14px 0 0; padding-top: 12px; border-top: 1px solid var(--line); font-size: 12.5px; }
.meta div { display: flex; gap: 6px; } .meta dt { color: var(--ink-3); } .meta dd { margin: 0; color: var(--ink-2); }

.market-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 16px; margin-top: 16px; }
.mini { cursor: pointer; }
.mini-wrap { height: 210px; position: relative; } .mini-wrap canvas { width: 100%; height: 100%; display: block; }
.ktable { width: 100%; border-collapse: collapse; }
.ktable tr { cursor: pointer; transition: background .15s; }
.ktable tr:hover td { background: rgba(255, 255, 255, .03); }
.ktable td { padding: 13px 8px; border-bottom: 1px solid var(--line); }
.ktable tr:last-child td { border-bottom: 0; }
.ktable .k { font-size: 14px; } .ktable .k b { font-weight: 500; }
.ktable .p { text-align: end; font-size: 19px; }
.ktable .c { text-align: end; font-size: 12.5px; width: 92px; }
.cta-row { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-top: 22px; }

/* ---------- segmented controls ---------- */
.seg { display: inline-flex; padding: 3px; gap: 2px; border-radius: var(--r-ctl); border: 1px solid var(--line-2); background: rgba(255, 255, 255, .02); }
.seg button { height: 32px; padding: 0 14px; border: 0; border-radius: var(--r-ctl); background: transparent; color: #C4C4C4; cursor: pointer; font-size: 13px; white-space: nowrap; }
.seg button[aria-pressed="true"], .seg button[aria-selected="true"] { background: rgba(255, 255, 255, .1); color: var(--ink); box-shadow: var(--shadow-in); }
.seg button:disabled { opacity: .35; cursor: not-allowed; }
.seg.sm button { height: 28px; padding: 0 11px; font-size: 12.5px; }
.seg.xs button { height: 26px; padding: 0 10px; font-size: 12px; }
.seg.tabs { width: 100%; margin: 6px 0 16px; } .seg.tabs button { flex: 1; height: 40px; font-size: 15px; }
.karat-chips { display: inline-flex; flex-wrap: wrap; gap: 6px; }
.karat-chips button { height: 30px; min-width: 46px; padding: 0 12px; border-radius: var(--r-ctl); border: 1px solid var(--line-2); background: transparent; cursor: pointer; font-size: 13px; }
.karat-chips button[aria-pressed="true"] { background: var(--deep); border-color: rgba(16, 188, 131, .55); color: var(--mint); }
.karat-chips input { width: 96px; height: 30px; border-radius: var(--r-ctl); border: 1px solid var(--line-2); background: transparent; padding: 0 10px; font-size: 13px; }

/* ---------- chart ---------- */
.chart-shell { padding: 16px; display: flex; flex-direction: column; min-height: calc(100vh - 150px); }
.chart-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-start; gap: 14px; }
.ch-left { display: flex; flex-direction: column; gap: 10px; }
.ch-price { text-align: end; }
.big2 { font-size: clamp(28px, 4vw, 42px); font-weight: 400; line-height: 1.1; }
html[dir="rtl"] .ch-price .num { text-align: left; }
.ch-sub { color: var(--ink-3); font-size: 12.5px; margin-top: 4px; display: flex; gap: 6px; align-items: center; justify-content: flex-end; flex-wrap: wrap; }
.chart-tools { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; margin: 14px 0 8px; }
.tgroup { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.tlabel { font-size: 12px; color: var(--ink-3); }
.iconbtns { display: inline-flex; gap: 4px; }
.hint { margin: 0 0 6px; font-size: 12.5px; color: #F6CF8C; }
.chart-wrap { position: relative; flex: 1; min-height: 340px; border-radius: 14px; border: 1px solid var(--line); background: rgba(0, 0, 0, .25); overflow: hidden; }
.chart-wrap canvas { position: absolute; inset: 0; display: block; cursor: crosshair; }
.chart-wrap canvas[data-tool="pan"] { cursor: grab; }
.chart-wrap canvas[data-tool="range"] { cursor: col-resize; }
.chart-overlay { position: absolute; inset: 0; display: grid; place-items: center; color: var(--ink-3); font-size: 14px; pointer-events: none; }
.sel-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 12px 2px 0; min-height: 54px; }
.sel-bar .info { flex: 1; min-width: 200px; font-size: 13px; color: var(--ink-2); }
.sel-bar .info b { color: var(--ink); font-weight: 500; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 12px; color: var(--ink-2); padding-top: 6px; }
.legend span { display: inline-flex; gap: 6px; align-items: center; }
.sw { width: 14px; height: 10px; border-radius: 3px; display: inline-block; }
.sw.gap { background: repeating-linear-gradient(135deg, rgba(242, 103, 107, .5) 0 2px, rgba(242, 103, 107, .12) 2px 5px); border: 1px dashed rgba(242, 103, 107, .6); }
.sw.hist { background: repeating-linear-gradient(135deg, rgba(255, 255, 255, .25) 0 2px, rgba(255, 255, 255, .05) 2px 5px); border: 1px dashed rgba(255, 255, 255, .3); }
.chart-shell.fs, .chart-shell:fullscreen { position: fixed; inset: 0; z-index: 60; border-radius: 0; min-height: 100vh; background: var(--bg); }

/* ---------- calculator ---------- */
.calc { max-width: 860px; margin: 18px auto 0; }
.fgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 14px; margin: 12px 0; }
.field { display: flex; flex-direction: column; gap: 8px; font-size: 13px; color: var(--ink-2); }
.field input { height: 46px; border-radius: 12px; border: 1px solid var(--line-2); background: rgba(0, 0, 0, .25); padding: 0 14px; font-size: 16px; font-family: "Schibsted Grotesk", system-ui, sans-serif; }
html[dir="rtl"] .field input { text-align: right; }
.field input:focus { outline: none; border-color: rgba(16, 188, 131, .6); box-shadow: 0 0 0 3px rgba(16, 188, 131, .15); }
.field input[aria-invalid="true"] { border-color: rgba(242, 103, 107, .7); }
.errors { color: #F7A3A6; font-size: 13px; min-height: 0; }
.errors p { margin: 4px 0; }
.results { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin-top: 14px; }
.stat { border-radius: 14px; border: 1px solid var(--line); padding: 14px; background: rgba(255, 255, 255, .02); }
.stat .lbl { font-size: 12px; color: var(--ink-3); display: flex; justify-content: space-between; gap: 8px; }
.stat .val { font-size: 24px; margin-top: 4px; }
.stat .sub { font-size: 12px; color: var(--ink-3); margin-top: 2px; }
.stat.hl { border-color: rgba(207, 242, 230, .3); background: rgba(16, 188, 131, .05); }
.compare { margin-top: 16px; }
.cmp-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.cmp-sum { margin-top: 12px; padding: 14px; border-radius: 14px; border: 1px solid rgba(207, 242, 230, .25); background: rgba(16, 188, 131, .04); font-size: 14px; }
.cmp-sum .fine { margin-top: 6px; }

/* ---------- assistant ---------- */
.assistant { position: sticky; top: 72px; height: calc(100vh - 92px); display: flex; flex-direction: column; border-radius: var(--r-card);
  background: rgba(10, 13, 19, .82); background-image: var(--glass-grad); border: 1px solid var(--line-2); box-shadow: var(--shadow-in), 0 30px 80px -30px rgba(0, 0, 0, .8); backdrop-filter: blur(14px); overflow: hidden; }
.asst-head { display: flex; justify-content: space-between; align-items: center; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.asst-head h2 { margin: 0 0 2px; font-size: 16px; font-weight: 500; display: inline; margin-inline-end: 8px; }
.ctx-chip { margin: 10px 14px 0; padding: 8px 12px; border-radius: 12px; border: 1px solid var(--line); font-size: 12px; color: var(--ink-2); background: rgba(255, 255, 255, .02); }
.ctx-chip:empty { display: none; }
.asst-log { flex: 1; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 12px; }
.msg { max-width: 92%; font-size: 14px; white-space: pre-wrap; }
.msg.user { align-self: flex-end; background: rgba(255, 255, 255, .08); padding: 9px 14px; border-radius: 16px 16px 4px 16px; }
html[dir="rtl"] .msg.user { border-radius: 16px 16px 16px 4px; }
.msg.bot { align-self: flex-start; color: var(--ink); }
.msg.bot.typing { color: var(--ink-3); animation: blink 1.2s infinite; }
.acard { margin-top: 10px; border-radius: 14px; border: 1px solid var(--line-2); padding: 12px 14px; background: rgba(255, 255, 255, .025); white-space: normal; }
.acard .t { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 12px; color: var(--ink-3); }
.acard .v { font-size: 26px; margin: 6px 0 0; }
.acard .u { font-size: 12px; color: var(--ink-3); }
.acard .rows { display: grid; grid-template-columns: auto 1fr; gap: 3px 12px; font-size: 12.5px; margin-top: 8px; }
.acard .rows dt { color: var(--ink-3); } .acard .rows dd { margin: 0; text-align: end; }
.acard .btn { margin-top: 10px; height: 32px; font-size: 12.5px; }
.sugg { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 14px 8px; }
.sugg button { border: 1px solid var(--line-2); background: transparent; border-radius: var(--r-ctl); padding: 6px 12px; font-size: 12.5px; cursor: pointer; color: var(--ink-2); text-align: start; }
.sugg button:hover { color: var(--ink); border-color: rgba(255, 255, 255, .3); }
.asst-input { display: flex; gap: 8px; padding: 12px 14px calc(12px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); }
.asst-input input { flex: 1; min-width: 0; height: 44px; border-radius: var(--r-ctl); border: 1px solid var(--line-2); background: rgba(0, 0, 0, .3); padding: 0 16px; font-size: 15px; }
.asst-input input:focus { outline: none; border-color: rgba(16, 188, 131, .6); }

.foot { text-align: center; padding: 26px 0 8px; }

/* ---------- mobile ---------- */
.tabbar { display: none; }
@media (max-width: 1100px) { .layout.with-asst { grid-template-columns: minmax(0, 1fr) 360px; } }
@media (max-width: 900px) {
  .topbar { grid-template-columns: 1fr auto; padding-top: 10px; padding-bottom: 10px; }
  .pillnav, .hide-sm { display: none; }
  .layout, .layout.with-asst { grid-template-columns: minmax(0, 1fr); padding-bottom: 96px; }
  .hero-cards, .market-grid { grid-template-columns: minmax(0, 1fr); }
  .tabbar { display: grid; grid-template-columns: repeat(4, 1fr); position: fixed; inset: auto 12px calc(10px + env(safe-area-inset-bottom)) 12px; z-index: 40; padding: 6px;
    border-radius: 20px; background: rgba(14, 17, 24, .88); border: 1px solid var(--line-2); box-shadow: var(--shadow-in), 0 20px 40px -10px rgba(0, 0, 0, .7); backdrop-filter: blur(14px); }
  .tabbar a, .tabbar button { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 0; border-radius: 14px; border: 0; background: transparent; color: var(--ink-3); font-size: 11px; cursor: pointer; }
  .tabbar svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
  .tabbar [aria-current="page"] { color: var(--mint); background: rgba(255, 255, 255, .06); }
  .assistant { position: fixed; inset: auto 0 0 0; top: auto; background-color: rgba(10, 13, 19, .97); height: min(86vh, 720px); z-index: 50; border-radius: 22px 22px 0 0; animation: sheetUp .28s ease both; }
  @keyframes sheetUp { from { transform: translateY(30px); opacity: 0; } to { transform: none; opacity: 1; } }
  .chart-shell { min-height: calc(100vh - 170px); padding: 12px; }
  .chart-wrap { min-height: 300px; }
  .ch-price { text-align: start; width: 100%; }
  .ch-sub { justify-content: flex-start; }
  html[dir="rtl"] .ch-price .num { text-align: right; }
  .chart-tools { gap: 8px; }
  .demo-banner { font-size: 12px; flex-wrap: nowrap; overflow-x: auto; padding: 6px 10px; scrollbar-width: none; }
  .demo-banner > span:nth-child(2) { display: none; } /* badge stays; long note hidden on phones */
  .demo-ctrl { margin-inline-start: 0; flex-wrap: nowrap; }
  .chart-tools { flex-wrap: nowrap; overflow-x: auto; margin: 10px -12px 6px; padding: 0 12px 4px; scrollbar-width: none; }
  .chart-tools .tgroup { flex-wrap: nowrap; flex: none; }
  .chart-tools .tlabel { display: none; }
  .ch-left { flex-direction: row; flex-wrap: nowrap; overflow-x: auto; width: 100%; scrollbar-width: none; }
  .ch-left > * { flex: none; }
  .karat-chips { flex-wrap: nowrap; }
  .ch-price { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; }
  .ch-price .ch-sub { margin-top: 0; }
  .chart-wrap { min-height: 52vh; }
  .ktable .p { font-size: 17px; }
}
@media (max-width: 480px) {
  .status-pill b { max-width: 88px; overflow: hidden; text-overflow: ellipsis; }
  .seg.sm button { padding: 0 9px; }
  .cmp-grid { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
