/* ==========================================================================
   IRONITT v2 — update bar (js/update-check.js)
   --------------------------------------------------------------------------
   "IRONITT 1.2.0 is ready · Update". It floats, so it carries the shadow;
   bottom centre, above the phone island when there is one. Slides up once
   (220 ms, transform/opacity); reduced motion only fades.
   ========================================================================== */
.update-bar {
  position: fixed;
  left: 0;
  right: 0;
  width: max-content;
  margin-inline: auto;
  bottom: calc(env(safe-area-inset-bottom, 0px) + var(--space-lg));
  z-index: var(--z-tooltip);
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  max-width: min(520px, calc(100vw - 2 * var(--space-md)));
  padding: 6px 6px 6px 14px;
  border-radius: var(--radius-pill);
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-lg);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: var(--font-size-sm);
  opacity: 0;
  transform: translate3d(0, 16px, 0);
  pointer-events: none;
  transition: opacity 220ms ease, transform 220ms var(--ease-glide, ease);
}
.update-bar.is-open { opacity: 1; transform: none; pointer-events: auto; }
.update-bar-mark {
  flex: none;
  width: 22px;
  height: 22px;
  background: url("/assets/brand/mark-flat.svg?v=20261027a") center / contain no-repeat;
}
.update-bar-text { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.update-bar-action {
  flex: none;
  height: 32px;
  padding: 0 14px;
  border: 0;
  border-radius: var(--radius-pill);
  background: var(--accent-color);
  color: var(--accent-text);
  font: inherit;
  font-weight: var(--font-weight-semibold);
  cursor: pointer;
}
.update-bar-action[hidden] { display: none; }
.update-bar-close {
  flex: none;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: var(--radius-round);
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
}
.update-bar-close:hover { background: var(--bg-hover); color: var(--text-primary); }
.update-bar :focus-visible { outline: 0; box-shadow: var(--focus-ring); }

/* Phones in the app: above the bottom island (it steps aside in a
   conversation and while typing, and the bar follows it down). */
@media (max-width: 768px) {
  body:has(.nav-island-wrapper) .update-bar {
    bottom: calc(var(--mobile-nav-h, 64px) + env(safe-area-inset-bottom, 0px) + var(--space-lg));
  }
  html:is(.in-conversation, .kb-open) body:has(.nav-island-wrapper) .update-bar {
    bottom: calc(env(safe-area-inset-bottom, 0px) + 84px);
  }
  .update-bar-text { white-space: normal; line-height: 1.3; }
}
@media (prefers-reduced-motion: reduce) {
  .update-bar { transition: opacity 150ms ease; transform: none; }
}
