/* GreenChat update notice — compact, quiet and shared by PWA/native optional updates.
   Loaded as a same-origin static stylesheet so the production CSP stays free of inline styles. */

.gc-pwa-update.gc-update-notice {
  width: min(calc(100vw - 24px), 430px);
  max-width: none;
  bottom: calc(12px + var(--gc-safe-bottom));
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) auto 36px;
  align-items: center;
  gap: 10px;
  padding: 9px 9px 9px 10px;
  overflow: hidden;
  border: 1px solid var(--gc-border);
  border-radius: 18px;
  background: var(--gc-bg-elevated);
  background: linear-gradient(110deg, color-mix(in srgb, var(--gc-accent) 7%, var(--gc-bg-elevated)), var(--gc-bg-elevated) 48%);
  box-shadow: 0 12px 36px rgba(10, 35, 24, 0.14), 0 2px 8px rgba(10, 35, 24, 0.08);
  backdrop-filter: blur(18px) saturate(1.12);
  -webkit-backdrop-filter: blur(18px) saturate(1.12);
  animation: gc-update-notice-in 220ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
  isolation: isolate;
}

.gc-pwa-update.gc-update-notice::before {
  content: "↻";
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  color: var(--gc-accent-strong);
  background: var(--gc-hover);
  background: color-mix(in srgb, var(--gc-accent) 12%, var(--gc-bg-elevated));
  font-size: 20px;
  font-weight: 650;
  line-height: 1;
}

.gc-pwa-update.gc-update-notice .gc-pwa-update-text {
  min-width: 0;
  overflow: hidden;
  color: var(--gc-fg);
  font-size: var(--gc-fs-13);
  font-weight: 620;
  line-height: 1.3;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.gc-pwa-update.gc-update-notice .gc-btn-accent {
  min-height: 34px;
  padding: 0 13px;
  border-radius: 11px;
  box-shadow: none;
  font-size: var(--gc-fs-13);
  font-weight: 650;
  white-space: nowrap;
}

.gc-pwa-update.gc-update-notice .gc-update-notice-dismiss {
  position: relative;
  width: 36px;
  height: 36px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: var(--gc-fg-muted);
  cursor: pointer;
  transition: color 140ms ease, background-color 140ms ease, transform 140ms ease;
}

.gc-pwa-update.gc-update-notice .gc-update-notice-dismiss::before,
.gc-pwa-update.gc-update-notice .gc-update-notice-dismiss::after {
  content: "";
  position: absolute;
  width: 14px;
  height: 1.6px;
  border-radius: 999px;
  background: currentColor;
}

.gc-pwa-update.gc-update-notice .gc-update-notice-dismiss::before {
  transform: rotate(45deg);
}

.gc-pwa-update.gc-update-notice .gc-update-notice-dismiss::after {
  transform: rotate(-45deg);
}

.gc-pwa-update.gc-update-notice .gc-update-notice-dismiss:hover {
  background: var(--gc-hover);
  color: var(--gc-fg);
}

.gc-pwa-update.gc-update-notice .gc-update-notice-dismiss:active {
  transform: scale(0.94);
}

.gc-pwa-update.gc-update-notice .gc-update-notice-dismiss:focus-visible {
  outline: 2px solid var(--gc-accent);
  outline-offset: 2px;
}

[data-theme="dark"] .gc-pwa-update.gc-update-notice {
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.34), 0 2px 10px rgba(0, 0, 0, 0.22);
}

@keyframes gc-update-notice-in {
  from {
    opacity: 0;
    transform: translate(-50%, 8px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: translate(-50%, 0) scale(1);
  }
}

@media (max-width: 359px) {
  .gc-pwa-update.gc-update-notice {
    grid-template-columns: 34px minmax(0, 1fr) 34px;
    gap: 8px;
    padding: 8px;
  }

  .gc-pwa-update.gc-update-notice::before,
  .gc-pwa-update.gc-update-notice .gc-update-notice-dismiss {
    width: 34px;
    height: 34px;
  }

  .gc-pwa-update.gc-update-notice .gc-btn-accent {
    grid-column: 2 / 4;
    justify-self: start;
  }

  .gc-pwa-update.gc-update-notice .gc-update-notice-dismiss {
    grid-column: 3;
    grid-row: 1;
  }
}

@media (prefers-reduced-motion: reduce) {
  .gc-pwa-update.gc-update-notice {
    animation: none;
  }

  .gc-pwa-update.gc-update-notice .gc-update-notice-dismiss {
    transition: none;
  }
}
