/* Point A “site bar” credit — shared shell + pill (fixed corner or in-flow footer). */
@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600&display=swap");

.sitebar-badge {
  --badge-height: 44px;
  --badge-padding: 6px;
  --badge-radius: 999px;

  --shell-bg-top: #fafaf8;
  --shell-bg-bot: #ececea;
  --shell-border: rgba(0, 0, 0, 0.08);
  --shell-inner-top: rgba(255, 255, 255, 0.9);
  --shell-inner-bot: rgba(0, 0, 0, 0.05);
  --shell-text: #9a9a96;

  --pill-width: 108px;
  --pill-text: #f0f0ee;

  --pill-hl: rgba(255, 255, 255, 0.14);
  --pill-mid: #1a1a1a;
  --pill-shadow: rgba(0, 0, 0, 0.85);

  --sitebar-transition: 240ms cubic-bezier(0.22, 1, 0.36, 1);

  position: fixed;
  right: calc(24px + env(safe-area-inset-right, 0px));
  bottom: calc(20px + env(safe-area-inset-bottom, 0px));
  z-index: 90;

  width: max-content;
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  height: var(--badge-height);
  padding: var(--badge-padding);
  padding-left: 14px;
  padding-right: 10px;
  box-sizing: border-box;

  background: linear-gradient(180deg, var(--shell-bg-top) 0%, var(--shell-bg-bot) 100%);
  border: 1px solid var(--shell-border);
  border-radius: var(--badge-radius);
  text-decoration: none;
  user-select: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  overflow: visible;
  isolation: isolate;
  box-shadow:
    0 10px 24px rgba(0, 0, 0, 0.08),
    0 3px 8px rgba(0, 0, 0, 0.05),
    inset 0 1px 0 var(--shell-inner-top),
    inset 0 -1px 0 var(--shell-inner-bot);
  transition:
    transform var(--sitebar-transition),
    box-shadow var(--sitebar-transition),
    background var(--sitebar-transition);
}

.sitebar-badge__label,
.sitebar-badge__pill {
  position: relative;
  z-index: 1;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1;
  white-space: nowrap;
}

.sitebar-badge__label {
  flex-shrink: 0;
  padding-inline: 4px;
  color: var(--shell-text);
  font-size: 12.5px;
  font-weight: 500;
  letter-spacing: -0.005em;
  transition: color var(--sitebar-transition);
}

.sitebar-badge__pill {
  flex: none;
  width: var(--pill-width);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: calc(var(--badge-height) - (var(--badge-padding) * 2));
  border-radius: calc(var(--badge-radius) - 6px);
  background:
    radial-gradient(120% 160% at 0% 0%, rgba(255, 255, 255, 0.22) 0%, rgba(255, 255, 255, 0) 55%),
    radial-gradient(140% 160% at 100% 100%, rgba(0, 0, 0, 0.55) 0%, rgba(0, 0, 0, 0) 60%),
    linear-gradient(135deg, #2a2a2a 0%, #151515 45%, #060606 100%);
  color: var(--pill-text);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.01em;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.04) inset,
    0 -1px 0 rgba(0, 0, 0, 0.6) inset,
    0 8px 16px rgba(0, 0, 0, 0.22),
    0 1px 2px rgba(0, 0, 0, 0.35);
  transition:
    background var(--sitebar-transition),
    color var(--sitebar-transition),
    box-shadow var(--sitebar-transition),
    transform var(--sitebar-transition);
}

.sitebar-badge:hover {
  transform: translateY(0.5px);
  box-shadow:
    0 8px 20px rgba(0, 0, 0, 0.07),
    0 2px 6px rgba(0, 0, 0, 0.04),
    inset 0 1px 0 rgba(255, 255, 255, 0.85),
    inset 0 -1px 0 rgba(0, 0, 0, 0.06);
}

.sitebar-badge:hover .sitebar-badge__label {
  color: #8a8a86;
}

.sitebar-badge:hover .sitebar-badge__pill {
  color: #2a2a2a;
  transform: none;
  background: linear-gradient(180deg, #ececea 0%, #f4f4f2 100%);
  box-shadow:
    inset 2px 2px 5px rgba(0, 0, 0, 0.14),
    inset -2px -2px 5px rgba(255, 255, 255, 0.55),
    inset 0 0 0 1px rgba(0, 0, 0, 0.05),
    0 0 0 1px rgba(0, 0, 0, 0.03);
}

.sitebar-badge:active .sitebar-badge__pill {
  transform: none;
  box-shadow:
    inset 3px 3px 6px rgba(0, 0, 0, 0.18),
    inset -2px -2px 5px rgba(255, 255, 255, 0.5),
    inset 0 0 0 1px rgba(0, 0, 0, 0.06);
}

@media (max-width: 420px) {
  .sitebar-badge {
    --badge-height: 40px;
    --pill-width: 94px;
    gap: 6px;
    padding-left: 12px;
    right: calc(18px + env(safe-area-inset-right, 0px));
    bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  }

  .sitebar-badge__label { font-size: 11.5px; }
  .sitebar-badge__pill  { font-size: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  .sitebar-badge,
  .sitebar-badge__label,
  .sitebar-badge__pill {
    transition: none;
  }

  .sitebar-badge:hover,
  .sitebar-badge:hover .sitebar-badge__pill,
  .sitebar-badge:active .sitebar-badge__pill {
    transform: none;
  }
}

/* ---------------------------------------------------------------------------
   In-document footer placement (docserver): add class sitebar-badge--in-flow
   on the anchor and wrap with .sitebar-badge-slot inside .company-footer.
   --------------------------------------------------------------------------- */

.sitebar-badge.sitebar-badge--in-flow {
  position: static;
  right: auto;
  bottom: auto;
  z-index: auto;
}

.sitebar-badge-slot {
  display: flex;
  justify-content: flex-end;
  flex-wrap: wrap;
  align-items: center;
  padding-top: 16px;
  padding-bottom: calc(16px + env(safe-area-inset-bottom, 0px));
}

@media (max-width: 420px) {
  .sitebar-badge.sitebar-badge--in-flow {
    right: auto;
    bottom: auto;
  }
}

/* Rezco: slot after footer inside .page-wrapper — overlay lower-right, above footer */
.page-wrapper > .sitebar-badge-slot {
  position: absolute;
  right: var(--section-padding-x, clamp(20px, 5vw, 64px));
  bottom: var(--space-lg, 24px);
  z-index: 10;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  flex-wrap: wrap;
  width: auto;
  max-width: none;
  margin: 0;
  padding-top: 0;
  padding-inline: 0;
  padding-bottom: env(safe-area-inset-bottom, 0px);
  pointer-events: none;
}

.page-wrapper > .sitebar-badge-slot .sitebar-badge {
  pointer-events: auto;
}
