:root {
  --bg: #eef2f7;
  --bg-soft: #f6f8fc;
  --panel: #fdfefe;
  --panel-2: #f7f9fd;
  --border: rgba(28, 56, 117, .12);
  --border-strong: rgba(28, 56, 117, .18);
  --text: #17306b;
  --text-soft: #2e4b88;
  --muted: rgba(23, 48, 107, .68);
  --good: #1f9d63;
  --bad: #d04d5d;
  --accent: #5f88e8;
  --accent-2: #dce7ff;
  --shadow: 0 12px 35px rgba(39, 70, 135, .10);

  --header-h: 70px;
  --footer-h: 46px;
  --gap: 14px;
  --radius: 18px;
  --vh: 1vh;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* {
  box-sizing: border-box
}

html,
body {
  min-height: 100%
}

body {
  margin: 0;
  background:
    radial-gradient(1200px 500px at 80% -10%, rgba(138, 170, 238, .22), transparent 60%),
    radial-gradient(900px 400px at 10% 0%, rgba(217, 229, 255, .55), transparent 52%),
    linear-gradient(180deg, #f4f7fc 0%, #edf2f8 100%);
  color: var(--text);
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial, "Apple Color Emoji", "Segoe UI Emoji";
  overflow: auto;
}

a {
  color: inherit
}

.app {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding-top: var(--safe-top);
  padding-bottom: var(--safe-bottom);
}

header {
  min-height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  background: rgba(248, 251, 255, .86);
  backdrop-filter: blur(10px);
  position: sticky;
  top: 0;
  z-index: 50;
}

.cookieBanner {
  position: fixed;
  left: 16px;
  right: 16px;
  bottom: 16px;
  z-index: 9999;
  display: none;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
  padding: 18px;
  border-radius: 18px;
  background: rgba(17, 24, 39, 0.96);
  border: 1px solid rgba(255, 255, 255, .08);
  box-shadow: 0 18px 48px rgba(0, 0, 0, .35);
  color: #eef3ff;
  backdrop-filter: blur(12px);
}

.cookieBanner.show {
  display: flex;
}

.cookieText {
  min-width: 0;
  font-size: 14px;
  line-height: 1.6;
  color: rgba(238, 243, 255, .92);
}

.cookieText strong {
  color: #fff;
}

.cookieActions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  flex: 0 0 auto;
}

.cookieBtn {
  border: 1px solid rgba(255, 255, 255, .1);
  color: #fff;
  padding: 10px 14px;
  border-radius: 999px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
  background: rgba(255, 255, 255, .06);
}

.cookieBtn.primary {
  background: linear-gradient(135deg, #2563eb, #60a5fa);
  border-color: transparent;
}

.cookieBtn.secondary {
  background: rgba(255, 255, 255, .06);
}

.cookieLink {
  color: #93c5fd;
  text-decoration: underline;
}

.cookiePrefs {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: rgba(0, 0, 0, .55);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.cookiePrefs.show {
  display: flex;
}

.cookiePrefsCard {
  width: min(560px, 100%);
  border-radius: 20px;
  background: #0f172a;
  border: 1px solid rgba(255, 255, 255, .08);
  box-shadow: 0 24px 60px rgba(0, 0, 0, .45);
  padding: 24px;
  color: #eef3ff;
}

.cookiePrefsCard h3 {
  margin: 0 0 8px;
  font-size: 24px;
  color: #fff;
}

.cookiePrefsCard p {
  margin: 0 0 16px;
  color: rgba(238, 243, 255, .82);
  line-height: 1.6;
  font-size: 14px;
}

.cookieRow {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 0;
  border-top: 1px solid rgba(255, 255, 255, .08);
}

.cookieRow:first-of-type {
  border-top: 0;
}

.cookieRowTitle {
  font-size: 15px;
  font-weight: 800;
  color: #fff;
  margin-bottom: 4px;
}

.cookieRowDesc {
  font-size: 13px;
  color: rgba(238, 243, 255, .76);
  line-height: 1.5;
}

.cookieSwitchWrap {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
}

.cookieSwitch {
  width: 46px;
  height: 28px;
  border-radius: 999px;
  background: #334155;
  position: relative;
  border: 1px solid rgba(255, 255, 255, .08);
}

.cookieSwitch::after {
  content: "";
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  position: absolute;
  top: 3px;
  left: 3px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .25);
  transition: .2s ease;
}

.cookieSwitch.on {
  background: linear-gradient(135deg, #2563eb, #60a5fa);
}

.cookieSwitch.on::after {
  left: 21px;
}

.cookieSwitch.disabled {
  opacity: .65;
}

.cookieFooter {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 18px;
  flex-wrap: wrap;
}

.legalLinks {
  margin-top: 10px;
}

.legalLinks a {
  text-decoration: underline;
}

@media (max-width: 760px) {
  .cookieBanner {
    left: 10px;
    right: 10px;
    bottom: 10px;
    padding: 14px;
    flex-direction: column;
    align-items: flex-start;
  }

  .cookieActions {
    width: 100%;
  }

  .cookieActions .cookieBtn {
    flex: 1 1 auto;
    justify-content: center;
  }

  .cookiePrefsCard {
    padding: 18px;
    border-radius: 18px;
  }
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.brand-logo {
  width: 46px;
  height: 46px;
  object-fit: contain;
  border-radius: 12px;
  background: #ffffffaa;
  padding: 4px;
  box-shadow: 0 6px 18px rgba(28, 56, 117, .08);
}

.brand-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.brand-title {
  font-weight: 900;
  font-size: 24px;
  line-height: 1;
  letter-spacing: -0.3px;
  color: #16306d;
}

.sub {
  color: rgba(23, 48, 107, .82);
  font-size: 12px;
  white-space: nowrap;
  font-weight: 600;
}

main {
  flex: 1 1 auto;
  padding: var(--gap);
  display: flex;
  flex-direction: column;
  gap: var(--gap);
}

/* HERO */
.hero {
  width: 100%;
  display: grid;
  grid-template-columns: 1.35fr .85fr;
  gap: 18px;
  padding: 24px;
  border: 1px solid var(--border);
  border-radius: 24px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, .94), rgba(245, 249, 255, .88)),
    linear-gradient(180deg, rgba(255, 255, 255, .5), rgba(255, 255, 255, .12));
  box-shadow: var(--shadow);
}

.hero-copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
}

.hero-logo-wrap {
  margin-bottom: 10px;
}

.hero-logo {
  width: 220px;
  max-width: 100%;
  height: auto;
  object-fit: contain;
}

.hero-badge {
  display: inline-flex;
  align-self: flex-start;
  padding: 7px 12px;
  border-radius: 999px;
  border: 1px solid rgba(28, 56, 117, .14);
  background: #edf3ff;
  color: #234280;
  font-size: 12px;
  font-weight: 800;
}

.hero-copy h1 {
  margin: 14px 0 12px;
  font-size: 48px;
  line-height: 1.05;
  letter-spacing: -1px;
  max-width: 860px;
  color: #183672;
}

.hero-copy p {
  margin: 0;
  color: var(--text-soft);
  font-size: 22px;
  line-height: 1.45;
  max-width: 840px;
}

.hero-actions {
  display: flex;
  gap: 12px;
  margin-top: 22px;
  flex-wrap: wrap;
}

.hero-disclaimer {
  margin-top: 12px;
  color: rgba(23, 48, 107, .58);
  font-size: 13px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 50px;
  padding: 0 18px;
  border-radius: 14px;
  text-decoration: none;
  font-weight: 900;
  border: 1px solid transparent;
  transition: transform .12s ease, box-shadow .12s ease, background .12s ease;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn-primary {
  background: linear-gradient(180deg, #6f98f4, #5d83dd);
  color: #fff;
  box-shadow: 0 10px 20px rgba(95, 136, 232, .25);
}

.btn-secondary {
  background: #ffffff;
  color: var(--text);
  border-color: rgba(28, 56, 117, .15);
}

.hero-proof {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  align-content: center;
}

.proof-card {
  border: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(255, 255, 255, .95), rgba(246, 249, 255, .92));
  border-radius: 18px;
  padding: 16px;
  min-height: 92px;
  box-shadow: 0 10px 24px rgba(39, 70, 135, .06);
}

.proof-card span {
  display: block;
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 8px;
}

.proof-card strong {
  font-size: 42px;
  font-weight: 900;
  line-height: 1;
  color: #16306d;
}

/* INFO GRID */
.infoGrid {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

.infoCard {
  border: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(255, 255, 255, .94), rgba(248, 250, 255, .88));
  border-radius: 18px;
  padding: 18px;
  box-shadow: 0 8px 20px rgba(39, 70, 135, .05);
}

.infoCard h3 {
  margin: 0 0 8px 0;
  font-size: 20px;
  color: #183672;
}

.infoCard p {
  margin: 0;
  color: var(--text-soft);
  font-size: 15px;
  line-height: 1.5;
}

/* DASHBOARD */
.dashboardGrid {
  display: grid;
  grid-template-columns: 1.05fr 1fr 1.1fr;
  gap: var(--gap);
  align-items: start;
}

.panel {
  background: linear-gradient(180deg, rgba(255, 255, 255, .95), rgba(247, 250, 255, .90));
  border: 1px solid var(--border);
  border-radius: 20px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 10px 24px rgba(39, 70, 135, .06);
}

.panel .ph {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: rgba(238, 243, 252, .60);
}

.panel .ph h2 {
  margin: 0;
  font-size: 14px;
  letter-spacing: .3px;
  text-transform: uppercase;
  color: #19376f;
}

.panel .body {
  padding: 12px 14px;
  min-height: 0;
  overflow: auto;
}

.dashboardGrid .panel {
  min-height: 560px;
}

.dashboardGrid .panel .body {
  max-height: 560px;
  overflow: auto;
}

/* FEED */
.feed .item {
  border: 1px solid rgba(28, 56, 117, .10);
  background: rgba(255, 255, 255, .72);
  border-radius: 14px;
  padding: 12px;
  margin-bottom: 10px;
}

.feed .top {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: flex-start;
  font-size: 13px;
}

.tag {
  font-size: 11px;
  padding: 4px 9px;
  border-radius: 999px;
  border: 1px solid rgba(28, 56, 117, .12);
  color: #284987;
  white-space: nowrap;
  background: #f8fbff;
  font-weight: 800;
}

.tag.buy {
  border-color: rgba(31, 157, 99, .22);
  color: #117a4d;
  background: #eefbf5
}

.tag.sell {
  border-color: rgba(208, 77, 93, .22);
  color: #b73f4d;
  background: #fff1f3
}

.tag.signal {
  border-color: rgba(95, 136, 232, .22);
  color: #3159b7;
  background: #edf3ff
}

.meta {
  margin-top: 8px;
  color: var(--text-soft);
  font-size: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px;
}

.meta b {
  color: #19376f;
  font-weight: 800
}

/* KPIS */
.kpis {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 12px;
}

.kpi {
  border: 1px solid rgba(28, 56, 117, .10);
  background: rgba(255, 255, 255, .78);
  border-radius: 14px;
  padding: 12px;
}

.kpi .lbl {
  font-size: 11px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .2px
}

.kpi .val {
  font-size: 22px;
  font-weight: 900;
  margin-top: 5px
}

.kpi .val.good {
  color: var(--good)
}

.kpi .val.bad {
  color: var(--bad)
}

.chartBox {
  border: 1px solid rgba(28, 56, 117, .10);
  background: rgba(255, 255, 255, .78);
  border-radius: 14px;
  padding: 12px;
  min-height: 220px;
}

.chartBox canvas {
  width: 100%;
  height: 220px;
}

/* RIGHT */
.rightBody {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.embedWrap {
  width: 100%;
  height: 520px;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid rgba(28, 56, 117, .10);
  background: #fff;
}

.embedWrap iframe {
  width: 100%;
  height: 100%;
  border: 0;
  background: #fff;
}

.supportBox {
  border: 1px solid rgba(28, 56, 117, .10);
  background: rgba(255, 255, 255, .78);
  border-radius: 14px;
  padding: 14px;
}

.supportTitle {
  font-size: 14px;
  font-weight: 900;
  margin-bottom: 4px;
  color: #19376f;
}

.supportText {
  color: var(--text-soft);
  font-size: 13px;
  line-height: 1.45;
}

/* FIT */
.fitGrid {
  width: 100%;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.fitCard {
  border: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(255, 255, 255, .94), rgba(248, 250, 255, .88));
  border-radius: 18px;
  padding: 18px;
  box-shadow: 0 8px 20px rgba(39, 70, 135, .05);
}

.fitCard h3 {
  margin: 0 0 8px 0;
  font-size: 20px;
  color: #183672;
}

.fitCard p {
  margin: 0;
  color: var(--text-soft);
  line-height: 1.5;
  font-size: 15px;
}

/* FINAL CTA */
.finalCta {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 22px;
  border: 1px solid rgba(95, 136, 232, .20);
  background: linear-gradient(180deg, #f7faff, #edf4ff);
  border-radius: 22px;
  box-shadow: var(--shadow);
}

.finalCta h3 {
  margin: 0 0 6px 0;
  font-size: 28px;
  color: #183672;
}

.finalCta p {
  margin: 0;
  color: var(--text-soft);
  font-size: 16px;
  line-height: 1.55;
  max-width: 760px;
}

/* FOOTER */
footer {
  min-height: var(--footer-h);
  border-top: 1px solid var(--border);
  background: rgba(248, 251, 255, .90);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  padding: 0 14px;
  gap: 10px;
}

.newsLabel {
  font-weight: 900;
  opacity: .85;
  white-space: nowrap;
  font-size: 12px;
  letter-spacing: .2px;
  text-transform: uppercase;
  color: #17306b;
}

.ticker {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 13px;
  color: var(--text-soft);
}

.ticker .item {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ticker .src {
  opacity: .7;
  margin-left: 8px;
}

/* QR FLOAT DESKTOP */
.qr-float {
  position: fixed;
  right: 16px;
  bottom: 18px;
  width: 255px;
  z-index: 80;
  border-radius: 20px;
  overflow: hidden;
  border: 1px solid rgba(28, 56, 117, .14);
  box-shadow: 0 14px 35px rgba(39, 70, 135, .16);
  background: rgba(255, 255, 255, .98);
  backdrop-filter: blur(10px);
}

.qr-badge {
  position: absolute;
  left: 10px;
  top: 10px;
  z-index: 2;
  font-size: 11px;
  padding: 4px 8px;
  border-radius: 999px;
  border: 1px solid rgba(28, 56, 117, .10);
  color: #1d3d7a;
  background: rgba(255, 255, 255, .88);
  backdrop-filter: blur(8px);
  font-weight: 800;
}

.qr-hide {
  position: absolute;
  right: 10px;
  top: 10px;
  z-index: 3;
  width: 28px;
  height: 28px;
  border-radius: 10px;
  border: 1px solid rgba(28, 56, 117, .12);
  background: rgba(255, 255, 255, .94);
  color: #1c3974;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  line-height: 1;
}

.qr-float.is-hidden {
  display: none;
}

.qr-tab {
  position: fixed;
  right: 16px;
  bottom: 120px;
  z-index: 81;
  display: none;
  border: 1px solid rgba(28, 56, 117, .12);
  background: rgba(255, 255, 255, .97);
  color: #1c3974;
  padding: 10px 12px;
  border-radius: 12px 0 0 12px;
  cursor: pointer;
  font-weight: 900;
  letter-spacing: .2px;
  box-shadow: 0 10px 26px rgba(39, 70, 135, .16);
}

.qr-tab.is-on {
  display: block;
}

/* QR WRAPPERS */
.qr-frame-wrap {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fff;
}

#donationDesktopBody {
  padding: 44px 10px 10px 10px;
  min-height: 300px;
}

#donationDesktopBody iframe,
#donationDesktopBody a {
  width: 100%;
  height: 260px;
  border: 0;
  display: block;
  border-radius: 14px;
  overflow: hidden;
}

#donationDesktopBody img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  border-radius: 14px;
  background: #fff;
}

#qrCardMobile {
  display: none;
}

.qrMobileBodyWrap {
  padding: 14px !important;
}

#donationMobileBody {
  width: 100%;
  min-height: 320px;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid rgba(28, 56, 117, .10);
  background: #fff;
}

