.pi-data-freshness {
  position: fixed;
  z-index: 58;
  top: calc(var(--pi-chrome-h, 58px) + 8px);
  inset-inline-start: 14px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  max-width: calc(100vw - 28px);
  min-height: 30px;
  padding: 5px 10px;
  border: 1px solid rgba(32, 214, 162, 0.28);
  border-radius: 999px;
  background: rgba(6, 11, 20, 0.78);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.2);
  color: #d9fbee;
  font-size: 11.5px;
  font-weight: 800;
  line-height: 1.2;
  white-space: nowrap;
  pointer-events: none;
  -webkit-backdrop-filter: blur(5px);
  backdrop-filter: blur(5px);
}

.pi-data-freshness i {
  width: 7px;
  height: 7px;
  flex: 0 0 7px;
  border-radius: 50%;
  background: #20d6a2;
  box-shadow: 0 0 0 3px rgba(32, 214, 162, 0.12);
}

.pi-data-freshness[data-freshness-state="stale"],
.pi-data-freshness[data-freshness-state="old"] {
  border-color: rgba(242, 194, 48, 0.3);
  color: #ffe48b;
}

.pi-data-freshness[data-freshness-state="stale"] i,
.pi-data-freshness[data-freshness-state="old"] i {
  background: #f2c230;
  box-shadow: 0 0 0 3px rgba(242, 194, 48, 0.12);
}

.pi-data-freshness[data-freshness-state="unknown"] {
  border-color: rgba(148, 163, 184, 0.24);
  color: #aebdd0;
}

.pi-data-freshness[data-freshness-state="unknown"] i {
  background: #7f8ea3;
  box-shadow: none;
}

/* Home page: the inline notice under the title replaces the floating badge. */
.pi-home-update-active .pi-data-freshness { display: none !important; }

.pi-home-update {
  order: 50;
  flex: 0 0 100%;
  display: flex;
  justify-content: flex-start;
  min-width: 0;
  margin-top: 2px;
}

.pi-home-update__pill {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 7px;
  max-width: 100%;
  padding: 6px 13px;
  border: 1px solid rgba(32, 214, 162, 0.32);
  border-radius: 999px;
  background: rgba(32, 214, 162, 0.08);
  color: #d9fbee;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.35;
}

.pi-home-update__pill i {
  width: 8px;
  height: 8px;
  flex: 0 0 8px;
  border-radius: 50%;
  background: #20d6a2;
  box-shadow: 0 0 0 3px rgba(32, 214, 162, 0.14);
}

.pi-home-update__label { color: #c4cfdd; }
.pi-home-update__date { color: #f8fafc; font-weight: 800; font-variant-numeric: tabular-nums; }
.pi-home-update__age { font-weight: 700; }
.pi-home-update__sep { color: #64748b; }
.pi-home-update__cutoff { color: #aebdd0; }
.pi-home-update__cutoff bdi { color: #e2e8f0; font-weight: 700; font-variant-numeric: tabular-nums; }

.pi-home-update[data-freshness-state="stale"] .pi-home-update__pill,
.pi-home-update[data-freshness-state="old"] .pi-home-update__pill {
  border-color: rgba(242, 194, 48, 0.36);
  background: rgba(242, 194, 48, 0.08);
}

.pi-home-update[data-freshness-state="stale"] .pi-home-update__pill i,
.pi-home-update[data-freshness-state="old"] .pi-home-update__pill i {
  background: #f2c230;
  box-shadow: 0 0 0 3px rgba(242, 194, 48, 0.14);
}

.pi-home-update[data-freshness-state="stale"] .pi-home-update__age,
.pi-home-update[data-freshness-state="old"] .pi-home-update__age { color: #ffe48b; }

.pi-home-update[data-freshness-state="unknown"] .pi-home-update__pill {
  border-color: rgba(148, 163, 184, 0.26);
  background: rgba(148, 163, 184, 0.06);
  color: #aebdd0;
}

.pi-home-update[data-freshness-state="unknown"] .pi-home-update__pill i {
  background: #7f8ea3;
  box-shadow: none;
}

@media print {
  .pi-home-update { display: none !important; }
}

@media (max-width: 760px) {
  .pi-data-freshness {
    top: calc(var(--pi-chrome-h, 52px) + 6px);
    inset-inline-start: 8px;
    min-height: 28px;
    padding: 5px 8px;
    font-size: 10.5px;
  }

  .pi-home-update {
    order: 0;
    flex: none;
    width: 100%;
    margin-top: 0;
  }

  .pi-home-update__pill {
    padding: 6px 11px;
    border-radius: 14px;
    font-size: 12px;
  }
}
