body {
  background: #101625;
}
body:has(.css-ifkflmnfjk.active) {
  overflow: hidden;
}
main.main-content-width {
    width: 100%;
    max-width: 1350px;
    margin-left: auto !important;
    margin-right: auto !important;
    flex: 0 1 1350px;
    box-sizing: border-box;
    justify-content: center;
}
.css-ujflofkfj section{
    margin-bottom: 20px !important;
}
.topbar .company_detail .name {
  margin-left: 45px;
  margin-top: -45px;
  color: white;
}
#backtestStreamingResults{
    border: 1px solid #03a9f4ba !important;
    background: #121d2f !important;
}
#backtestStreamingResults .mt-3.grid.grid-cols-3.gap-2{
    border-bottom: 1px solid #80808042 !important;
    padding-bottom: 10px !important;
}
.topbar {
  background: #101625;
  border: 1px solid #8080802b;
}
.Css-olpfoWWW.upgrage button {
  min-width: 130px;
  background: rgb(219 66 64);
  position: relative;
  overflow: hidden;
  font-size: 13px;
}
.css-ddkflfoER {
  color: #bdbdbd;
}
.css-opflkTYDDD a {
  color: #a7a7a7;
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
}
.css-TYrrurkloE {
  color: #bdbdbd;
}
.css-ufjfklopdd {
  margin-top: 70px;
  /* max-width: 1350px; */
  display: flex;
  justify-content: center;
}

/* ============================================================
   BACKTEST RESULT NAVIGATION
   DESKTOP
   ============================================================ */

.backtest-desktop-tabs {
  display: flex;

  align-items: center;

  gap: 4px;

  width: fit-content;

  padding: 4px;

  border: 1px solid #263449;

  border-radius: 10px;

  background: #020617;

  margin-bottom: 5px;
}

.backtest-desktop-tab {
  min-height: 35px;

  padding: 0 14px;

  border: 0;

  border-radius: 8px;

  background: transparent;

  color: #94a3b8;

  font-size: 11px;

  font-weight: 500;

  cursor: pointer;

  transition: background 0.18s ease, color 0.18s ease, transform 0.12s ease;
}

.backtest-desktop-tab:hover {
  color: #ffffff;
}

.backtest-desktop-tab.active {
  background: #2563eb;

  color: #ffffff;

  font-weight: 700;
}

.backtest-desktop-tab:active {
  transform: scale(0.97);
}

/* Mobile navigation is hidden on desktop */

.mobile-result-tabs {
  display: none !important;
}

.css-vnifklpfyhmn {
  min-width: 1200px;
  box-shadow: 0px 3px 6px 1px rgb(255 255 255 / 4%);
  background: #131e33;
  color: white;
  padding: 10px 15px;
  border-radius: 5px;
  max-width: 1350px;
}
.css-ujflmfnf {
  display: flex;
  gap: 30px;
  /* border-bottom: 1px solid #80808026; */
  padding: 12px 5px;
  /* margin-bottom: 10px; */
  flex-direction: row-reverse;
  justify-content: space-between;
  align-items: center;
}
.css-oflfphnmjf {
  display: flex;
  width: 100%;
  justify-content: space-between;
}
.css-ikflpofhnmjf {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-direction: row;
}
.css-iffmklpfyhmn {
  display: flex;
  gap: 5px;
  flex-direction: column;
}
.css-ifklopeee .css-ifklppeegg {
  display: flex;
  flex-direction: column;
  text-align: center;
  width: 27%;
  gap: 3px;
}
.css-bikflpofhnmjf {
  font-size: 28px;
  background: #ffffff0d;
  border-radius: 50%;
  width: 60px;
  height: 60px;
  cursor: pointer;
  border-top: 2px solid #ff3535;
  border-right: 2px solid #cddc39;
  border-bottom: 2px solid #58cbff;
  border-left: 2px solid #ff8532;
  color: #ffffffc2;
  box-shadow: 0px 0px 6px 5px rgb(86 189 211 / 12%);
}
.css-bikflpofhnmjf:hover,
.css-fvddflkfopfo:hover,
.css-ddvuflkfopfo:hover {
  transition: transform 0.3s ease, opacity 0.3s ease;
  transform: translate(1px, -2px);
}
.css-yhfccmfkf {
  position: fixed;
  height: 100%;
  width: 100%;
  display: none;
  align-items: center;
  background: #000000;
  z-index: 10000000;
  justify-content: center;
  left: 0;
  top: 0;
}
.css-yhfccmfkf.active {
  display: flex;
}