#donationMobileBody iframe,
#donationMobileBody a {
  width: 100%;
  height: 320px;
  border: 0;
  display: block;
  border-radius: 16px;
  overflow: hidden;
}

#donationMobileBody img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  background: #fff;
}

/* MODAL */
.modalOverlay {
  position: fixed;
  inset: 0;
  z-index: 5000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 18px;
  background: rgba(95, 120, 170, .22);
  backdrop-filter: blur(8px);
}

.modalOverlay.is-open {
  display: flex;
}

.modalCard {
  width: min(560px, 100%);
  max-height: min(78vh, 760px);
  overflow: auto;
  border-radius: 22px;
  border: 1px solid rgba(28, 56, 117, .12);
  background: rgba(255, 255, 255, .96);
  box-shadow: 0 18px 70px rgba(39, 70, 135, .20);
  padding: 16px 16px 14px 16px;
  position: relative;
}

.modalTitle {
  margin: 0 0 10px 0;
  font-size: 17px;
  letter-spacing: .2px;
  color: #183672;
}

.modalBody {
  color: var(--text-soft);
  font-size: 14px;
  line-height: 1.5;
}

.modalBody p {
  margin: 0 0 10px 0;
}

.modalBody ul {
  margin: 0 0 10px 18px;
  padding: 0;
}

