@import url("https://fonts.googleapis.com/css2?family=Cormorant+Garamond:wght@600;700&family=Playfair+Display:wght@600;700&family=Inter:wght@400;500;600;700;800&display=swap");

/* ============================================================
   WHITE + MAROON THEME
   Variable names are kept as-is (they are referenced by inline
   styles inside the JS). "--gold*" now map to the maroon accent
   for in-app usage; real gold tones are used in the header only.
   ============================================================ */
:root {
  --maroon: #6e1027;
  --maroon-dk: #4f0a1b;
  --maroon-br: #8c1d37;
  --maroon-tint: #f8eef0;
  --hd-gold: #e7bd68;
  --hd-gold-lt: #f6dc9d;

  --ink: #f4eff0;
  --ink2: #faf7f7;
  --card: #ffffff;
  --elev: #ffffff;
  --line: #ebe1e3;
  --line-soft: #f2ebec;
  --gold: #6e1027;
  --gold-br: #7d1530;
  --gold-dk: #4f0a1b;
  --gold-mu: #8e5160;
  --buy: #1d9a5f;
  --sell: #d2303b;
  --txt: #272023;
  --txt2: #655b5f;
  --txt3: #978d91;
  --shadow: 0 2px 10px rgba(78, 10, 27, .07), 0 1px 2px rgba(78, 10, 27, .05);
  --shadow-lg: 0 6px 22px rgba(78, 10, 27, .12);
  --r: 14px;
  --pad: 13px;
  --ease: cubic-bezier(.22, .61, .36, 1);
  --sat: env(safe-area-inset-top, 0px);
  --sab: env(safe-area-inset-bottom, 0px);
}

* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html { height: 100%; }

html, body {
  background: var(--ink);
  color: var(--txt);
  font-family: Inter, "Segoe UI", Roboto, system-ui, sans-serif;
  font-size: 14px;
  overscroll-behavior: none;
}

body {
  background: var(--ink);
  display: flex;
  flex-direction: column;
  min-height: 100%;
}

img, svg { display: block; }
a { color: inherit; text-decoration: none; }
input, select, textarea, button { font: inherit; color: inherit; }
.num { font-variant-numeric: tabular-nums; font-feature-settings: "tnum" 1; }
.mono { font-variant-numeric: tabular-nums; }
.hide { display: none !important; }

::-webkit-scrollbar { width: 0; height: 0; }

/* Android app: WebView starts below the status bar, so no extra top safe-area padding */
html.android { --sat: 0px; }