.css-vbhfcflmfkf {
  display: flex;
  justify-content: center;
  flex-direction: column;
  text-align: center;
  align-items: center;
}
.css-vbhfcflmfkf span {
  font-size: 14px;
  font-family: system-ui;
  opacity: 0.7;
  margin-top: -8px;
}
.css-iflfokff {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.css-vbhfcflmfkf span.subtitle {
  font-size: 12px;
}
.css-vbhfcflmfkf span.title {
  font-weight: 500;
}
.css-yhfcflmfkf {
  width: 25%;
}
.css-tfflkgopff:not(.active):hover {
  background: #ffffff17;
}
body:has(.css-yhfccmfkf.active) {
  overflow: hidden !important;
}
.css-mgifklpfyhmn {
  display: flex;
  flex-direction: row;
  gap: 18px;
  align-items: center;
}
.css-bifklpfyhmn {
  font-weight: 600;
  font-size: 14px;
  font-family: system-ui;
}
.css-ifklpfyhmn {
  display: flex;
  gap: 20px;
  align-items: start;
  /* flex-direction: column; */
}
.css-mnddlkmod {
  display: grid;
  gap: 5px;
}
.css-rddlkmod {
  font-size: 13px;
  opacity: 0.8;
  font-family: system-ui;
}
.css-oflkopfkjmf,
.css-ifkflopbmn {
  padding: 5px 8px;
  border-radius: 5px;
  border: 1px solid #8080805c;
  max-width: 80px;
  outline: none;
  font-size: 15px;
}
.css-oflkopfkjmf.capital {
  max-width: 120px;
}
.Poor {
  color: #ff5722;
  background: #ff000017;
}
.Moderate {
  color: #ffc107;
  background: #ffc10714;
}
.Good {
  color: #cddc39;
  background: #ffc10714;
}
.Strong {
  color: #79cd18;
  background: #8bc34a1f;
}
.css-plfofkmgg {
  display: none;
}
.css-plfofkmgg.active {
  display: block;
}
.css-ikflfmkW i {
  margin-top: 3px;
}
body:has(.css-plfofkmgg.active) .css-ikflfmkW i {
  transition: transform 0.2s ease, opacity 0.2s ease;
  transform: rotate(180deg);
}

.css-fbnhflpfkoee {
  display: flex;
  gap: 35px;
  position: relative;
  overflow-y: auto;
  max-width: 1450px;
  scrollbar-width: none;
  padding: 8px 5px;
  justify-content: space-between;
}
.css-bmefflpfkoee {
  padding: 15px 12px;
  border-radius: 8px;
  min-width: 365px;
  box-shadow: 0px 1px 3px 1px rgb(190 232 255 / 30%);
  height: fit-content;
  color: #edededcf;
}
.css-ffujflfmjfk {
  display: flex;
  align-items: center;
  background: #7dff7d05;
  margin: 8px 0px;
  padding: 5px;
  border-radius: 5px;
  justify-content: center;
}
.css-olfkpfujkvi {
  font-size: 13px;
  opacity: 0.7;
  font-family: system-ui;
  font-weight: 500;
}
.css-fujflfmjfk {
  opacity: 0.5;
  font-size: 14px;
}
.css-mfflpfkoee {
  font-size: 17px;
  font-weight: 500;
  border-bottom: 1px solid #8080800d;
  padding-bottom: 10px;
  margin-bottom: 10px;
}

.css-bfflpfkoee {
  display: flex;
  justify-content: space-between;
  gap: 25px;
  align-items: center;
  padding-bottom: 12px;
  border-bottom: 1px solid #80808024;
}
.css-ffflpfkoee {
  display: flex;
  align-items: center;
  flex-direction: column;
  gap: 0px;
}
.css-olkopfbf {
  font-family: system-ui;
  font-size: 12px;
  opacity: 0.7;
}
.css-olkopffvbf {
  font-weight: 500;
  font-size: 14px;
  font-family: system-ui;
}
.css-oflfkpofkd .css-olkopffvbf {
  color: #ffffffde;
  opacity: 0.9;
}
.css-olkopfbfbnf {
  display: flex;
  flex-direction: column;
  align-items: end;
  gap: 3px;
}
.css-olkopfbf {
  font-size: 13px;
}
.css-fflpfkoee {
  display: flex;
  border-radius: 5px;
  padding: 1px;
}
.css-tfflkgopff {
  background: #ffffff00;
  border: none;
  border-radius: 3px;
  padding: 3px 8px;
  font-family: system-ui;
  outline: none;
  cursor: pointer;
  font-size: 12px;
}
.css-tfflkgopff.active {
  background: #cd491f;
  color: white;
}
.css-ifklprgnff {
  display: flex;
  gap: 25px;
  padding: 12px 0;
  border-bottom: 1px solid #80808024;
}
.css-olfkpfujki {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-top: 8px;
}
.css-olfkpffbujki {
  font-size: 18px;
  font-weight: 500;
  font-family: "Roboto";
}
.css-olfkpffbujki.profit{
  color: #4caf50;
}
.css-olfkpffbujki.loss{
  color: #e37754;
}
.css-oflfkpofkd {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.css-oflfkpofkd.active {
  animation: jflkRT 0.8s ease-out forwards;
}
body:has(.css-oflfkpofkd.active) .css-ddflkfopfo {
  margin-top: 25px;
}
body:has(.css-oflfkpofkd.active) .css-fujflfmjfk {
  transition: transform 0.2s ease, opacity 0.2s ease;
  transform: rotate(180deg);
}

@keyframes jflkRT {
  0% {
    height: 0%;
  }
  50% {
    height: 15%;
  }
  100% {
    height: auto;
    overflow: auto;
  }
}

.css-ifklopeee {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  padding-top: 10px;
}
.css-ddflkfopfo {
  margin-top: 20px;
  display: flex;
  gap: 10px;
  align-items: center;
  flex-direction: column;
}
.css-fvddflkfopfo {
  padding: 10px;
  min-width: 180px;
  background: #e1e1e10f;
  color: #edededd1;
  border: 1px solid #adadad40;
  border-radius: 5px;
  cursor: pointer;
  outline: none;
  font-family: system-ui;
  font-size: 14px;
  width: 100%;
  background: linear-gradient(135deg, #1b263b 0%, #111827 100%);
  border: 1px solid rgba(59, 130, 246, 0.25);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
  color: #f3f4f6;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.3px;
  border-radius: 8px;
  padding: 12px 16px;
}
.css-fvddflkfopfo i{
  padding-right: 3px;
}
.css-ddvuflkfopfo {
  padding: 8px;
  width: 100%;
  min-width: 150px;
  background: transparent;
  color: #a5a5a5c9;
  border: 1px solid #80808026;
  border-radius: 5px;
  cursor: pointer;
  outline: none;
  font-family: system-ui;
  font-size: 14px;
}
.css-fbmflpfkoee {
  display: grid;
  gap: 5px;
  opacity: 0.85;
}
.css-yfhflkfpof {
  position: sticky;
  right: -5px;
  display: flex;
  align-items: center;
  padding: 0 3px;
  box-shadow: -6px 0px 3px 0px rgb(0 0 0 / 5%);
  background: #ffffff;
  justify-content: center;
}
.css-tyfhflkfpof {
  font-size: 20px;
  background: none;
  border: none;
  cursor: pointer;
}
.css-ikflopeeev {
  display: flex;
  justify-content: end;
  gap: 8px;
  padding: 5px 0;
  margin-top: 5px;
}
.css-ufjfloofnm {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 15px;
}
.css-ufjfloyfnm {
  display: flex;
  justify-content: space-between;
  align-items: end;
  margin-bottom: 10px;
  padding: 0 0 0 5px;
}
.css-ujlfkmnfjk {
  display: flex;
  gap: 12px;
  align-items: center;
}
.css-ufjffloofnm {
  display: flex;
  gap: 0px;
  opacity: 0.8;
}
.css-ikflfmkf {
  padding: 6px 10px;
  cursor: pointer;
  background: none;
  outline: none;
  color: white;
  border: none;
  display: none;
}
.css-ikflfmkf:hover {
  background: #8080801c;
  border-radius: 50%;
}
.css-ufklfmnfj {
  position: absolute;
  background: #0e1f3f;
  height: calc(100% - 30px);
  width: 8px;
  top: 15px;
  box-shadow: -5px 1px 3px 0px rgb(12 12 12 / 50%);
  opacity: 0;
}
.css-ufklfmnfj.left {
  left: 0;
}
.css-ufklfmnfj.right {
  right: 0;
}
.css-ufklfmnfj.active {
  opacity: 1;
}
.css-olfkfmjfr {
  font-size: 17px;
  background: #8080801a;
  color: #4db6ac;
  border-radius: 50%;
  width: 45px;
  height: 45px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.css-olfkfmjfr.up .css-flfkfmjfr {
  color: #4caf50;
}
.css-olfkfmjfr.down .css-flfkfmjfr {
  color: #ff9800;
}
.css-volfkfmjfr {
  color: #f5f5f5 !important;
}
.css-ifkflobv.mystrategy .css-olfkfmjfr .css-flfkfmjfr {
  color: #4fc3f7;
}
.css-volfkfmjfr {
  display: flex;
  flex-direction: column;
}
.css-ufjflofofnm {
  font-size: 20px;
  font-family: system-ui;
  font-weight: 600;
}
.css-fufjfloofnm {
  font-size: 14px;
  font-family: system-ui;
  opacity: 0.75;
}
.css-ifkflobv {
  padding: 5px;
  border-top: 1px solid #80808014;
  margin-top: 0px;
  padding-top: 12px;
  padding-bottom: 20px;
  overflow: hidden;
  height: 35px;
  display: none;
}
.css-ifkflobv.active {
  overflow: auto;
  height: auto;
  display: block;
}
.css-tfhflkmfn {
  display: flex;
  justify-content: center;
}
.css-tfhflkmfn {
  display: flex;
  flex-direction: column;
  justify-content: center;
  text-align: center;
  align-items: center;
  gap: 8px;
}
.css-mgifklpfyhmn .css-bifklpfyhmn {
  margin-top: 12px;
}
.css-ftfhflkmfn {
  font-size: 14px;
  opacity: 0.7;
}
.css-tvfhflkmfn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}
.css-ufjfloofnmcs {
  display: flex;
  flex-direction: row;
  gap: 3px;
  margin-bottom: 15px;
  justify-content: space-between;
  align-items: center;
}
.css-bvfthmfvcc {
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.css-fthmfvcc {
  background: none;
  border: none;
  font-size: 18px;
  cursor: pointer;
  outline: none;
}

.css-ifkflmnfjk {
  position: fixed;
  top: 0;
  z-index: 100000;
  width: 100%;
  height: 100%;
  left: 0;
  display: flex;
  justify-content: end;
  /* background: #000000d1; */
  backdrop-filter: blur(5px);
  opacity: 0;
  pointer-events: none;
}
.css-yhlkofikk {
  border: 1px solid #03a9f4ba !important;
}
.css-ifkflmnfjk.active {
  opacity: 1;
  pointer-events: auto;
}
.css-yhlmfk {
  transition: transform 0.2s ease, opacity 0.2s ease;
  transform: translateX(100%);
}
.css-ifkflmnfjk.active .css-yhlmfk {
  transform: translateX(0%);
}
.css-thrlmrjki {
  min-width: calc(100% - 10px);
  overflow-y: auto;
}
.css-kffjffhf {
  padding: 8px 12px !important;
}

.css-ifkflmnfjk input[type="date"],
.css-ifkflmnfjk input[type="time"] {
  color-scheme: dark;
}
select option[value="BUY"] {
  color: #6ee7b7;
  background-color: #111827;
}

select option[value="SELL"] {
  color: #fdba74;
  background-color: #111827;
}
.css-yhfjff {
  width: fit-content;
  margin-bottom: 5px;
}

/* =========================
   CHART CARD
   ========================= */

.backtest-chart-card {
  width: 100%;
  height: 430px;
  box-sizing: border-box;
  background: #101a2e;
  border: 1px solid #263b60;
  border-radius: 14px;
  overflow: hidden;
  position: relative;
}

/* =========================
   TOOLBAR
   ========================= */

.backtest-chart-toolbar {
  height: 66px;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 10px;
  padding: 0 14px;
  box-sizing: border-box;
  border-bottom: 1px solid #26334d;
  background: #101a2e;
}

/* =========================
   DROPDOWNS
   ========================= */

.chart-select {
  height: 34px;
  min-width: 105px;
  padding: 0 30px 0 11px;

  color: #dbe5f5;
  background: #0d1629;

  border: 1px solid #2c4163;
  border-radius: 7px;

  font-size: 12px;
  font-weight: 500;

  outline: none;
  cursor: pointer;

  appearance: auto;
}

.chart-select:hover {
  border-color: #4777b8;
}

.chart-select:focus {
  border-color: #3d82ff;
  box-shadow: 0 0 0 2px rgba(61, 130, 255, 0.12);
}

.chart-select option {
  background: #101a2e;
  color: #dbe5f5;
}

/* =========================
   CHART AREA
   ========================= */

.equity-chart-wrapper {
  position: relative;
  width: 100%;
  height: calc(100% - 66px);
  padding: 18px 20px 14px 12px;
  box-sizing: border-box;
}

#equityCurveChart {
  width: 100% !important;
  height: 100% !important;
}

.up {
  color: rgb(52 211 153) !important;
}
.up-shadow {
  box-shadow: 0px 0px 4px 0px rgb(95 219 100 / 75%) !important;
}
.down {
  color: rgb(248 113 113) !important;
}
.down-shadow {
  box-shadow: 0px 0px 6px 0px #ff5d2aad !important;
}

.css-ujflkmjfW {
  display: none;
}

.css-ujflkmjfW.active {
  display: block;
}

.trade-logs-table-wrapper {
  max-height: 480px;
  overflow-y: auto;
  overflow-x: auto;
}

/* Optional: keep table header visible while scrolling */
.trade-logs-table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #101a2e;
}

.calendar-view {
  width: 100%;
  background: #101a2e;
  border: 1px solid #263f68;
  border-radius: 14px;
  overflow: hidden;
}

/* =========================================================
   TOOLBAR
   ========================================================= */

.calendar-toolbar {
  height: 66px;
  padding: 0 16px;

  display: flex;
  align-items: center;
  justify-content: space-between;

  border-bottom: 1px solid #26334d;
}

.calendar-month-nav {
  display: flex;
  align-items: center;
  gap: 10px;
}

.calendar-month-title {
  min-width: 135px;
  text-align: center;

  color: #e5edf9;

  font-size: 14px;
  font-weight: 600;
}

.calendar-nav-btn {
  width: 30px;
  height: 30px;

  display: flex;
  align-items: center;
  justify-content: center;

  border: 1px solid #30486d;
  border-radius: 7px;

  background: #0d172a;
  color: #9fb0c9;

  font-size: 20px;
  line-height: 1;

  cursor: pointer;

  transition: 0.15s ease;
}

.calendar-nav-btn:hover {
  background: #182640;
  color: #fff;
  border-color: #4775ae;
}

/* =========================================================
   DROPDOWN
   ========================================================= */

.calendar-select {
  min-width: 120px;
  height: 34px;

  padding: 0 10px;

  background: #0b1527;
  color: #dce7f7;

  border: 1px solid #30476b;
  border-radius: 7px;

  font-size: 12px;
  font-weight: 500;

  outline: none;
  cursor: pointer;
}

.calendar-select:focus {
  border-color: #3d82ff;
}

/* =========================================================
   CALENDAR
   ========================================================= */

.calendar-wrapper {
  padding: 14px;
}

.calendar-weekdays {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));

  margin-bottom: 7px;
}