.modalBody li {
  margin: 0 0 6px 0;
}

.modalBody .muted {
  color: var(--muted);
}

.modalActions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 10px;
}

.modalBtn {
  border: 1px solid rgba(28, 56, 117, .12);
  background: #edf3ff;
  color: #183672;
  padding: 10px 12px;
  border-radius: 12px;
  cursor: pointer;
  font-weight: 900;
  letter-spacing: .2px;
}

.modalBtn:hover {
  background: #e5eeff;
}

.modalClose {
  position: absolute;
  right: 10px;
  top: 10px;
  width: 34px;
  height: 34px;
  border-radius: 12px;
  border: 1px solid rgba(28, 56, 117, .12);
  background: rgba(255, 255, 255, .94);
  color: #183672;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  line-height: 1;
}

/* DESKTOP SCROLLBAR */
@media (min-width: 761px) {
  .panel .body {
    scrollbar-width: thin;
    scrollbar-color: rgba(95, 136, 232, .55) rgba(225, 233, 248, .9);
  }

  .panel .body::-webkit-scrollbar {
    width: 10px;
    height: 10px;
  }

  .panel .body::-webkit-scrollbar-track {
    background: rgba(225, 233, 248, .9);
    border-left: 1px solid rgba(28, 56, 117, .06);
    border-radius: 999px;
  }

  .panel .body::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg,
        rgba(95, 136, 232, .78),
        rgba(59, 106, 204, .65));
    border: 2px solid rgba(240, 245, 255, .85);
    border-radius: 999px;
  }

  .panel .body::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg,
        rgba(95, 136, 232, .95),
        rgba(59, 106, 204, .80));
  }
}

