/* Latest Updates bar (home page).
   One update is shown at a time; the bar stays hidden until the API returns
   at least one active update. Site-wide sheets restyle every button and
   paragraph with !important, so the control and text rules below are scoped
   to body#home and marked !important where those sheets would otherwise win. */
body#home .gx-updates {
  --gxu-ink: #0b2a6b;
  --gxu-muted: #5a6b8c;
  --gxu-line: #dce5f5;
  --gxu-blue: #1257e0;
  --gxu-gold: #f5b81f;
  order: 2;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  grid-template-areas: "label body nav";
  align-items: center;
  gap: 16px;
  width: min(1180px, calc(100% - 48px));
  min-height: 60px;
  margin: 22px auto 0;
  padding: 10px 14px 10px 16px;
  border: 1px solid var(--gxu-line);
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 8px 20px rgba(28, 57, 108, .07);
}

body#home .gx-updates[hidden] { display: none !important; }

body#home .gx-updates__label {
  grid-area: label;
  display: flex;
  align-items: center;
  gap: 9px;
  padding-right: 16px;
  border-right: 1px solid var(--gxu-line);
  color: var(--gxu-ink);
  font: 800 12px/1 Inter, Arial, sans-serif !important;
  letter-spacing: .12em !important;
  text-transform: uppercase;
}

body#home .gx-updates__bell {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: #eaf2ff;
  color: #1257e0;
}

body#home .gx-updates__bell lucide-icon { width: 18px; height: 18px; font-size: 18px; }

body#home .gx-updates__body {
  grid-area: body;
  min-width: 0;
}

body#home .gx-updates__item {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  padding: 4px 6px;
  border-radius: 8px;
  color: var(--gxu-ink);
  text-decoration: none;
  animation: gx-update-in .28s ease both;
}

body#home a.gx-updates__item:hover .gx-updates__title { text-decoration: underline; text-underline-offset: 3px; }

body#home .gx-updates__category {
  flex: 0 0 auto;
  padding: 5px 9px;
  border: 1px solid #cfe0ff;
  border-radius: 999px;
  background: #eef4ff;
  color: var(--gxu-blue);
  font: 700 11px/1 Inter, Arial, sans-serif !important;
  letter-spacing: .02em !important;
  white-space: nowrap;
}

/* Important and featured updates get a gold badge with a star, so the
   emphasis does not depend on colour alone. */
body#home .gx-updates__item[data-priority="important"] .gx-updates__category,
body#home .gx-updates__item[data-priority="featured"] .gx-updates__category {
  border-color: #f1d68a;
  background: #fff6dc;
  color: #7a5200;
}

body#home .gx-updates__item[data-priority="important"] .gx-updates__category::before,
body#home .gx-updates__item[data-priority="featured"] .gx-updates__category::before {
  content: "\2605";
  margin-right: 4px;
}

body#home .gx-updates__title {
  min-width: 0;
  overflow: hidden;
  color: var(--gxu-ink);
  font: 600 15px/1.35 Inter, Arial, sans-serif !important;
  letter-spacing: 0 !important;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body#home .gx-updates__cta {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--gxu-blue);
  font: 700 13px/1 Inter, Arial, sans-serif !important;
  white-space: nowrap;
}

body#home .gx-updates__cta lucide-icon { width: 14px; height: 14px; font-size: 14px; }

body#home .gx-updates__nav {
  grid-area: nav;
  display: flex;
  align-items: center;
  gap: 6px;
}

body#home .gx-updates__nav[hidden] { display: none !important; }

body#home .gx-updates__btn {
  all: unset;
  box-sizing: border-box;
  display: grid !important;
  place-items: center;
  width: 36px !important;
  height: 36px !important;
  min-width: 36px !important;
  min-height: 36px !important;
  padding: 0 !important;
  border: 1px solid var(--gxu-line) !important;
  border-radius: 50% !important;
  background: #fff !important;
  box-shadow: none !important;
  color: var(--gxu-ink) !important;
  cursor: pointer;
  transform: none !important;
  transition: background-color .15s ease, border-color .15s ease;
}

body#home .gx-updates__btn lucide-icon { width: 16px; height: 16px; font-size: 16px; }

body#home .gx-updates__btn:hover {
  border-color: #b9cdf7 !important;
  background: #eef4ff !important;
}

body#home .gx-updates__btn:focus-visible,
body#home a.gx-updates__item:focus-visible {
  outline: 2px solid var(--gxu-blue);
  outline-offset: 2px;
}

@keyframes gx-update-in {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 900px) {
  body#home .gx-updates { gap: 12px; padding-inline: 12px; }
  body#home .gx-updates__label { padding-right: 12px; }
  body#home .gx-updates__title { font-size: 14px !important; }
}

@media (max-width: 680px) {
  /* Phones: label and controls on the first row, the headline below it. */
  body#home .gx-updates {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      "label nav"
      "body body";
    gap: 8px 10px;
    width: calc(100% - 28px);
    margin-top: 16px;
    padding: 10px 12px 12px;
    border-radius: 12px;
  }

  body#home .gx-updates__label { padding-right: 0; border-right: 0; font-size: 11px !important; }
  body#home .gx-updates__bell { width: 30px; height: 30px; }

  body#home .gx-updates__item {
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 6px 8px;
    padding: 2px 0;
  }

  body#home .gx-updates__title {
    flex: 1 1 100%;
    order: 2;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    white-space: normal;
    overflow-wrap: anywhere;
  }

  body#home .gx-updates__category { order: 1; }
  body#home .gx-updates__cta { order: 3; }

  body#home .gx-updates__btn {
    width: 44px !important;
    height: 44px !important;
    min-width: 44px !important;
    min-height: 44px !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  body#home .gx-updates__item { animation: none; }
  body#home .gx-updates__btn { transition: none; }
}
