/* SUNDEX card dashboard p74 — restores a single intentional grid and readable metrics. */
body[data-sundex-card-premium="product"] .scp-card-dashboard {
  display: grid !important;
  grid-template-columns: minmax(0, 1.14fr) minmax(360px, 0.86fr) !important;
  grid-template-rows: auto minmax(400px, auto) auto !important;
  grid-template-areas:
    "intro balance"
    "card controls"
    "ledger ledger" !important;
  width: min(100%, 1320px) !important;
  max-width: 1320px !important;
  min-height: calc(100dvh - 76px) !important;
  align-content: start !important;
  align-items: start !important;
  column-gap: clamp(48px, 6vw, 104px) !important;
  row-gap: 40px !important;
  margin: 0 auto !important;
  padding: clamp(58px, 6.5vw, 92px) 8px 44px !important;
}

/* The original app uses space-y on this container. It must not survive grid enhancement. */
body[data-sundex-card-premium="product"] .scp-card-dashboard > * {
  margin-block: 0 !important;
}

body[data-sundex-card-premium="product"] .scp-dashboard-copy {
  grid-area: intro !important;
  width: min(100%, 610px) !important;
  max-width: 610px !important;
  align-self: start !important;
}

body[data-sundex-card-premium="product"] .scp-dashboard-copy .scp-eyebrow {
  color: rgba(197, 210, 226, 0.56) !important;
}

body[data-sundex-card-premium="product"] .scp-dashboard-copy h1 {
  margin: 20px 0 0 !important;
  color: #f4f7fb !important;
  font-size: clamp(4rem, 5.25vw, 6.25rem) !important;
  font-weight: 570 !important;
  letter-spacing: -0.068em !important;
  line-height: 0.9 !important;
  white-space: normal !important;
}

body[data-sundex-card-premium="product"] .scp-dashboard-copy h1 span {
  color: rgba(201, 212, 226, 0.46) !important;
}

body[data-sundex-card-premium="product"] .scp-dashboard-copy > p:last-child {
  max-width: 510px !important;
  margin: 26px 0 0 !important;
  color: rgba(205, 215, 228, 0.61) !important;
  font-size: 1rem !important;
  line-height: 1.58 !important;
}

body[data-sundex-card-premium="product"] .scp-dashboard-balance {
  grid-area: balance !important;
  display: flex !important;
  width: 100% !important;
  min-width: 0 !important;
  align-self: start !important;
  flex-direction: column !important;
  align-items: flex-start !important;
  gap: 7px !important;
  padding-top: 2px !important;
  text-align: left !important;
}

body[data-sundex-card-premium="product"] .scp-dashboard-balance > p {
  margin: 0 !important;
}

body[data-sundex-card-premium="product"] .scp-dashboard-balance > p:first-child {
  color: rgba(197, 210, 226, 0.52) !important;
  font-size: 0.67rem !important;
  font-weight: 650 !important;
  letter-spacing: 0.18em !important;
  line-height: 1.2 !important;
  text-transform: uppercase !important;
}

body[data-sundex-card-premium="product"] .scp-dashboard-balance > p:nth-child(2) {
  color: #f4f7fb !important;
  font-size: clamp(4.25rem, 5.3vw, 6rem) !important;
  font-weight: 540 !important;
  letter-spacing: -0.065em !important;
  line-height: 0.9 !important;
}

body[data-sundex-card-premium="product"] .scp-dashboard-balance > p:last-child {
  color: rgba(205, 215, 228, 0.56) !important;
  font-size: 0.78rem !important;
  font-weight: 520 !important;
  line-height: 1.35 !important;
}

body[data-sundex-card-premium="product"] .scp-dashboard-stage {
  grid-area: card !important;
  position: relative !important;
  display: flex !important;
  min-width: 0 !important;
  min-height: 400px !important;
  align-items: center !important;
  justify-content: flex-start !important;
  padding: 20px 64px 18px 4px !important;
}

body[data-sundex-card-premium="product"] .scp-dashboard-stage > div[style*="perspective"] {
  width: min(100%, 570px) !important;
  max-width: 570px !important;
  margin-inline: 0 !important;
}

body[data-sundex-card-premium="product"] .scp-dashboard-add-card {
  position: absolute !important;
  z-index: 20 !important;
  top: 20px !important;
  right: 0 !important;
  display: inline-flex !important;
  width: auto !important;
  min-width: 104px !important;
  height: 42px !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 8px !important;
  padding: 0 15px !important;
  border: 1px solid rgba(211, 223, 239, 0.2) !important;
  border-radius: 999px !important;
  color: rgba(236, 242, 249, 0.86) !important;
  background: rgba(8, 12, 18, 0.72) !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05), 0 12px 30px rgba(0, 0, 0, 0.26) !important;
  backdrop-filter: blur(16px) !important;
  transition: transform 180ms cubic-bezier(0.22, 1, 0.36, 1), border-color 180ms ease, background-color 180ms ease !important;
}