/* MOBILE */
@media (max-width: 760px) {
  header {
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-start;
    gap: 8px;
    padding-top: 10px;
    padding-bottom: 10px;
  }

  .brand-logo {
    width: 40px;
    height: 40px;
  }

  .brand-title {
    font-size: 20px;
  }

  #marketStatus {
    white-space: normal;
    line-height: 1.2;
  }

  #lastUpdate {
    width: 100%;
    white-space: normal;
    text-align: left;
    font-size: 11px;
    opacity: .8;
  }

  .hero {
    grid-template-columns: 1fr;
    padding: 18px;
    border-radius: 20px;
  }

  .hero-logo {
    width: 170px;
  }

  .hero-copy h1 {
    font-size: 34px;
  }

  .hero-copy p {
    font-size: 17px;
  }

  .infoGrid {
    grid-template-columns: 1fr;
  }

  .dashboardGrid {
    grid-template-columns: 1fr;
  }

  .dashboardGrid .panel {
    min-height: auto;
  }

  .dashboardGrid .panel .body {
    max-height: none;
    overflow: visible;
  }

  .fitGrid {
    grid-template-columns: 1fr;
  }

  .finalCta {
    flex-direction: column;
    align-items: flex-start;
  }

  .finalCta h3 {
    font-size: 24px;
  }

  .embedWrap {
    height: min(52vh, 380px);
  }

  .qr-float,
  .qr-tab {
    display: none !important;
  }

  #qrCardMobile {
    display: flex;
  }
}