/* ---------- Header (maroon) ---------- */
.top {
  padding-top: var(--sat); padding-bottom: 22px; position: relative; z-index: 5;
  background: linear-gradient(180deg, var(--maroon-dk) 0%, #620d22 55%, var(--maroon) 100%);
  border-radius: 0 0 30px 30px;
  box-shadow: 0 6px 18px rgba(78, 10, 27, .18);
}

.bell {
  position: absolute; right: 10px; top: calc(var(--sat) + 10px);
  width: 34px; height: 34px; display: grid; place-items: center;
  border-radius: 50%; color: var(--hd-gold);
  transition: transform .25s var(--ease), background .25s;
}
.bell:active { transform: scale(.88); background: rgba(255, 255, 255, .12); }
.bell svg { animation: swing 5s ease-in-out infinite; transform-origin: 50% 15%; }
@keyframes swing { 0%, 82%, 100% { transform: rotate(0) } 86% { transform: rotate(13deg) } 90% { transform: rotate(-11deg) } 94% { transform: rotate(6deg) } }

/* Original logo / brand styling (unchanged from the previous theme) */
/* Tight logo row: the logos set the row height themselves (no forced square box, minimal padding),
   so no empty band appears above/below the logos on real devices. */
.brand { display: flex; flex-direction: row; align-items: center; justify-content: center; flex-wrap: nowrap; gap: 2vw; padding: 4px 0 6px; width: 100%; max-width: 100%; box-sizing: border-box; overflow: hidden; line-height: 0; }
.brandtext { display: flex; flex-direction: row; align-items: baseline; gap: 10px; overflow: visible; }
.crest {
  display: block; height: 52px; width: auto; max-width: 72px; flex: 0 1 auto; object-fit: contain;
  filter: drop-shadow(0 0 12px rgba(212, 167, 44, .28));
  animation: crestIn .9s var(--ease) both;
}
@keyframes crestIn { from { opacity: 0; transform: translateY(-8px) scale(.82) } to { opacity: 1; transform: none } }

.brandlogo {
  display: block; height: auto; width: auto; max-width: 60%; max-height: 52px; flex: 0 1 auto; object-fit: contain;
  animation: rise .7s .08s var(--ease) both;
}

.wordmark {
  font-family: "Great Vibes", "Cormorant Garamond", Georgia, cursive;
  font-weight: 400; font-size: 56px; line-height: 1.2; letter-spacing: 1px;
  padding: 0 6px 0 10px; overflow: visible;
  background: linear-gradient(180deg, #fbebb4, #d4a72c 52%, #a97d1f);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: rise .7s .08s var(--ease) both;
}
.submark {
  font-family: "Playfair Display", Georgia, serif;
  font-size: 26px; font-weight: 700; letter-spacing: .5px; line-height: 1;
  background: linear-gradient(180deg, #fbebb4, #d4a72c 52%, #a97d1f);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: rise .7s .16s var(--ease) both;
}
.strap { font-size: 7.5px; font-weight: 600; letter-spacing: 2.6px; color: rgba(169, 134, 58, .78); animation: rise .7s .24s var(--ease) both; }
@keyframes rise { from { opacity: 0; transform: translateY(7px) } to { opacity: 1; transform: none } }

.livebar {
  margin: 0 var(--pad); height: 30px; border-radius: 20px;
  background: rgba(255, 255, 255, .08);
  border: 1px solid rgba(231, 189, 104, .28);
  display: flex; align-items: center; gap: 8px; padding: 0 12px;
  font-size: 10px; font-weight: 600; letter-spacing: 1.3px; color: var(--hd-gold-lt);
  animation: rise .6s .3s var(--ease) both;
}
.dot { width: 6px; height: 6px; border-radius: 50%; background: #3fd08f; flex: 0 0 auto; animation: pulse 1.8s infinite; }
.dot.warn { background: #f0b43a; } .dot.off { background: #b9a9ad; animation: none; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(63, 208, 143, .55) } 70% { box-shadow: 0 0 0 7px rgba(63, 208, 143, 0) } 100% { box-shadow: 0 0 0 0 rgba(63, 208, 143, 0) } }
.livebar span { flex: 1; min-width: 0; text-align: center; }
/* Ticker text scrolling inside the header bar */
.livebar span.scroll { overflow: hidden; white-space: nowrap; text-align: left; }
.livebar .tk { display: inline-block; padding-left: 100%; font-style: normal; letter-spacing: .6px; animation: tk 22s linear infinite;font-size: 14px; }
.livebar .tk p, .livebar .tk div { display: inline; margin: 0; }
@keyframes tk { from { transform: translateX(0) } to { transform: translateX(-100%) } }

.marquee { overflow: hidden; margin: 0 var(--pad) 9px; border-radius: 10px; border: 1px solid var(--line); background: var(--maroon-tint); }
.marquee > div { display: inline-block; white-space: nowrap; padding: 6px 0; font-size: 11px; font-weight: 500; color: var(--maroon); animation: slide 22s linear infinite; }
.marquee p { display: inline; margin: 0; }
@keyframes slide { from { transform: translateX(100vw) } to { transform: translateX(-100%) } }

/* main overlaps the curved header like the reference */
main { flex: 1; position: relative; z-index: 6; margin-top: -16px; padding: 0 var(--pad) 10px; animation: viewIn .42s var(--ease) both; }
@keyframes viewIn { from { opacity: 0; transform: translateY(14px) scale(.994) } to { opacity: 1; transform: none } }
body.leaving main, body.leaving .top { animation: viewOut .2s var(--ease) both; }
@keyframes viewOut { to { opacity: 0; transform: translateY(-10px) } }

.stag > * { animation: rise .5s var(--ease) both; }
.stag > *:nth-child(1) { animation-delay: .04s } .stag > *:nth-child(2) { animation-delay: .08s }
.stag > *:nth-child(3) { animation-delay: .12s } .stag > *:nth-child(4) { animation-delay: .16s }
.stag > *:nth-child(5) { animation-delay: .2s } .stag > *:nth-child(6) { animation-delay: .24s }
.stag > *:nth-child(7) { animation-delay: .28s } .stag > *:nth-child(8) { animation-delay: .32s }
.stag > *:nth-child(n+9) { animation-delay: .36s }

.ptitle {
  margin: 0 0 11px; padding: 11px 14px; border-radius: var(--r);
  border: 0; background: linear-gradient(100deg, var(--maroon-dk), var(--maroon) 60%, var(--maroon-br));
  font-size: 11px; font-weight: 700; letter-spacing: 2.2px; color: var(--hd-gold);
  display: flex; align-items: center; gap: 9px;
  box-shadow: var(--shadow-lg);
  animation: rise .5s var(--ease) both;
}
.ptitle svg { color: var(--hd-gold); }
.cap { font-size: 8.5px; font-weight: 700; letter-spacing: 1.8px; color: var(--maroon); padding: 7px 14px; background: var(--maroon-tint); border-bottom: 1px solid var(--line); }

/* ---------- Top summary cards: one white card with dividers ---------- */
.tcards {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; margin-bottom: 12px;
  background: var(--card); border-radius: var(--r); padding: 6px; box-shadow: var(--shadow-lg);
}
.tcard {
  position: relative; border: 0; border-radius: 10px; background: transparent;
  padding: 8px 4px 7px; text-align: center; min-height: 64px;
  transition: background .45s var(--ease), border-color .45s var(--ease), transform .2s var(--ease);
  animation: rise .55s var(--ease) both;
}
.tcard + .tcard:before { content: ""; position: absolute; left: 0; top: 18%; bottom: 18%; width: 1px; background: var(--line); }
.tcard:nth-child(2) { animation-delay: .07s } .tcard:nth-child(3) { animation-delay: .14s }
.tcard:active { transform: scale(.97); }
.tcard b { display: block; font-size: 12px; font-weight: 500; letter-spacing: 1px; color: var(--txt3); margin-bottom: 4px; }
.tcard u { display: block; text-decoration: none; font-size: 19px; font-weight: 700; letter-spacing: -.2px; color: var(--txt); }
.tcard u.mu { color: var(--txt3); }
.tcard i { display: block; font-style: normal; font-size: 9px; font-weight: 600; margin-top: 3px; line-height: 1.5; white-space: nowrap; }
.tcard i em { font-style: normal; }
.up { background: rgba(29, 154, 95, .1) !important; border-color: rgba(29, 154, 95, .4) !important; }
.down { background: rgba(210, 48, 59, .09) !important; border-color: rgba(210, 48, 59, .4) !important; }
.g { color: var(--buy) } .r { color: var(--sell) } .mu { color: var(--txt3) } .gold { color: var(--maroon) }

/* ---------- Tabs ---------- */
.tabs {
  position: relative; display: flex; background: var(--card); border: 1px solid var(--line);
  border-radius: 12px; padding: 3px; margin-bottom: 12px; height: 40px;
  box-shadow: var(--shadow);
  animation: rise .55s .1s var(--ease) both;
}
.tabs .pill {
  position: absolute; top: 3px; bottom: 3px; border-radius: 9px;
  background: linear-gradient(180deg, var(--maroon-br), var(--maroon) 55%, var(--maroon-dk));
  box-shadow: 0 3px 10px rgba(110, 16, 39, .28);
  transition: left .34s var(--ease), width .34s var(--ease);
}
.tabs button {
  position: relative; flex: 1; background: none; border: 0; z-index: 1;
  font-size: 10.5px; font-weight: 700; letter-spacing: 1.1px; color: var(--txt2);
  transition: color .3s var(--ease); border-radius: 9px; cursor: pointer;
}
.tabs button.on { color: var(--hd-gold-lt); }

/* ---------- Rate table ---------- */
.rt { border: 0; border-radius: var(--r); overflow: hidden; background: var(--card); box-shadow: var(--shadow-lg); animation: rise .55s .16s var(--ease) both; }
.rt + .rt { margin-top: 12px; }
.rth { display: flex; padding: 12px 14px; background: linear-gradient(180deg, #7a1430, var(--maroon)); border-bottom: 0; }
.rth b { font-size: 10px; font-weight: 700; letter-spacing: 1.4px; color: var(--hd-gold); }
.rth b:first-child { flex: 50 } .rth b:nth-child(2) { flex: 25; text-align: center } .rth b:last-child { flex: 25; text-align: center }

.row { display: flex; align-items: center; padding: 9px 14px; min-height: 58px; background: var(--card); border-bottom: 1px solid var(--line); transition: background .45s var(--ease); cursor: pointer; }
.row:last-child { border-bottom: 0 }
#frt .row { cursor: default }
.row.up { background: rgba(29, 154, 95, .08) !important }
.row.down { background: rgba(210, 48, 59, .07) !important }
.row .p { flex: 50; display: flex; align-items: center; gap: 8px; min-width: 0 }
.row .p div { min-width: 0 }
.row .p strong { display: block; font-size: 12px; font-weight: 700; letter-spacing: .2px; color: var(--txt); white-space: nowrap; overflow: hidden; text-overflow: ellipsis }
.row .p small { display: block; font-size: 7.5px; font-weight: 500; letter-spacing: 1.2px; color: var(--txt3); margin-top: 2px }
.row .v { flex: 25; text-align: center }
.row .v u { display: block; text-decoration: none; font-size: 16px; font-weight: 700; letter-spacing: -.3px; color: var(--txt); transition: color .3s var(--ease) }
.row.up .v u { color: var(--buy) }
.row.down .v u { color: var(--sell) }
.row .v s { display: block; text-decoration: none; font-size: 8px; color: var(--txt3); margin-top: 2px }
#frt .row .v s.g { color: var(--sell); font-weight: 600 }
#frt .row .v s.r { color: var(--buy); font-weight: 600 }
.tcard i em.g { color: var(--sell) }
.tcard i em.r { color: var(--buy) }
.row .np { font-size: 7.5px; color: var(--maroon); letter-spacing: .6px }
.empty { padding: 26px 12px; text-align: center; font-size: 10px; letter-spacing: 1.6px; color: var(--txt3) }
.mi { width: 18px; height: 18px; flex: 0 0 auto; border-radius: 50%; display: grid; place-items: center; }
.mi svg { width: 18px; height: 18px }
.mi.au { color: #c99628; animation: shine 3.4s ease-in-out infinite }
.mi.ag { color: #8f99a3; animation: shine 3.4s .6s ease-in-out infinite }
@keyframes shine { 0%, 100% { filter: brightness(1) } 50% { filter: brightness(1.2) drop-shadow(0 0 3px currentColor) } }

/* ---------- Trust strip ---------- */
.trust { display: flex; margin: 12px 0; border: 0; border-radius: var(--r); overflow: hidden; background: var(--card); box-shadow: var(--shadow); animation: rise .5s .2s var(--ease) both }
.trust div { flex: 1; padding: 9px 4px; text-align: center; border-right: 1px solid var(--line) }
.trust div:last-child { border-right: 0 }
.trust b { display: flex; align-items: center; justify-content: center; gap: 4px; font-size: 9.5px; color: var(--maroon); letter-spacing: .8px }
.trust b svg { width: 11px; height: 11px }
.trust span { display: block; font-size: 7px; letter-spacing: 1.2px; color: var(--txt3); margin-top: 2px }
.trust div:nth-child(2) b svg { animation: pulse2 1.6s infinite }
@keyframes pulse2 { 0%, 100% { opacity: .5; transform: scale(.9) } 50% { opacity: 1; transform: scale(1.12) } }

/* ---------- Call / WhatsApp ---------- */
.cta { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin: 16px 0 20px; animation: rise .5s .26s var(--ease) both }
.cta a { display: flex; align-items: center; gap: 10px; padding: 12px 12px; border-radius: 12px; border: 0; background: var(--card); box-shadow: var(--shadow); transition: transform .2s var(--ease), box-shadow .3s }
.cta a:active { transform: scale(.96) }
.cta a.wa { border-color: transparent; background: var(--card) }
.cta em { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; flex: 0 0 auto; background: linear-gradient(180deg, var(--maroon-br), var(--maroon-dk)); color: var(--hd-gold-lt); box-shadow: 0 3px 8px rgba(110, 16, 39, .25) }
.cta a.wa em { background: linear-gradient(180deg, var(--maroon-br), var(--maroon-dk)); color: var(--hd-gold-lt); animation: bob 2.6s ease-in-out infinite }
.cta a em svg { animation: ring 4s ease-in-out infinite }
.cta a.wa em svg { animation: none }
@keyframes ring { 0%, 88%, 100% { transform: rotate(0) } 91% { transform: rotate(-14deg) } 94% { transform: rotate(12deg) } 97% { transform: rotate(-7deg) } }
@keyframes bob { 0%, 100% { transform: translateY(0) } 50% { transform: translateY(-2.5px) } }
.cta b { display: block; font-size: 11px; font-weight: 700; letter-spacing: .8px; color: var(--txt) }
.cta small { display: block; font-size: 8.5px; color: var(--txt2); margin-top: 1px }

.stamp { text-align: center; font-size: 8px; letter-spacing: 1.3px; color: var(--txt3); padding: 12px 0 4px }
.stamp.stale { color: var(--sell) }

/* ---------- Bottom nav ---------- */
.nav {
  position: sticky; bottom: 0; z-index: 20; display: flex;
  /* Only a small part of the device's bottom safe area (home indicator / gesture bar) is kept,
     so there is no large empty strip under the footer icons */
  padding: 7px 2px max(7px, calc(var(--sab) - 18px));
  /* Solid background instead of backdrop-filter blur: the blur re-renders on every live-rate
     update and made scrolling / native dropdowns lag on Android WebView */
  background: #fff;
  border-top: 1px solid var(--line);
  box-shadow: 0 -4px 16px rgba(78, 10, 27, .06);
}
.nav a { flex: 1; display: grid; justify-items: center; gap: 3px; padding: 3px 0; color: var(--txt3); position: relative; transition: color .18s var(--ease) }
.nav a span { font-size: 7.5px; font-weight: 600; letter-spacing: .9px }
.nav a svg { transition: transform .18s var(--ease) }
.nav a:active svg { transform: scale(.82) }
.nav a.on { color: var(--maroon) }
.nav a.on span { font-weight: 700 }
.nav a.on svg { animation: pop .35s var(--ease) }
.nav a.on:after { content: ""; position: absolute; bottom: -3px; width: 16px; height: 2px; border-radius: 2px; background: var(--maroon); animation: grow .3s var(--ease) both }
@keyframes pop { 0% { transform: scale(.8) } 60% { transform: scale(1.16) } 100% { transform: scale(1) } }
@keyframes grow { from { width: 0; opacity: 0 } to { width: 16px; opacity: 1 } }

/* ---------- Side menu sheet ---------- */
.sheet { position: fixed; inset: 0; z-index: 60; background: rgba(40, 8, 16, .45); opacity: 0; pointer-events: none; transition: opacity .28s var(--ease) }
.sheet.on { opacity: 1; pointer-events: auto; backdrop-filter: blur(6px) }
.sheet > div {
  position: absolute; inset: 0; overflow-y: auto; padding: calc(var(--sat) + 14px) 12px calc(var(--sab) + 20px);
  background: linear-gradient(180deg, var(--maroon-tint), var(--ink) 30%);
  transform: translateX(-100%); transition: transform .34s var(--ease);
}
.sheet.on > div { transform: none }
.sheet h4 { font-size: 9px; letter-spacing: 2px; color: var(--maroon); margin: 16px 2px 8px; font-weight: 700 }
.mgrid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px }
.mgrid a {
  display: grid; justify-items: center; gap: 6px; padding: 12px 4px; border-radius: 12px;
  border: 1px solid var(--line); background: var(--card);
  font-size: 7.5px; font-weight: 600; letter-spacing: .7px; text-align: center; color: var(--txt2);
  box-shadow: var(--shadow);
  transition: transform .2s var(--ease), border-color .25s, color .25s;
  animation: rise .4s var(--ease) both;
}
.mgrid a svg { color: var(--maroon) }
.mgrid a:active { transform: scale(.94); border-color: var(--maroon); color: var(--maroon) }
.sclose { display: flex; align-items: center; justify-content: space-between }
.sheetlogo { height: auto; width: auto; max-height: 40px; max-width: 70%; object-fit: contain; }
.sheet-brand { display: flex; align-items: baseline; gap: 8px; padding: 0; animation: none; }
.sheet-brand .wordmark { font-size: 34px; line-height: 1.1; padding: 0 2px 0 4px; letter-spacing: .5px; animation: none;
  background: none; -webkit-background-clip: initial; background-clip: initial; color: #6e1027; }
.sheet-brand .submark { font-size: 17px; letter-spacing: .5px; animation: none;
  background: none; -webkit-background-clip: initial; background-clip: initial; color: #6e1027; }
.xbtn { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 50%; border: 1px solid var(--line); background: var(--card); color: var(--maroon); transition: transform .25s var(--ease) }
.xbtn:active { transform: rotate(90deg) scale(.9) }

/* ---------- Modal ---------- */
.modal { position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; padding: 24px; background: rgba(40, 8, 16, .45); opacity: 0; pointer-events: none; transition: opacity .26s var(--ease) }
.modal.on { opacity: 1; pointer-events: auto; backdrop-filter: blur(5px) }
.modal > div {
  width: 100%; max-width: 330px; border-radius: 16px; border: 0; border-top: 4px solid var(--maroon);
  background: var(--card); padding: 18px 16px 16px; text-align: center;
  transform: translateY(18px) scale(.94); transition: transform .34s var(--ease);
  box-shadow: 0 18px 50px rgba(40, 8, 16, .28);
}
.modal.on > div { transform: none }
.modal h3 { font-family: "Playfair Display", "Cormorant Garamond", Georgia, serif; font-size: 19px; color: var(--maroon); letter-spacing: 1.2px; margin-bottom: 8px }
.modal .body { font-size: 12px; color: var(--txt2); line-height: 1.6 }
.modal .body p { margin: 0 0 6px }
.modal .acts { display: flex; gap: 8px; margin-top: 14px }
.modal .acts button { flex: 1 }

/* ---------- Buttons ---------- */
.btn {
  display: flex; align-items: center; justify-content: center; gap: 7px; width: 100%;
  padding: 12px 14px; border: 0; border-radius: 11px; font-size: 12px; font-weight: 700; letter-spacing: 1.4px;
  background: linear-gradient(180deg, var(--maroon-br), var(--maroon) 55%, var(--maroon-dk)); color: #fff;
  box-shadow: 0 4px 14px rgba(110, 16, 39, .25);
  transition: transform .18s var(--ease), filter .2s; cursor: pointer;
}
.btn:active { transform: scale(.97); filter: brightness(.93) }
.btn.ghost { background: var(--card); border: 1px solid var(--maroon); color: var(--maroon); box-shadow: none }
.btn.buy { background: linear-gradient(180deg, #28b571, #158a52); color: #fff; box-shadow: 0 4px 14px rgba(29, 154, 95, .25) }
.btn.sell { background: linear-gradient(180deg, #e24a54, #b8232e); color: #fff; box-shadow: 0 4px 14px rgba(210, 48, 59, .25) }
.btn.sm { padding: 8px 11px; font-size: 10px; border-radius: 9px }
.btn[disabled] { opacity: .5 }

/* ---------- Forms ---------- */
.fld { margin-bottom: 12px; animation: rise .45s var(--ease) both }
.fld label { display: block; font-size: 8.5px; font-weight: 700; letter-spacing: 1.6px; color: var(--gold-mu); margin-bottom: 5px }
.fld input, .fld select, .fld textarea {
  width: 100%; padding: 11px 12px; border-radius: 10px; background: var(--card); color: var(--txt);
  border: 1px solid #e2d6d9; font-size: 14px; transition: border-color .25s, box-shadow .25s;
}
.fld input::placeholder, .fld textarea::placeholder { color: #b3a8ac }
.fld input:focus, .fld select:focus, .fld textarea:focus { outline: 0; border-color: var(--maroon); box-shadow: 0 0 0 3px rgba(110, 16, 39, .1) }
.fld input[readonly] { color: var(--txt2); background: var(--ink2) }
.fld textarea { resize: none; min-height: 62px }
.fld select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--maroon) 50%), linear-gradient(135deg, var(--maroon) 50%, transparent 50%); background-position: calc(100% - 17px) 50%, calc(100% - 12px) 50%; background-size: 5px 5px, 5px 5px; background-repeat: no-repeat }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 9px }

.panel { border: 0; border-radius: var(--r); background: var(--card); box-shadow: var(--shadow); padding: 14px; margin-bottom: 10px; animation: rise .5s var(--ease) both }
.panel h5 { font-size: 9px; letter-spacing: 1.8px; color: var(--maroon); margin-bottom: 9px; font-weight: 700 }

.seg { display: flex; gap: 7px; margin-bottom: 11px; animation: rise .45s var(--ease) both }
.seg button, .seg a { flex: 1; padding: 9px; border-radius: 10px; border: 1px solid var(--line); background: var(--card); font-size: 10px; font-weight: 700; letter-spacing: 1.2px; color: var(--txt2); text-align: center; transition: all .26s var(--ease); cursor: pointer }
.seg button.on, .seg a.on { background: linear-gradient(180deg, var(--maroon-br), var(--maroon-dk)); color: var(--hd-gold-lt); border-color: var(--maroon); transform: translateY(-1px); box-shadow: 0 4px 12px rgba(110, 16, 39, .22) }
.seg button:active, .seg a:active { transform: scale(.96) }

.ba { display: flex; border: 0; border-radius: var(--r); overflow: hidden; margin-bottom: 11px; background: var(--card); box-shadow: var(--shadow) }
.ba div { flex: 1; padding: 11px 8px; text-align: center }
.ba div + div { border-left: 1px solid var(--line) }
.ba b { display: block; font-size: 8.5px; letter-spacing: 1.6px; color: var(--gold-mu); margin-bottom: 4px }
.badge { display: flex; align-items: center; justify-content: center; gap: 8px; margin-top: 11px; padding-top: 10px; border-top: 1px solid var(--line) }
.badge b { font-size: 15px; font-weight: 700; letter-spacing: .4px }
.badge small { font-size: 9px; letter-spacing: 1.2px }
.ba u { text-decoration: none; font-size: 24px; font-weight: 800 }
.card { border: 0; border-radius: var(--r); background: var(--card); box-shadow: var(--shadow); padding: 12px 13px; margin-bottom: 9px; animation: rise .5s var(--ease) both; transition: transform .2s var(--ease), border-color .25s }
.card:active { transform: scale(.985) }
.card.clk { cursor: pointer }
.card .hd { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; color: var(--maroon) }
.card .hd strong { flex: 1; font-size: 12.5px; font-weight: 700; color: var(--txt) }
.ln { display: flex; align-items: center; gap: 6px; justify-content: space-between; font-size: 10.5px; color: var(--txt2); padding: 3px 0 }
.ln b { color: var(--txt); font-weight: 600 }
.qty { display: flex; gap: 7px; align-items: center }
.qty input { text-align: center }
.qty .ico { width: 38px; height: 40px; flex: 0 0 auto }
.tag { font-size: 8px; font-weight: 800; letter-spacing: 1.2px; padding: 3px 7px; border-radius: 20px }
.tag.b { background: rgba(29, 154, 95, .1); color: var(--buy); border: 1px solid rgba(29, 154, 95, .35) }
.tag.s { background: rgba(210, 48, 59, .08); color: var(--sell); border: 1px solid rgba(210, 48, 59, .35) }
.tag.p { background: var(--maroon-tint); color: var(--maroon); border: 1px solid #e6cfd5 }
.card .ft { display: flex; align-items: center; gap: 9px; margin-top: 8px; padding-top: 7px; border-top: 1px solid var(--line); font-size: 8.5px; color: var(--txt3); letter-spacing: .8px }
.card .ft > :last-child { margin-left: auto }
.ico { width: 28px; height: 28px; display: grid; place-items: center; border-radius: 9px; border: 1px solid var(--line); background: var(--maroon-tint); color: var(--maroon); transition: transform .2s var(--ease); cursor: pointer }
.ico:active { transform: scale(.88) }
input[type=checkbox] { width: 17px; height: 17px; accent-color: var(--maroon) }

.kv { border: 0; border-radius: var(--r); overflow: hidden; box-shadow: var(--shadow); animation: rise .5s var(--ease) both }
.kv div { display: flex; padding: 11px 13px; font-size: 11.5px; border-bottom: 1px solid var(--line); background: var(--card) }
.kv div:nth-child(odd) { background: #fcf9f9 }
.kv div:last-child { border-bottom: 0 }
.kv b { flex: 1; font-weight: 600; letter-spacing: 1px; color: var(--gold-mu); font-size: 9.5px; text-transform: uppercase; align-self: center }
.kv span { font-weight: 700; text-align: right; color: var(--txt) }

.htm { font-size: 12px; line-height: 1.65; color: var(--txt2); padding: 4px 2px 24px; animation: rise .5s var(--ease) both; overflow-wrap: break-word; word-break: break-word; }
.htm * { max-width: 100% !important; color: inherit !important; background: transparent !important; font-family: inherit !important }
.htm img { display: block; width: auto !important; height: auto !important; max-width: 90% !important; max-height: 90px !important; object-fit: contain; margin: 8px auto; border: 0 !important }
.htm table { width: 100% !important; max-width: 100% !important; border-collapse: collapse; table-layout: fixed; }
.htm td, .htm th { padding: 6px 7px; border: 1px solid var(--line); font-size: 11px !important }
.htm a { color: var(--maroon) !important }
.htm strong, .htm b { color: var(--txt) !important }

.spin { display: grid; place-items: center; padding: 34px 0 }
.spin i { width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--line); border-top-color: var(--maroon); animation: spin .8s linear infinite }
@keyframes spin { to { transform: rotate(360deg) } }

.gauge { display: grid; place-items: center; margin: 6px 0 12px }
.gauge svg { transform: rotate(-90deg) }
.gauge circle { fill: none; stroke-width: 9; stroke-linecap: round }
.gauge .bg { stroke: #f0e5e8 }
.gauge .fg { stroke: var(--maroon); transition: stroke-dashoffset 1.1s var(--ease) }
.gauge .lbl { position: absolute; text-align: center }
.gauge b { font-size: 22px; font-weight: 800; color: var(--maroon) }
.gauge span { display: block; font-size: 8px; letter-spacing: 1.4px; color: var(--txt3) }

.snack {
  position: fixed; left: 12px; right: 12px; bottom: calc(74px + max(0px, calc(var(--sab) - 18px))); z-index: 50;
  border: 0; border-left: 4px solid var(--maroon); border-radius: 12px; padding: 10px 34px 10px 12px;
  background: var(--card); font-size: 11px; color: var(--txt2);
  box-shadow: 0 12px 32px rgba(40, 8, 16, .2);
  transform: translateY(calc(100% + 90px)); transition: transform .42s var(--ease);
}
.snack.on { transform: none }
.snack .x { position: absolute; right: 6px; top: 6px; width: 22px; height: 22px; display: grid; place-items: center; color: var(--txt3) }
.snack p { margin: 0 }

.chart { position: relative; border: 0; border-radius: var(--r); background: var(--card); box-shadow: var(--shadow); padding: 6px; animation: rise .5s var(--ease) both }
.chart .scale { position: absolute; inset: 8px 9px; display: flex; flex-direction: column; justify-content: space-between; pointer-events: none; font-size: 8px; color: var(--txt3); text-align: right }
.chart svg { width: 100%; height: 250px }
.chart .ax { stroke: #efe7e9; stroke-width: 1; shape-rendering: crispEdges }
.chart .cu { stroke: var(--buy) } .chart .cd { stroke: var(--sell) }

/* ---------- Responsive ---------- */
@media (max-width: 359px) {
  :root { --pad: 10px }
  .tcard u { font-size: 17px } .row .v u { font-size: 14.5px }
  .wordmark { font-size: 29px } .crest { height: 44px; max-width: 56px } .brandlogo { max-height: 44px }
}
@media (min-width: 420px) {
  .tcard u { font-size: 21px } .row .v u { font-size: 17px }
}
@media (min-width: 768px) {
  /* iPad / desktop: keep content at a comfortable reading width */
  main { width: 100%; max-width: 760px; margin-left: auto; margin-right: auto }
  .livebar { max-width: 734px; margin-left: auto; margin-right: auto }
  .marquee { width: calc(100% - 2 * var(--pad)); max-width: 734px; margin-left: auto; margin-right: auto }
  .nav { justify-content: center }
  .nav a { max-width: 152px }
  .sheet > div { right: auto; width: 420px; max-width: 100% }
}
@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .01ms !important; transition-duration: .01ms !important }
}

/* Bank details page: center the bank symbol and the bank details content */
[data-page="Bank_details"] .ptitle { justify-content: center; }
[data-page="Bank_details"] .htm { text-align: center; }
[data-page="Bank_details"] .htm table { margin-left: auto; margin-right: auto; }
[data-page="Bank_details"] .htm td,
[data-page="Bank_details"] .htm th { text-align: center; }