body[data-sundex-card-premium="product"] .scp-dashboard-add-card svg {
  width: 14px !important;
  height: 14px !important;
}

body[data-sundex-card-premium="product"] .scp-dashboard-add-label {
  font-size: 0.73rem !important;
  font-weight: 620 !important;
  letter-spacing: -0.01em !important;
}

body[data-sundex-card-premium="product"] .scp-dashboard-actions {
  grid-area: controls !important;
  display: grid !important;
  width: 100% !important;
  max-width: none !important;
  align-self: center !important;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  gap: 12px !important;
}

body[data-sundex-card-premium="product"] .scp-dashboard-action {
  min-height: 94px !important;
  align-items: flex-start !important;
  justify-content: space-between !important;
  gap: 18px !important;
  padding: 19px !important;
  border: 1px solid rgba(203, 217, 235, 0.12) !important;
  border-radius: 18px !important;
  color: rgba(231, 237, 245, 0.86) !important;
  background: linear-gradient(145deg, rgba(17, 24, 34, 0.88), rgba(7, 11, 17, 0.9)) !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04) !important;
  text-align: left !important;
}

body[data-sundex-card-premium="product"] .scp-dashboard-action svg {
  width: 17px !important;
  height: 17px !important;
  color: rgba(205, 217, 232, 0.74) !important;
}

body[data-sundex-card-premium="product"] .scp-dashboard-action span {
  color: rgba(237, 242, 248, 0.88) !important;
  font-size: 0.78rem !important;
  font-weight: 570 !important;
  line-height: 1.2 !important;
}

body[data-sundex-card-premium="product"] .scp-dashboard-ledger {
  grid-area: ledger !important;
  width: 100% !important;
  margin-top: 4px !important;
  overflow: hidden !important;
  border: 1px solid rgba(203, 217, 235, 0.11) !important;
  border-radius: 20px !important;
  background: rgba(7, 11, 16, 0.84) !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.025) !important;
}

@media (hover: hover) and (pointer: fine) {
  body[data-sundex-card-premium="product"] .scp-dashboard-add-card:hover,
  body[data-sundex-card-premium="product"] .scp-dashboard-action:hover {
    border-color: rgba(218, 229, 243, 0.28) !important;
    background-color: rgba(13, 19, 27, 0.94) !important;
    transform: translateY(-2px) !important;
  }
}

@media (max-width: 1060px) {
  body[data-sundex-card-premium="product"] .scp-card-dashboard {
    grid-template-columns: minmax(0, 1fr) !important;
    grid-template-rows: auto auto auto auto auto !important;
    grid-template-areas:
      "intro"
      "balance"
      "card"
      "controls"
      "ledger" !important;
    width: min(100%, 760px) !important;
    max-width: 760px !important;
    row-gap: 30px !important;
    padding-top: 58px !important;
  }

  body[data-sundex-card-premium="product"] .scp-dashboard-balance {
    padding-top: 0 !important;
  }

  body[data-sundex-card-premium="product"] .scp-dashboard-stage {
    min-height: 400px !important;
  }

  body[data-sundex-card-premium="product"] .scp-dashboard-actions {
    align-self: start !important;
  }
}

@media (max-width: 640px) {
  body[data-sundex-card-premium="product"] .platform-main {
    padding-inline: 18px !important;
  }

  body[data-sundex-card-premium="product"] .scp-card-dashboard {
    row-gap: 24px !important;
    padding: 46px 0 28px !important;
  }

  body[data-sundex-card-premium="product"] .scp-dashboard-copy h1 {
    font-size: clamp(3.35rem, 16vw, 4.4rem) !important;
  }

  body[data-sundex-card-premium="product"] .scp-dashboard-copy > p:last-child {
    margin-top: 22px !important;
    font-size: 0.92rem !important;
  }

  body[data-sundex-card-premium="product"] .scp-dashboard-balance > p:nth-child(2) {
    font-size: clamp(3.7rem, 18vw, 5rem) !important;
  }

  body[data-sundex-card-premium="product"] .scp-dashboard-stage {
    min-height: 320px !important;
    padding: 48px 0 4px !important;
  }

  body[data-sundex-card-premium="product"] .scp-dashboard-stage > div[style*="perspective"] {
    width: 100% !important;
    max-width: 100% !important;
  }

  body[data-sundex-card-premium="product"] .scp-dashboard-add-card {
    top: 0 !important;
    right: 0 !important;
  }

  body[data-sundex-card-premium="product"] .scp-dashboard-action {
    min-height: 82px !important;
    padding: 16px !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  body[data-sundex-card-premium="product"] .scp-dashboard-add-card,
  body[data-sundex-card-premium="product"] .scp-dashboard-action {
    transition: none !important;
  }
}
