#phone-scroll-section {
  height: 180vh;
  position: relative;
  z-index: 20;
  padding: 5vh 0 0;
}

.phone-sticky-wrap {
  position: -webkit-sticky;
  position: sticky;
  top: 5vh;
  height: 90vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: visible;
  transform: translateZ(0);
  will-change: transform;
}

.phone-mockup {
  width: 420px;
  aspect-ratio: 9 / 19.5;
  height: auto;
  max-width: 95vw;
  max-height: 85vh;
  background: var(--s3);
  border-radius: 54px;
  position: relative;
  box-shadow: 0 40px 100px rgba(0, 0, 0, 0.8), inset 0 0 0 1px rgba(255, 255, 255, 0.1);
  padding: 5px;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
}

.phone-screen {
  background-color: var(--bg);
  width: 100%;
  height: 100%;
  border-radius: 49px;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.phone-screen::before {
  display: none;
}

.phone-status-bar {
  position: absolute;
  top: 18px;
  left: 32px;
  right: 28px;
  display: flex;
  justify-content: space-between;
  font-family: -apple-system, sans-serif;
  font-size: 14px;
  font-weight: 600;
  color: var(--white);
  z-index: 101;
}

.phone-notch {
  position: absolute;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  width: 120px;
  height: 32px;
  background-color: #000;
  border-radius: 99px;
  z-index: 105;
  border: 1px solid rgba(255, 255, 255, 0.03);
}

.tg-chat-container {
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  background: transparent;
  display: flex;
  flex-direction: column;
  position: relative;
  z-index: 2;
  overflow-y: hidden;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.tg-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 60px 16px 12px;
  z-index: 10;
}

.tg-back {
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-radius: 99px;
  height: 48px;
  width: 48px;
  padding: 0;
  color: var(--white);
  cursor: default;
}

.tg-title-pill {
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-radius: 99px;
  height: 48px;
  padding: 0 28px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.tg-title-name {
  font-weight: 600;
  color: var(--white);
  font-size: 16px;
  line-height: 1.2;
}

.tg-title-sub {
  font-size: 13px;
  color: var(--muted);
}

.tg-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: #111;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.1);
}

.tg-messages-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 0 16px 20px;
  gap: 8px;
}

.tg-date-pill {
  align-self: center;
  background: rgba(0, 0, 0, 0.2);
  color: #fff;
  font-size: 12px;
  font-weight: 500;
  padding: 4px 12px;
  border-radius: 12px;
  margin: 8px 0;
}

.tg-message {
  max-width: 82%;
  padding: 8px 12px;
  font-size: 0.95rem;
  line-height: 1.35;
  position: relative;
  color: var(--white);
  display: inline-flex;
  flex-direction: column;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
  opacity: 0;
  transform: translateY(20px) scale(0.95);
  transition: all 0.5s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.tg-message.show {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.tg-message-text {
  margin-bottom: 2px;
  word-break: break-word;
}

.tg-message-meta {
  float: right;
  align-self: flex-end;
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 2px;
  margin-left: 10px;
  margin-bottom: -4px;
}

.tg-time {
  font-size: 11px;
}

.tg-checks {
  display: flex;
  align-items: center;
  color: #8bb4e5;
  margin-left: 2px;
}

.incoming {
  align-self: flex-start;
  background-color: var(--s2);
  border-radius: 16px 16px 16px 4px;
}

.incoming .tg-time {
  color: var(--muted);
}

.incoming::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: -8px;
  width: 16px;
  height: 16px;
  background: var(--s2);
  clip-path: polygon(100% 0, 100% 100%, 0 100%);
  border-bottom-right-radius: 8px;
}

.outgoing {
  align-self: flex-end;
  background-color: #2b5278;
  border-radius: 16px 16px 4px 16px;
}

.outgoing .tg-time {
  color: #8bb4e5;
}

.outgoing .tg-checks {
  color: #8bb4e5;
}

.outgoing::after {
  content: '';
  position: absolute;
  bottom: 0;
  right: -8px;
  width: 16px;
  height: 16px;
  background: #2b5278;
  clip-path: polygon(0 0, 0 100%, 100% 100%);
  border-bottom-left-radius: 8px;
}

.tg-input-area {
  display: flex;
  align-items: center;
  padding: 16px 12px 24px;
  background: transparent;
  z-index: 10;
}

.tg-input-field {
  flex: 1;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 99px;
  padding: 10px 18px;
  display: flex;
  justify-content: space-between;
  font-size: 15px;
  color: rgba(255, 255, 255, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

@media (max-width: 640px) {
  #phone-scroll-section {
    margin-top: 2rem;
  }
}

/* ═══════════════════════════════════════════════════
   SCROLL HINT
   ═══════════════════════════════════════════════════ */
.scroll-down-hint {
  position: absolute;
  bottom: -4vh;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  opacity: 1;
  transition: opacity 0.5s cubic-bezier(0.16, 1, 0.3, 1), transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: none;
  z-index: 100;
}

.scroll-down-hint.hidden {
  opacity: 0;
  transform: translateX(-50%) translateY(20px);
}

.hint-text {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--dim);
}

.hint-icon {
  color: var(--muted);
  animation: hintBounce 2.5s infinite;
}

@keyframes hintBounce {
  0%, 20%, 50%, 80%, 100% {
    transform: translateY(0);
  }
  40% {
    transform: translateY(-8px);
  }
  60% {
    transform: translateY(-4px);
  }
}

/* ═══════════════════════════════════════════════════════════
   V2 OVERRIDES — phone mockup polish only.
   Everything else inherits the original visual.
   ═══════════════════════════════════════════════════════════ */

/* ─── Phone surrounds ──────────────────────────────────── */
#phone-scroll-section {
  position: relative;
}
#phone-scroll-section::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: min(680px, 90vw);
  height: min(680px, 90vw);
  background: radial-gradient(
    circle,
    rgba(255, 255, 255, 0.04) 0%,
    rgba(255, 255, 255, 0.015) 35%,
    transparent 65%
  );
  pointer-events: none;
  z-index: 0;
}

