/* A 390 x 844 logical phone screen, scaled as a whole by ResizeObserver. */
.tg-preview {
  display: block;
  position: relative;
  width: 100%;
  max-width: 330px;
  aspect-ratio: 390 / 844;
  margin: 0 auto;
  overflow: hidden;
  border-radius: 25px;
  background: #c6d7b6;
  --tg-scale: 0.8;
  color: #17231b;
  text-align: left;
}
.tg-preview * {
  box-sizing: border-box;
}
.tg-preview .tg-screen {
  position: absolute;
  display: flex;
  flex-direction: column;
  width: 390px;
  height: 844px;
  transform: scale(var(--tg-scale));
  transform-origin: top left;
  font:
    17px/1.35 Arial,
    sans-serif;
  background:
    url("/static/telegram-wallpaper.svg"),
    radial-gradient(ellipse at 100% 8%, #e4e4ad 0%, transparent 65%),
    linear-gradient(155deg, #96c6b1, #c8d9ae 65%, #b5cfaf);
}
.tg-preview .tg-status {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 52px;
  flex-shrink: 0;
  padding: 0 26px;
  font-size: 16px;
}
.tg-preview .tg-status > span {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
}
.tg-preview svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
}
.tg-preview .tg-status svg {
  width: 19px;
  height: 19px;
}
.tg-preview .tg-battery {
  background: #25392a;
  color: white;
  border-radius: 5px;
  padding: 0 4px;
  font-size: 11px;
}
.tg-preview .tg-header {
  display: flex;
  align-items: center;
  margin: 4px 10px 0;
  padding: 8px 10px;
  gap: 12px;
  height: 58px;
  flex-shrink: 0;
  background: #f7fbe5d9;
  border: 1px solid #ffffff85;
  border-radius: 30px;
  box-shadow: 0 4px 18px #3a573015;
}
.tg-preview .tg-back {
  font-size: 40px;
  font-weight: 300;
  line-height: 1;
  padding: 0 5px;
}
.tg-preview .tg-heading {
  flex: 1;
  min-width: 0;
}
.tg-preview .tg-heading strong {
  display: block;
  font-size: 18px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.tg-preview .tg-heading small {
  display: block;
  font-size: 13px;
  color: #73836b;
}
.tg-preview .tg-avatar {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #e2ebd1;
  color: #547655;
  font-size: 24px;
}
.tg-preview .tg-chat {
  display: block;
  flex: 1;
  min-height: 0;
  overflow: auto;
  scrollbar-width: thin;
  padding: 24px 12px;
}
.tg-preview .tg-message {
  display: block;
  width: 94%;
  padding: 13px 12px 7px;
  background: #fff;
  color: #111;
  border-radius: 13px 13px 13px 5px;
  box-shadow: 0 1px 1px #38492a15;
}
.tg-preview [data-tg-message] {
  display: block;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-size: 17px;
  line-height: 1.4;
}
.tg-preview .tg-photo {
  display: block;
  margin: -13px -12px 12px;
  overflow: hidden;
  border-radius: 13px 13px 0 0;
}
.tg-preview .tg-photo[hidden] {
  display: none;
}
.tg-preview .tg-photo img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 12 / 5;
  object-fit: cover;
}
.tg-preview .tg-time {
  display: block;
  font-size: 10px;
  color: #8c9294;
  text-align: right;
  margin-top: 4px;
}
.tg-preview .tg-keyboard {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  width: 94%;
  gap: 3px;
  margin-top: 3px;
}
.tg-preview .tg-row {
  display: flex;
  min-width: 0;
  gap: 3px;
}
.tg-preview .tg-button {
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  flex: 1;
  min-width: 0;
  height: 43px;
  padding: 0 8px;
  border-radius: 8px;
  background: #537c4b80;
  color: #fff;
  font-size: 16px;
  font-weight: 500;
}
.tg-preview .tg-button > span:first-child {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.tg-preview .tg-button:has(.tg-link) {
  padding-right: 23px;
}
.tg-preview .tg-link {
  position: absolute;
  right: 7px;
  top: 4px;
  font-size: 13px;
}
.tg-preview .tg-composer {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  padding: 10px 12px 8px;
  background: #dce8ce91;
}
.tg-preview .tg-menu {
  border-radius: 25px;
  padding: 10px;
  border: 2px solid white;
  color: white;
  background: #258dd0;
  white-space: nowrap;
  font-size: 14px;
}
.tg-preview .tg-input {
  display: flex;
  justify-content: space-between;
  min-width: 0;
  flex: 1;
  padding: 10px 12px;
  border-radius: 24px;
  background: #f6fae4d9;
  color: #8d9e82;
  font-size: 16px;
}
.tg-preview .tg-home-indicator {
  display: block;
  height: 5px;
  width: 130px;
  border-radius: 5px;
  background: #223022;
  margin: 11px auto 8px;
  flex-shrink: 0;
}
.tg-preview .tg-uploaded-media img,.tg-preview .tg-uploaded-media video {
  display:block;width:100%;height:auto;max-height:460px;aspect-ratio:auto;object-fit:contain;
}
.tg-preview [data-tg-message] a {color:#168acd;text-decoration:none}
.tg-preview [data-tg-message] code {font-family:monospace;background:#eef2f4;border-radius:3px;padding:1px 3px}
.tg-preview [data-tg-message] blockquote {margin:5px 0;padding:5px 9px;border-left:3px solid #6b9e70;border-radius:3px;background:#edf3eb;white-space:pre-wrap}
.tg-preview .tg-spoiler {background:#b8c1bd;color:transparent;border-radius:3px}
.tg-preview .tg-spoiler:hover {color:inherit;background:#dce3df}
.tg-preview .tg-button[data-style=primary]{background:#3e91cf;color:white}
.tg-preview .tg-button[data-style=success]{background:#459968;color:white}
.tg-preview .tg-button[data-style=danger]{background:#c95c59;color:white}
