/* v397: Apps in Toss reward feedback, referral and compact ranking polish. */

body[data-platform="toss"] #app {
  background: linear-gradient(180deg, #f4f9ff 0 170px, #fff 170px 284px, #f2f4f6 284px 100%) !important;
}

body[data-platform="toss"][data-active-panel="home"] :is(#main-screen, #panel-home, #home-control-deck) {
  background-color: #f2f4f6 !important;
}

.boost-choice-status:not(:empty) {
  box-sizing: border-box;
  display: grid !important;
  min-height: 44px;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 8px;
  margin: 0 !important;
  padding: 9px 11px !important;
  border: 1px solid #b8d8ff;
  border-radius: 12px;
  color: #191f28;
  background: linear-gradient(135deg, #edf6ff, #f8fbff);
  box-shadow: inset 0 1px rgba(255, 255, 255, .9);
  text-align: left;
}

.boost-choice-status[data-multiplier="100"] {
  border-color: #d8c5ff;
  background: linear-gradient(135deg, #f4efff, #fff8eb);
}

.boost-choice-status-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #3182f6;
  box-shadow: 0 0 0 4px rgba(49, 130, 246, .13);
}

.boost-choice-status[data-multiplier="100"] .boost-choice-status-dot {
  background: #8b5cf6;
  box-shadow: 0 0 0 4px rgba(139, 92, 246, .14);
}

.boost-choice-status strong {
  color: #191f28;
  font-size: 14px;
  font-weight: 850;
  line-height: 19px;
}

.boost-choice-status em {
  color: #1769e5;
  font-size: 12px;
  font-style: normal;
  font-weight: 800;
  line-height: 17px;
  font-variant-numeric: tabular-nums;
}

.boost-choice-status[data-multiplier="100"] em { color: #6d3dd1; }

.reward-receipt-layer {
  position: fixed;
  z-index: 12000;
  top: max(12px, env(safe-area-inset-top));
  left: 50%;
  width: min(calc(100vw - 24px), 372px);
  transform: translateX(-50%);
  pointer-events: none;
}

.reward-receipt-layer.hidden { display: none !important; }

.reward-receipt-card {
  box-sizing: border-box;
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-height: 72px;
  padding: 12px;
  border: 1px solid #d8e9fb;
  border-radius: 16px;
  background: rgba(255, 255, 255, .98);
  box-shadow: 0 14px 34px rgba(25, 31, 40, .2), inset 0 1px rgba(255, 255, 255, .9);
  pointer-events: auto;
}

.reward-receipt-layer.is-entering .reward-receipt-card {
  animation: reward-receipt-enter .3s cubic-bezier(.2, .9, .25, 1.15) both;
}

.reward-receipt-check {
  position: relative;
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: linear-gradient(145deg, #4d9cff, #1769e5);
  box-shadow: 0 6px 14px rgba(49, 130, 246, .28);
}

.reward-receipt-check::after {
  width: 12px;
  height: 6px;
  border-bottom: 3px solid #fff;
  border-left: 3px solid #fff;
  content: "";
  transform: translateY(-2px) rotate(-45deg);
}

.reward-receipt-copy {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.reward-receipt-copy > strong {
  overflow: hidden;
  color: #191f28;
  font-size: 14px;
  font-weight: 850;
  line-height: 19px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.reward-receipt-copy > span {
  display: flex;
  min-width: 0;
  align-items: baseline;
  gap: 6px;
  color: #6b7684;
  font-size: 11px;
  font-weight: 700;
}

.reward-receipt-copy em { overflow: hidden; font-style: normal; text-overflow: ellipsis; white-space: nowrap; }
.reward-receipt-copy b { color: #1769e5; font-size: 13px; font-weight: 900; white-space: nowrap; }
.reward-receipt-card > button {
  min-width: 45px;
  min-height: 36px;
  padding: 0 10px;
  border: 0;
  border-radius: 10px;
  color: #1769e5;
  background: #edf5ff;
  font: inherit;
  font-size: 12px;
  font-weight: 850;
}

#ranking-modal.modal > .toss-ranking-content.dialog-card {
  box-sizing: border-box;
  display: grid;
  width: min(calc(100vw - 24px), 390px);
  height: auto;
  max-height: calc(100dvh - max(24px, env(safe-area-inset-top)) - max(16px, env(safe-area-inset-bottom))) !important;
  grid-template-rows: none;
  align-content: start;
  gap: 12px;
  padding: 18px 16px 16px;
  overflow: auto;
  border: 1px solid #e5e8eb;
  border-radius: 22px;
  background: #fff !important;
  box-shadow: 0 22px 48px rgba(25, 31, 40, .24);
  text-align: left;
}

#ranking-modal .toss-ranking-content::before { display: none; }
#ranking-modal .toss-ranking-content .ranking-header { display: grid; gap: 3px; padding: 0; }
#ranking-modal .toss-ranking-content .ranking-header .dialog-title {
  margin: 0;
  color: #191f28;
  font-size: 25px;
  font-weight: 900;
  line-height: 32px;
}

#ranking-modal .toss-ranking-content .ranking-header p {
  margin: 0;
  color: #6b7684;
  font-size: 12.5px;
  font-weight: 650;
  line-height: 18px;
  word-break: keep-all;
}

.toss-ranking-kicker {
  width: max-content;
  padding: 3px 7px;
  border-radius: 999px;
  color: #1769e5;
  background: #edf5ff;
  font-size: 10px;
  font-weight: 850;
  line-height: 14px;
}

.toss-ranking-record {
  box-sizing: border-box;
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  min-height: 76px;
  padding: 12px;
  border: 1px solid #d8e9fb;
  border-radius: 15px;
  background: linear-gradient(135deg, #f4f9ff, #edf5ff);
}

.toss-ranking-medal {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 5px 14px rgba(49, 130, 246, .13);
  font-size: 23px;
}

.toss-ranking-record-copy { display: grid; min-width: 0; gap: 1px; }
.toss-ranking-record-copy small { color: #6b7684; font-size: 11px; font-weight: 750; line-height: 16px; }
#ranking-modal .toss-ranking-record-copy #ranking-summary-worth {
  overflow: hidden;
  color: #1769e5;
  font-size: 21px;
  font-weight: 900;
  line-height: 28px;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.toss-ranking-guide {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 0;
  padding: 10px 11px;
  border-radius: 11px;
  color: #4e5968;
  background: #f7f8fa;
  font-size: 11.5px;
  font-weight: 700;
  line-height: 17px;
  word-break: keep-all;
}

.toss-ranking-guide > span {
  width: 8px;
  height: 8px;
  border-top: 2px solid #3182f6;
  border-right: 2px solid #3182f6;
  transform: rotate(45deg);
}
#ranking-modal .toss-ranking-content .dialog-actions { display: grid; gap: 8px; margin: 0; }
#ranking-modal .toss-ranking-content :is(#ranking-native-open-btn, #ranking-close-btn) {
  width: 100%;
  min-height: 48px;
  margin: 0;
  border-radius: 13px;
  font-size: 14px;
  font-weight: 850;
}

@keyframes reward-receipt-enter {
  from { opacity: 0; transform: translateY(-14px) scale(.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@media (max-width: 380px) {
  body[data-platform="toss"] #app {
    background: linear-gradient(180deg, #f4f9ff 0 156px, #fff 156px 270px, #f2f4f6 270px 100%) !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  .reward-receipt-layer.is-entering .reward-receipt-card { animation: none; }
}