.calendar-weekdays > div {
  padding: 7px 10px;
  color: #71829d;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  text-align: center;
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));

  gap: 6px;
}

/* =========================================================
   DAY CELL
   ========================================================= */

.calendar-day {
  min-height: 76px;

  padding: 9px;

  box-sizing: border-box;

  background: #0d172a;

  border: 1px solid #202f49;
  border-radius: 8px;

  display: flex;
  flex-direction: column;
  justify-content: space-between;

  transition: border-color 0.15s ease, background 0.15s ease,
    transform 0.15s ease;
}

.calendar-day:hover {
  border-color: #3a5b88;
  background: #111e34;
}

.calendar-day.empty {
  background: transparent;
  border-color: transparent;
}

/* =========================================================
   DATE
   ========================================================= */

.calendar-date {
  display: flex;
  align-items: center;
  justify-content: space-between;

  color: #8292ab;

  font-size: 10px;
  font-weight: 500;
}

.calendar-date-number {
  color: #cbd7e8;
  font-size: 12px;
  font-weight: 600;
}

/* =========================================================
   VALUE
   ========================================================= */

.calendar-value {
  margin-top: auto;

  font-size: 14px;
  font-weight: 700;

  letter-spacing: -0.2px;
}

.calendar-value.positive {
  color: #00d7a3;
}

