/* GRAM additions only. Layout/chrome remain the existing Stars/Premium CSS. */
#smmese-telegram-shop-design[data-product="gram"] {
  --tg-accent: light-dark(#176bd5, #8fc5ff);
  --tg-accent-wash: light-dark(#eaf4ff, #1c334c);
  --tg-metal-floor: #1676d52b;
}
#smmese-telegram-shop-design[data-product="gram"] .tg-title-line { overflow-wrap: anywhere; }
#smmese-telegram-shop-design[data-product="gram"] .tg-form-heading h2 { overflow-wrap: anywhere; }
#smmese-telegram-shop-design[data-product="gram"] .tg-mini-mark { flex: 0 0 36px; }
#smmese-telegram-shop-design .gram-symbol { display: block; width: 19px; height: 19px; }
#smmese-telegram-shop-design .gram-method {
  width: 100%; min-width: 0; min-height: 57px; padding: 12px 16px;
  border: 1px solid var(--tg-line); border-radius: 12px;
  background: var(--tg-field); color: var(--tg-ink); font: inherit; font-size: 15px;
}
#smmese-telegram-shop-design[data-product="gram"] .tg-summary { flex-wrap: wrap; }
#smmese-telegram-shop-design[data-product="gram"] .tg-summary>div { min-width: 0; max-width: 100%; overflow-wrap: anywhere; }
#smmese-telegram-shop-design[data-product="gram"] .tg-total {
  max-width: 100%; margin-inline-start: auto; white-space: normal;
  overflow-wrap: anywhere; text-align: end;
}
#smmese-telegram-shop-design .gram-scene .scene-orbit {
  position: absolute; left: 15px; top: 25px; width: 295px; height: 165px;
  border: 1px solid #dce7f3; border-radius: 50%; transform: rotate(-22deg);
}
#smmese-telegram-shop-design .gram-scene .orbit-two { transform: rotate(28deg); opacity: .6; }
#smmese-telegram-shop-design .gram-scene .scene-spark { position: absolute; color: #86a8db; font-size: 22px; }
#smmese-telegram-shop-design .gram-scene .spark-one { left: 5px; top: 100px; font-size: 16px; }
#smmese-telegram-shop-design .gram-scene .spark-two { right: 8px; top: 20px; }
#smmese-telegram-shop-design .gram-scene .scene-dot { position: absolute; width: 5px; height: 5px; background: #86a8db; right: 35px; bottom: 45px; border-radius: 50%; }
#smmese-telegram-shop-design .gram-scene .coin-shadow { position: absolute; bottom: 17px; left: 40px; width: 245px; height: 25px; background: #1676d51a; border-radius: 50%; filter: blur(13px); }
#smmese-telegram-shop-design .gram-scene .gram-diamond { position: absolute; left: 50px; top: 8px; width: 225px; height: 215px; transform: rotate(-8deg); filter: drop-shadow(0 18px 12px #1269cb26); }
#smmese-telegram-shop-design .gram-gem { display: block; width: 100%; height: 100%; }
@media (max-width: 720px) {
  #smmese-telegram-shop-design .gram-scene .gram-diamond { width: 136px; height: 134px; left: 7px; top: 18px; }
  #smmese-telegram-shop-design .gram-scene .scene-orbit { width: 150px; height: 100px; left: 0; top: 35px; }
  #smmese-telegram-shop-design .gram-scene .coin-shadow { width: 115px; left: 10px; bottom: 20px; }
  #smmese-telegram-shop-design .gram-scene .spark-one { top: 116px; left: 0; font-size: 12px; }
  #smmese-telegram-shop-design .gram-scene .spark-two { right: 0; top: 8px; font-size: 18px; }
  #smmese-telegram-shop-design .gram-scene .scene-dot { right: 10px; bottom: 26px; width: 3px; height: 3px; }
  [dir="rtl"] #smmese-telegram-shop-design .gram-scene { right: auto; left: -10px; }
}
@media (max-width: 410px) {
  #smmese-telegram-shop-design .gram-scene .gram-diamond { width: 107px; height: 105px; left: 2px; top: 15px; }
  #smmese-telegram-shop-design .gram-scene .scene-orbit { width: 120px; height: 80px; top: 30px; }
  #smmese-telegram-shop-design .gram-scene .coin-shadow { width: 95px; }
  #smmese-telegram-shop-design .gram-scene .spark-one { top: 100px; }
  [dir="rtl"] #smmese-telegram-shop-design .gram-scene { left: -8px; }
}