/* ─── Phone bezel — detailed, metallic ─────────────────── */
.phone-mockup {
  width: 400px;
  background:
    linear-gradient(150deg, #2c2c30 0%, #18181a 45%, #28282c 70%, #1d1d1f 100%);
  border-radius: 60px;
  padding: 7px;
  box-shadow:
    0 90px 180px rgba(0, 0, 0, 0.9),
    0 30px 60px rgba(0, 0, 0, 0.55),
    0 0 0 1px rgba(255, 255, 255, 0.09),
    0 0 0 2px rgba(0, 0, 0, 0.4),
    inset 0 0 0 1.5px rgba(255, 255, 255, 0.05),
    inset 0 2px 0 rgba(255, 255, 255, 0.14),
    inset 0 -2px 0 rgba(0, 0, 0, 0.4);
}

.phone-screen {
  border-radius: 53px;
  position: relative;
}

/* Glossy diagonal reflection across the screen */
.phone-screen::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 53px;
  background: linear-gradient(
    155deg,
    rgba(255, 255, 255, 0.06) 0%,
    rgba(255, 255, 255, 0.015) 18%,
    transparent 35%
  );
  pointer-events: none;
  z-index: 200;
  mix-blend-mode: screen;
}

/* ─── Side buttons removed ─────────────────────────────── */
.phone-btn { display: none; }

/* Disable the old pseudo-element buttons */
.phone-mockup::before,
.phone-mockup::after { content: none; }

/* ─── Notch + camera lens ──────────────────────────────── */
.phone-notch::before {
  content: '';
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #1a3a5a 0%, #050a14 60%, #000 100%);
  box-shadow: inset 0 0 0 0.5px rgba(255, 255, 255, 0.08);
}

/* ─── Telegram chat polish ─────────────────────────────── */
.tg-header {
  border-bottom: none;
}
.tg-back, .tg-title-pill, .tg-avatar {
  background: rgba(255, 255, 255, 0.06);
  border: 0.5px solid rgba(255, 255, 255, 0.06);
  height: 42px;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}
.tg-back, .tg-avatar { width: 42px; }
.tg-title-pill { padding: 0 24px; }
.tg-title-name { font-size: 14.5px; font-weight: 600; }
.tg-title-sub { font-size: 11.5px; color: rgba(255, 255, 255, 0.5); }
.tg-avatar { padding: 0; overflow: hidden; }

.tg-messages-area {
  padding: 14px 14px 16px;
  gap: 6px;
}

.tg-date-pill {
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  font-size: 11px;
  padding: 3px 10px;
  border-radius: 10px;
}

.tg-message {
  max-width: 80%;
  padding: 9px 13px 7px;
  font-size: 15px;
  line-height: 1.42;
  border-radius: 16px 16px 16px 5px;
  box-shadow: 0 1px 1px rgba(0, 0, 0, 0.25);
  letter-spacing: 0.005em;
}
.tg-message.outgoing { border-radius: 16px 16px 5px 16px; }
.incoming { background: linear-gradient(180deg, #232326 0%, #1c1c1f 100%); }
.incoming::after {
  background: #1c1c1f;
  width: 14px; height: 14px; bottom: 0; left: -7px;
}
.outgoing { background: linear-gradient(180deg, #2f5d87 0%, #234c72 100%); }
.outgoing::after {
  background: #234c72;
  width: 14px; height: 14px; bottom: 0; right: -7px;
}
.tg-time { font-size: 10.5px; }
.tg-message-text { margin-bottom: 1px; }

.tg-input-area {
  padding: 12px 12px 22px;
  border-top: none;
}
.tg-input-field {
  background: rgba(255, 255, 255, 0.06);
  border: 0.5px solid rgba(255, 255, 255, 0.04);
  padding: 9px 16px;
  font-size: 14px;
}

/* Large-screen-only messages — hidden by default, shown on wide viewports */
.tg-msg-large {
  display: none;
}

@media (min-width: 900px) {
  .tg-msg-large {
    display: inline-flex;
  }
}

@media (max-width: 640px) {
  .phone-mockup {
    width: 300px;
    max-height: 78vh;
    max-height: 78svh;
  }
  .phone-mockup::before, .phone-mockup::after { display: none; }
  .tg-msg-extra { display: none; }

  /* Fix flex layout: header and input stay fixed size, messages shrink */
  .tg-chat-container {
    height: 100%;
    overflow: hidden;
  }
  .tg-header {
    flex-shrink: 0;
    padding: 52px 12px 8px;
  }
  .tg-messages-area {
    flex: 1;
    min-height: 0;
    overflow: hidden;
    padding: 10px 12px 10px;
    gap: 5px;
  }
  .tg-input-area {
    flex-shrink: 0;
    padding: 8px 10px 20px;
  }

  /* Tighten element sizes */
  .tg-back, .tg-avatar { width: 36px; height: 36px; }
  .tg-title-pill { height: 36px; padding: 0 16px; }
  .tg-title-name { font-size: 13px; }
  .tg-title-sub { font-size: 10.5px; }
  .tg-message {
    font-size: 13px;
    padding: 6px 10px 5px;
  }
  .tg-input-field {
    font-size: 13px;
    padding: 7px 14px;
  }
}