.calendar-value.negative {
  color: #ff5964;
}

.calendar-value.neutral {
  color: #9aa9bf;
}

/* =========================================================
   WEEKEND
   ========================================================= */

.calendar-day.weekend {
  background: #0b1424;
}

.calendar-day.weekend .calendar-date-number {
  color: #66758c;
}

/* =========================================================
   TODAY / ACTIVE
   ========================================================= */

.calendar-day.active-month {
  border-color: #263b5e;
}

.calendar-day.today {
  border-color: #3979d9;
  box-shadow: inset 0 0 0 1px rgba(61, 130, 255, 0.15);
}

/* =========================================================
   VALUE BADGE
   ========================================================= */

.calendar-metric-label {
  color: #596a84;
  font-size: 9px;
  font-weight: 500;
}

.css-ujflfkmnW {
  border-top: 1px solid #03a9f475 !important;
}

.css-yhflmfjkf {
  min-width: 150px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.css-ujffhmnd {
  display: none;
  justify-content: center;
  align-items: center;
}
.css-ujffhmnd.active {
  display: flex;
}
.css-ujffhmnd.active .spinner {
  display: block;
}
body:has(.css-ujffhmnd.active) .css-yhflmnfj {
  display: none;
}
body:has(.css-ujffhmnd.active) #resultsSection {
  display: none;
}
body:has(.css-ujffhmnd.active) .css-yhflmfjkf {
  padding: 19px !important;
}
.css-bfflkoee {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}
body:has(.css-ifkflmnfjk.active) .css-iffmklpfyhmn {
  opacity: 0.1;
}
body:has(.css-ifkflmnfjk.active) .css-vnifklpfyhmn {
  box-shadow: none;
  background: transparent;
}
.css-yhlmfk {
  width: 100%;
}