/* The 320px layout reserves a clear image column without shrinking text. */
@media (max-width: 350px) {
  #smmese-telegram-shop-design[data-product="gram"] .tg-lead {
    max-width: calc(100% - 116px);
  }
  #smmese-telegram-shop-design[data-product="gram"] .gram-scene {
    width: 104px; right: -8px;
  }
  #smmese-telegram-shop-design[data-product="gram"] .gram-scene .gram-diamond {
    width: 90px; height: 90px; left: 6px; top: 15px;
  }
  #smmese-telegram-shop-design[data-product="gram"] .gram-scene .scene-orbit {
    width: 100px; height: 68px; top: 28px;
  }
  #smmese-telegram-shop-design[data-product="gram"] .gram-scene .coin-shadow {
    width: 80px; left: 12px;
  }
  [dir="rtl"] #smmese-telegram-shop-design[data-product="gram"] .gram-scene {
    right: auto; left: -8px;
  }
  /* This stylesheet is loaded only by the GRAM page. Keep natural link widths
     and 44px touch targets instead of splitting a word into a lone letter. */
  body.sc-public-chrome .sc-footer nav.sc-docs {
    display: flex; flex-wrap: wrap; justify-content: flex-start;
    align-items: center; gap: 0 12px;
  }
  body.sc-public-chrome .sc-footer nav.sc-docs a {
    flex: 0 0 auto; max-width: 100%; overflow-wrap: normal;
    word-break: normal; white-space: normal;
  }
}

@media (min-width: 351px) and (max-width: 410px) {
  #smmese-telegram-shop-design[data-product="gram"] .tg-title {
    max-width: calc(100% - 136px);
  }
}
@media (min-width: 411px) and (max-width: 720px) {
  #smmese-telegram-shop-design[data-product="gram"] .tg-title,
  #smmese-telegram-shop-design[data-product="gram"] .tg-lead {
    max-width: calc(100% - 174px);
  }
}

/* Recipient preview matches the existing Stars checkout stylesheet. */
#smmese-telegram-shop-design .tg-recipient-preview { display: flex; align-items: center; gap: 12px; margin-top: 12px; padding: 12px 14px; border: 1px solid rgba(255, 255, 255, 0.14); border-radius: 14px; background: rgba(255, 255, 255, 0.05); }
#smmese-telegram-shop-design .tg-recipient-avatar, #smmese-telegram-shop-design .tg-recipient-avatar-fallback { width: 42px; height: 42px; flex: 0 0 42px; border-radius: 50%; object-fit: cover; }
#smmese-telegram-shop-design .tg-recipient-avatar-fallback { display: grid; place-items: center; background: linear-gradient(135deg, rgb(47, 128, 237), rgb(123, 97, 255)); color: rgb(255, 255, 255); font-weight: 750; font-size: 18px; }
#smmese-telegram-shop-design .tg-recipient-identity { display: flex; min-width: 0px; flex-direction: column; gap: 3px; }
#smmese-telegram-shop-design .tg-recipient-identity strong, #smmese-telegram-shop-design .tg-recipient-identity span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#smmese-telegram-shop-design .tg-recipient-identity span { opacity: 0.7; font-size: 0.9em; }
#smmese-telegram-shop-design [hidden] { display: none !important; }
#smmese-telegram-shop-design #gram-recipient-hint { overflow-wrap: anywhere; }

/* The two existing GRAM destinations occupy one compact form row. */
.gram-delivery { border: 0; padding: 0; margin: 0 0 1.25rem; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .5rem; }
.gram-delivery[hidden] { display: none; }
.gram-delivery legend { margin-bottom: .45rem; }
.gram-delivery label { display: flex; align-items: center; gap: .45rem; min-width: 0; min-height: 48px; padding: .5rem .65rem; border: 1px solid var(--tg-line); border-radius: 10px; cursor: pointer; font-size: 13px; line-height: 1.25; }
.gram-delivery label:has(input:checked) { border-color: var(--tg-accent); background: var(--tg-accent-wash); }
.gram-delivery input { accent-color: #168be9; }
@media (max-width: 370px) { .gram-delivery { grid-template-columns: 1fr; } }
