:root {
  --shell-ptr-pull: 0px;
  --shell-ptr-progress: 0;
}

.shell-announcement-bar {
  position: relative;
  overflow: hidden;
  flex-shrink: 0;
  transition:
    min-height 0.08s linear,
    flex-basis 0.08s linear;
}

.shell-announcement-bar.is-ptr-active {
  flex: 0 0 calc(var(--platform-shell-announcement) + var(--shell-ptr-pull));
  min-height: calc(var(--platform-shell-announcement) + var(--shell-ptr-pull));
}

.shell-announcement-bar.is-ptr-active .shell-announcement-bar__inner,
.shell-announcement-bar.is-ptr-active .shell-announcement-bar__progress {
  opacity: 0;
  pointer-events: none;
  max-height: 0;
  overflow: hidden;
}

.shell-ptr-panel {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: grid;
  place-items: center;
  width: 100%;
  min-height: calc(var(--platform-shell-announcement) + var(--shell-ptr-pull));
  padding: 10px 14px 8px;
  box-sizing: border-box;
  opacity: clamp(0, calc((var(--shell-ptr-pull) - 8px) / 56px), 1);
  transform: scale(clamp(0.86, calc(0.86 + (0.14 * var(--shell-ptr-progress))), 1));
  pointer-events: none;
}

.shell-ptr-panel[hidden] {
  display: none !important;
}

.shell-ptr-panel__content {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-height: 68px;
  text-align: center;
}

.shell-ptr-panel__label {
  margin: 0;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.01em;
  color: color-mix(in srgb, var(--shell-muted, #94a3b8) 88%, white);
}

.shell-ptr-panel__badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 20px;
  padding: 0 8px;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--neo-accent, #7c6cff) 28%, #334155);
  background: color-mix(in srgb, var(--neo-accent, #7c6cff) 10%, rgba(7, 15, 33, 0.88));
  color: color-mix(in srgb, var(--neo-accent, #7c6cff) 18%, white);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.04em;
  font-variant-numeric: tabular-nums;
}

.shell-ptr-buddy {
  display: block;
  width: 36px;
  height: 36px;
  transform-origin: center bottom;
  transform:
    translateY(calc(-7px * (1 - var(--shell-ptr-progress))))
    rotate(calc(-10deg * (1 - var(--shell-ptr-progress))))
    scaleY(calc(0.68 + (0.42 * var(--shell-ptr-progress))));
  color: var(--shell-text, #f6f7fb);
}

.shell-ptr-buddy__svg {
  width: 100%;
  height: 100%;
  overflow: visible;
}

.shell-ptr-buddy__face {
  fill: var(--shell-text, #f6f7fb);
}

.shell-ptr-buddy__eye {
  fill: var(--shell-surface, #081124);
}

.shell-ptr-buddy__orbit {
  color: var(--shell-muted, #94a3b8);
  opacity: calc(var(--shell-ptr-progress) * 0.35);
  transform-origin: 18px 18px;
  transform: rotate(calc(-35deg + (35deg * var(--shell-ptr-progress))));
  transition: opacity 0.16s ease, transform 0.22s cubic-bezier(0.22, 1, 0.36, 1);
}

.shell-announcement-bar.is-ptr-ready .shell-ptr-buddy__orbit,
.shell-announcement-bar.is-ptr-refreshing .shell-ptr-buddy__orbit {
  opacity: 1;
  transform: rotate(0deg);
}

.shell-ptr-buddy__orbit-dot {
  fill: var(--shell-text, #f6f7fb);
}

.shell-ptr-buddy__mouth {
  stroke: var(--shell-surface, #081124);
}

.shell-ptr-buddy__mouth--flat {
  opacity: calc(1 - min(1, var(--shell-ptr-progress) * 1.4));
}

.shell-ptr-buddy__mouth--smile {
  opacity: 0;
}

.shell-announcement-bar.is-ptr-ready .shell-ptr-buddy__mouth--flat,
.shell-announcement-bar.is-ptr-refreshing .shell-ptr-buddy__mouth--flat {
  opacity: 0;
}

.shell-announcement-bar.is-ptr-ready .shell-ptr-buddy__mouth--smile {
  opacity: 1;
}

.shell-ptr-buddy__mouth--o {
  opacity: 0;
}

.shell-announcement-bar.is-ptr-refreshing .shell-ptr-buddy__mouth--o {
  opacity: 1;
}

.shell-announcement-bar.is-ptr-refreshing .shell-ptr-buddy {
  animation: shell-ptr-buddy-refresh 0.9s ease-in-out infinite;
}

.shell-announcement-bar.is-ptr-refreshing .shell-ptr-buddy__orbit {
  animation: shell-ptr-orbit-spin 0.9s ease-in-out infinite;
}

.shell-announcement-bar.is-ptr-refreshing .shell-ptr-buddy__eyes {
  animation: shell-ptr-blink 0.9s ease-in-out infinite;
  transform-origin: 18px 16px;
}

@keyframes shell-ptr-buddy-refresh {
  0%, 100% { transform: translateY(0) rotate(0deg) scaleY(1); }
  50% { transform: translateY(-2px) rotate(3deg) scaleY(1.02); }
}

@keyframes shell-ptr-orbit-spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

@keyframes shell-ptr-blink {
  0%, 44%, 56%, 100% { transform: scaleY(1); }
  50% { transform: scaleY(0.15); }
}

html[data-shell-ptr-active="true"] .platform-shell {
  cursor: grabbing;
}

html[data-shell-ptr-active="true"][data-shell-ptr-state="refreshing"] .platform-shell,
html[data-shell-ptr-active="true"][data-shell-ptr-state="done"] .platform-shell {
  cursor: default;
}

html[data-shell-ptr-settling="true"] .shell-announcement-bar.is-ptr-active {
  transition:
    min-height 0.42s cubic-bezier(0.22, 1, 0.36, 1),
    flex-basis 0.42s cubic-bezier(0.22, 1, 0.36, 1);
}

@media (prefers-reduced-motion: reduce) {
  html[data-shell-ptr-settling="true"] .shell-announcement-bar.is-ptr-active {
    transition: none;
  }

  .shell-announcement-bar.is-ptr-refreshing .shell-ptr-buddy,
  .shell-announcement-bar.is-ptr-refreshing .shell-ptr-buddy__orbit,
  .shell-announcement-bar.is-ptr-refreshing .shell-ptr-buddy__eyes {
    animation: shell-ptr-calm-pulse 1.2s ease-in-out infinite;
  }

  @keyframes shell-ptr-calm-pulse {
    0%, 100% { opacity: 0.55; }
    50% { opacity: 1; }
  }
}