/* =========================================================
   PERFORMANCE COMPARISON
   ========================================================= */

.compare-table-wrap {
  width: 100%;
  max-height: min(65vh, 680px);
  overflow: auto;

  border: 1px solid rgba(148, 163, 184, 0.12);
  border-radius: 14px;

  background: rgba(15, 23, 42, 0.55);

  scrollbar-width: auto;
}

/* =========================================================
   DESKTOP HEATMAP
   ========================================================= */

.compare-heatmap-table {
  width: 100%;
  min-width: 760px;

  border-collapse: separate;
  border-spacing: 0;

  table-layout: fixed;
}

.compare-heatmap-table thead {
  position: sticky;
  top: 0;

  z-index: 20;
}

.compare-heatmap-table thead th {
  position: sticky;
  top: 0;

  padding: 12px 14px;

  background: #0f172a;

  color: #cbd5e1;

  font-size: 11px;
  font-weight: 700;

  border-bottom: 1px solid rgba(148, 163, 184, 0.18);

  box-shadow: 0 1px 0 rgba(148, 163, 184, 0.12), 0 5px 12px rgba(0, 0, 0, 0.18);
}

.compare-heatmap-table .compare-metric-head {
  position: sticky;

  left: 0;
  top: 0;

  z-index: 30;

  width: 190px;
  min-width: 190px;

  text-align: left;

  background: #0f172a;
}

.compare-heatmap-table .compare-metric-name {
  position: sticky;

  left: 0;

  z-index: 10;

  width: 190px;
  min-width: 190px;

  padding: 11px 14px;

  background: #111827;

  color: #cbd5e1;

  font-size: 12px;
  font-weight: 600;

  border-right: 1px solid rgba(148, 163, 184, 0.12);
}

.compare-duration-title {
  font-size: 12px;
  font-weight: 700;

  color: #f8fafc;
}

.compare-duration-range {
  margin-top: 3px;

  font-size: 10px;
  font-weight: 500;

  color: #8d9cb3;

  white-space: nowrap;
}

.compare-heatmap-table tbody td {
  padding: 7px;

  border-bottom: 1px solid rgba(148, 163, 184, 0.08);

  background: rgba(15, 23, 42, 0.35);
}

.compare-heat-cell {
  min-height: 46px;

  display: flex;

  align-items: center;
  justify-content: center;

  border-radius: 9px;

  padding: 8px 10px;

  transition: transform 0.15s ease, filter 0.15s ease;
}

.compare-heat-cell:hover {
  transform: translateY(-1px);

  filter: brightness(1.08);
}

.compare-cell-value {
  font-size: 12px;

  font-weight: 700;

  white-space: nowrap;
}

/* =========================================================
   HEAT COLORS
   ========================================================= */

.compare-heat-strong {
  background: rgba(34, 197, 94, 0.22);

  color: #86efac;
}

.compare-heat-good {
  background: rgba(34, 197, 94, 0.12);

  color: #bbf7d0;
}

.compare-heat-neutral {
  background: rgba(100, 116, 139, 0.16);

  color: #cbd5e1;
}

.compare-heat-warn {
  background: rgba(245, 158, 11, 0.13);

  color: #fcd34d;
}

.compare-heat-bad {
  background: rgba(239, 68, 68, 0.16);

  color: #fca5a5;
}

/* =========================================================
   TWO TIMEFRAME SELECTOR
   ========================================================= */

.compare-mobile-selector {
  display: none;

  grid-template-columns:
    minmax(0, 1fr)
    auto
    minmax(0, 1fr);

  align-items: end;

  gap: 8px;
}

.compare-selector-card {
  min-width: 0;

  padding: 10px;

  background: rgba(15, 23, 42, 0.75);

  border: 1px solid rgba(148, 163, 184, 0.14);

  border-radius: 12px;
}

.compare-selector-label {
  margin-bottom: 5px;

  color: #64748b;

  font-size: 9px;

  font-weight: 700;

  text-transform: uppercase;

  letter-spacing: 0.05em;
}

.compare-period-select {
  width: 100%;

  min-height: 40px;

  padding: 0 32px 0 11px;

  background: #020617;

  color: #f8fafc;

  border: 1px solid #334155;

  border-radius: 9px;

  font-size: 12px;

  font-weight: 600;

  outline: none;
}

.compare-period-select:focus {
  border-color: #3b82f6;

  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.12);
}

.compare-vs {
  width: 32px;
  height: 32px;

  margin-bottom: 4px;

  display: flex;

  align-items: center;
  justify-content: center;

  flex-shrink: 0;

  border-radius: 50%;

  background: rgba(59, 130, 246, 0.1);

  border: 1px solid rgba(59, 130, 246, 0.22);

  color: #60a5fa;

  font-size: 9px;

  font-weight: 800;
}

/* =========================================================
   SPLIT COMPARISON
   ========================================================= */

.compare-split-view {
  display: none;
}

.compare-split-header {
  display: grid;

  grid-template-columns:
    minmax(0, 1fr)
    minmax(0, 1fr);

  gap: 8px;

  margin-bottom: 8px;
}

.compare-side-title {
  padding: 10px 12px;

  border-radius: 11px;

  background: rgba(30, 41, 59, 0.65);

  border: 1px solid rgba(148, 163, 184, 0.12);

  text-align: center;
}

.compare-side-period {
  font-size: 12px;

  font-weight: 700;

  color: #f8fafc;
}

.compare-side-range {
  margin-top: 2px;

  font-size: 10px;

  color: #99a6b9;
}

.compare-mobile-metrics {
  display: flex;

  flex-direction: column;

  gap: 6px;
}

.compare-mobile-row {
  display: grid;

  grid-template-columns:
    minmax(0, 1fr)
    minmax(0, 1fr);

  gap: 8px;
}

.compare-mobile-metric {
  min-width: 0;

  padding: 11px 10px;

  background: rgba(15, 23, 42, 0.72);

  border: 1px solid rgba(148, 163, 184, 0.1);

  border-radius: 10px;
}

.compare-mobile-metric-label {
  grid-column: 1 / -1;

  margin-bottom: 3px;

  color: #94a3b8;

  font-size: 9px;

  font-weight: 700;

  text-transform: uppercase;

  letter-spacing: 0.04em;
}

.compare-mobile-value {
  font-size: 13px;

  font-weight: 700;

  color: #f8fafc;

  white-space: nowrap;

  overflow: hidden;

  text-overflow: ellipsis;
}

.compare-mobile-diff {
  margin-top: 3px;

  font-size: 9px;

  color: #64748b;

  white-space: nowrap;
}

/* =========================================================
   HEATMAP HEADING
   ========================================================= */

.compare-heatmap-heading {
  display: flex;

  align-items: flex-end;

  justify-content: space-between;

  gap: 20px;

  margin-bottom: 16px;

  padding: 0 2px;
}

.compare-heatmap-title {
  margin: 0;

  color: #f8fafc;

  font-size: 14px;

  font-weight: 700;

  line-height: 1.3;
}

.compare-heatmap-subtitle {
  margin: 5px 0 0;

  color: #abb7c7;

  font-size: 12px;

  line-height: 1.4;
}

/* =========================================================
   COLOR LEGEND
   ========================================================= */

.compare-heatmap-legend {
  display: flex;

  align-items: center;

  gap: 14px;

  flex-shrink: 0;

  padding-bottom: 2px;
}

.compare-legend-item {
  display: flex;

  align-items: center;

  gap: 5px;

  color: #a0b2cb;

  font-size: 9px;

  font-weight: 500;

  white-space: nowrap;
}

.compare-legend-dot {
  width: 10px;

  height: 10px;

  flex-shrink: 0;

  border-radius: 3px;

  border: 1px solid transparent;
}

/* Better */

.compare-legend-better {
  background: rgba(34, 197, 94, 0.28);

  border-color: rgba(34, 197, 94, 0.55);
}

/* Neutral */

.compare-legend-neutral {
  background: rgba(100, 116, 139, 0.3);

  border-color: rgba(148, 163, 184, 0.28);
}

/* Lower */

.compare-legend-lower {
  background: rgba(239, 68, 68, 0.28);

  border-color: rgba(239, 68, 68, 0.55);
}

/* =========================================================
   MOBILE
   ========================================================= */

@media (max-width: 767px) {
  .compare-heatmap-heading {
    display: none;
  }

  #performanceCompareModal {
    padding: 0;

    align-items: flex-end;
  }

  #performanceCompareModal > div {
    max-height: 94vh;

    border-radius: 18px 18px 0 0;
  }

  #compareHeatmapView {
    overflow-y: auto;
  }

  #compareHeatmapView > div {
    padding: 12px;
  }

  .compare-mobile-selector {
    display: grid;
    position: sticky;
    top: 0px;
    background: #020617;
    align-items: center;
    padding-top: 5px;
    padding-bottom: 3px;
    z-index: 100000;
  }

  .compare-desktop-heatmap {
    display: none;
  }

  .compare-split-view {
    display: block;
  }

  .compare-mobile-value {
    font-size: 13px;
  }

  .compare-mobile-metric {
    padding: 10px;
  }
}

/* =========================================================
   SMALL MOBILE
   ========================================================= */

@media (max-width: 380px) {
  .compare-selector-card {
    padding: 8px;
  }

  .compare-period-select {
    font-size: 11px;

    padding-left: 8px;
  }

  .compare-vs {
    width: 28px;

    height: 28px;
  }

  .compare-mobile-value {
    font-size: 12px;
  }
}

/* =========================================================
   DESKTOP
   ========================================================= */

@media (min-width: 768px) {
  .legs-mobile-container {
    display: none;
  }
  .compare-mobile-selector {
    display: none;
  }

  .compare-desktop-heatmap {
    display: block;
  }

  .compare-split-view {
    display: none;
  }
}

@media (min-width: 1260px) {
  #performanceCompareModal .w-full.max-w-5xl.bg-slate-950 {
    min-width: 1220px;
  }
}

/* =========================================================
   RESPONSIVE
   ========================================================= */

@media (max-width: 768px) {
  .calendar-toolbar {
    height: auto;
    min-height: 60px;

    gap: 10px;
    flex-wrap: wrap;

    padding: 12px;
  }

  .calendar-month-title {
    min-width: 110px;
    font-size: 13px;
  }

  .calendar-wrapper {
    padding: 8px;
    overflow-x: auto;
  }

  .calendar-grid,
  .calendar-weekdays {
    min-width: 650px;
  }

  .calendar-day {
    min-height: auto;
  }
}

/* ============================================================
       ENGINE PAYWALL MODAL
       ============================================================ */

#quantEnginePremiumModal {
  position: fixed;
  inset: 0;
  z-index: 10000000;

  display: none;
  align-items: center;
  justify-content: center;

  padding: 16px;

  background: radial-gradient(
      circle at 50% 20%,
      rgba(59, 130, 246, 0.12),
      transparent 45%
    ),
    rgba(2, 6, 23, 0.78);

  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

#quantEnginePremiumModal.active {
  display: flex;
  animation: qePaywallFade 0.18s ease-out;
}

.qe-premium-card {
  width: min(440px, 100%);

  background: linear-gradient(145deg, #111827 0%, #0f172a 55%, #0b1220 100%);

  border: 1px solid rgba(59, 130, 246, 0.25);

  border-radius: 22px;

  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.55),
    0 0 0 1px rgba(255, 255, 255, 0.025) inset, 0 0 50px rgba(37, 99, 235, 0.08);

  overflow: hidden;

  transform: translateY(8px) scale(0.98);

  animation: qePaywallCard 0.22s ease-out forwards;
}

.qe-premium-top {
  padding: 24px 22px 18px;

  background: radial-gradient(
    circle at 50% -20%,
    rgba(59, 130, 246, 0.18),
    transparent 60%
  );
}

.qe-premium-icon {
  width: 48px;
  height: 48px;

  display: flex;
  align-items: center;
  justify-content: center;

  margin-bottom: 14px;

  border-radius: 14px;

  background: rgba(59, 130, 246, 0.1);

  border: 1px solid rgba(59, 130, 246, 0.22);

  color: #60a5fa;

  box-shadow: 0 8px 25px rgba(37, 99, 235, 0.1);
}

.qe-premium-title {
  font-size: 18px;
  font-weight: 700;
  color: #fff;
  line-height: 1.3;
}

.qe-premium-subtitle {
  margin-top: 7px;

  font-size: 12px;
  line-height: 1.6;

  color: #94a3b8;
}

.qe-premium-feature {
  margin: 0 22px 18px;

  padding: 13px 14px;

  display: flex;
  align-items: flex-start;
  gap: 10px;

  border-radius: 13px;

  background: rgba(15, 23, 42, 0.75);

  border: 1px solid rgba(51, 65, 85, 0.65);
}

.qe-premium-feature i {
  margin-top: 2px;

  color: #60a5fa;

  font-size: 11px;
}

.qe-premium-feature-text {
  font-size: 11px;
  line-height: 1.5;
  color: #cbd5e1;
}

.qe-premium-actions {
  display: flex;
  gap: 9px;

  padding: 0 22px 22px;
}

.qe-premium-btn {
  flex: 1;

  border: 0;
  border-radius: 12px;

  padding: 11px 14px;

  font-size: 11px;
  font-weight: 700;

  cursor: pointer;

  transition: transform 0.15s ease, opacity 0.15s ease, background 0.15s ease;
}

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

.qe-premium-close {
  background: #172033;
  color: #94a3b8;

  border: 1px solid #263247;
}

.qe-premium-upgrade {
  color: #fff;

  background: linear-gradient(135deg, #2563eb, #4f46e5);

  box-shadow: 0 8px 25px rgba(37, 99, 235, 0.2);
}

.qe-premium-upgrade:hover {
  opacity: 0.94;
}

@keyframes qePaywallFade {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

@keyframes qePaywallCard {
  from {
    transform: translateY(12px) scale(0.97);
    opacity: 0.7;
  }

  to {
    transform: translateY(0) scale(1);
    opacity: 1;
  }
}

/* ============================================================
       COMPARE LOCK
       ============================================================ */

.qe-premium-locked {
  position: relative !important;
  overflow: hidden !important;
}

.qe-premium-locked .compare-locked-value {
  filter: blur(7px);
  user-select: none;
  pointer-events: none;
}

.qe-premium-locked-overlay {
  position: absolute;
  inset: 0;

  display: flex;
  align-items: center;
  justify-content: center;

  background: linear-gradient(90deg, rgba(2, 6, 23, 0.2), rgba(2, 6, 23, 0.45));

  z-index: 5;
}

.qe-premium-lock-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;

  padding: 5px 8px;

  border-radius: 999px;

  background: rgba(15, 23, 42, 0.9);

  border: 1px solid rgba(96, 165, 250, 0.2);

  color: #93c5fd;

  font-size: 9px;
  font-weight: 700;
  cursor: pointer;
}

/* ============================================================
       MOBILE COMPARE LOCK
       ============================================================ */

.qe-mobile-premium-locked {
  position: relative;
  overflow: hidden;
}

.qe-mobile-premium-locked .compare-mobile-value {
  filter: blur(7px);
  user-select: none;
}

.qe-mobile-premium-locked::after {
  content: "Premium";

  position: absolute;

  left: 50%;
  top: 50%;

  transform: translate(-50%, -50%);

  padding: 5px 8px;

  border-radius: 999px;

  background: rgba(15, 23, 42, 0.94);

  border: 1px solid rgba(96, 165, 250, 0.22);

  color: #93c5fd;

  font-size: 8px;
  font-weight: 700;

  z-index: 10;
}

/* ============================================================
       MOBILE PAYWALL
       ============================================================ */

@media (max-width: 767px) {
  #quantEnginePremiumModal {
    align-items: flex-end;

    padding: 10px;
  }

  .qe-premium-card {
    width: 100%;

    border-radius: 22px 22px 16px 16px;

    animation: qePaywallMobile 0.25s ease-out forwards;
  }

  .qe-premium-top {
    padding: 20px 18px 15px;
  }

  .qe-premium-feature {
    margin-left: 18px;
    margin-right: 18px;
  }

  .qe-premium-actions {
    padding-left: 18px;
    padding-right: 18px;
    padding-bottom: 18px;
  }

  @keyframes qePaywallMobile {
    from {
      transform: translateY(100%);
      opacity: 0.5;
    }

    to {
      transform: translateY(0);
      opacity: 1;
    }
  }
}

@media (min-width:780px){
    .css-ujflkmfip{
        min-height: 30rem;
        align-items: start;
    }
    .css-ujflkmfip article{
        min-height: 131px;
    }
}
