/* Profile header (header.js, 15 Oct 2026): tools row top right (Report an error, Save, Share), the tiles straight under
   the title, one compact action row under the tiles. Scoped to header.cec-hdr so nothing else moves. Hyphens only. */

/* ---- tools row ---- */
body.ux.cec .cec-hdr .cec-hdr-tools { display: flex; flex-direction: column; align-items: flex-end; gap: 0.6rem; min-width: 0; }
body.ux.cec .cec-hdr .cec-hdr-btns { position: relative; display: flex; align-items: center; justify-content: flex-end; gap: 0.5rem; flex-wrap: nowrap; }
body.ux.cec .cec-hdr .cec-hdr-btns .cec-rep-btn { margin: 0 !important; }
body.ux.cec .cec-hdr .cec-hdr-btns a.cec-ib { text-decoration: none; }
body.ux.cec .cec-hdr .cec-hdr-btns .cec-rep-btn { width: 44px; }
body.ux.cec .cec-hdr .cec-hdr-btns .cec-ro-note { display: none; }
body.ux.cec .cec-hdr .cec-hdr-tools > .cec-ro-note { margin: 0; max-width: 340px; text-align: right; font-size: 0.8rem; }
body.ux.cec .cec-hdr-next > .ux-toast { flex: 1 1 100%; box-sizing: border-box; margin: 0; padding: 0.6rem 0.9rem; font-size: 0.85rem; line-height: 1.45; text-align: left;
  background: #fff; border: 1px solid var(--c-line); border-left: 4px solid #1d7a45; border-radius: 12px; box-shadow: var(--c-sh-sm); }
body.ux.cec .cec-hdr-next > .ux-toast a { color: var(--c-accent-ink); font-weight: 700; text-decoration: underline; text-underline-offset: 2px; }

/* ---- round icon buttons (secondary version of the red search circle) ---- */
body.ux.cec .cec-hdr .cec-ib-wrap { position: static; display: inline-flex; margin: 0; padding: 0; border: 0; }
body.ux.cec .cec-hdr .cec-ib { position: relative; display: inline-flex; align-items: center; justify-content: center; flex: none; box-sizing: border-box;
  width: 44px; height: 44px; margin: 0; padding: 0; border-radius: 50%; border: 1px solid var(--c-line-strong); background: #fff; color: var(--c-accent);
  box-shadow: var(--c-sh-sm); cursor: pointer; list-style: none; font: inherit; -webkit-tap-highlight-color: transparent;
  transition: background 200ms var(--c-ease), color 200ms var(--c-ease), border-color 200ms var(--c-ease), transform 200ms var(--c-ease), box-shadow 200ms var(--c-ease); }
body.ux.cec .cec-hdr summary.cec-ib::-webkit-details-marker { display: none; }
body.ux.cec .cec-hdr summary.cec-ib::marker { content: ""; }
body.ux.cec .cec-hdr .cec-ib-ico { display: block; flex: none; }
body.ux.cec .cec-hdr .cec-ib:hover, body.ux.cec .cec-hdr details[open] > summary.cec-ib, body.ux.cec .cec-hdr .cec-ib[aria-pressed="true"] {
  background: linear-gradient(180deg, var(--c-accent), var(--c-accent-ink)); border-color: var(--c-accent-ink); color: #fff; }
body.ux.cec .cec-hdr .cec-ib:hover { transform: translateY(-1px); box-shadow: 0 2px 4px rgba(0,0,0,.16), 0 10px 22px rgba(200,16,46,.26); }
body.ux.cec .cec-hdr .cec-ib:focus-visible { outline: 3px solid var(--c-accent); outline-offset: 2px; }
body.ux.cec .cec-hdr .cec-ib:disabled { cursor: not-allowed; opacity: 0.55; transform: none; background: #fff; color: var(--c-accent); border-color: var(--c-line-strong); box-shadow: none; }
/* saved: the floppy is filled */
body.ux.cec .cec-hdr .cec-ib[aria-pressed="true"] .fd-body { fill: currentColor; }
body.ux.cec .cec-hdr .cec-ib[aria-pressed="true"] .fd-in { stroke: var(--c-accent-ink); }

/* visible tooltip (hover and keyboard focus) */
body.ux.cec .cec-hdr .cec-ib-tip { position: absolute; top: calc(100% + 8px); right: 0; z-index: 41; white-space: nowrap; padding: 0.3rem 0.6rem;
  border-radius: 8px; background: var(--c-deep); color: #fff; font-size: 0.75rem; font-weight: 700; line-height: 1.3; letter-spacing: 0; text-transform: none;
  pointer-events: none; opacity: 0; transform: translateY(-3px); transition: opacity 150ms ease, transform 150ms ease; }
body.ux.cec .cec-hdr .cec-ib:hover .cec-ib-tip, body.ux.cec .cec-hdr .cec-ib:focus-visible .cec-ib-tip { opacity: 1; transform: none; }
body.ux.cec .cec-hdr details[open] > .cec-ib .cec-ib-tip { opacity: 0; }
@media (hover: none) { body.ux.cec .cec-hdr .cec-ib:hover .cec-ib-tip { opacity: 0; } body.ux.cec .cec-hdr .cec-ib:hover { transform: none; } }
@media (prefers-reduced-motion: reduce) { body.ux.cec .cec-hdr .cec-ib, body.ux.cec .cec-hdr .cec-ib-tip { transition: none; } body.ux.cec .cec-hdr .cec-ib:hover { transform: none; } }

/* popovers (Share, and the Saved menu) anchor to the tools row so they never run off a phone screen */
body.ux.cec .cec-hdr .cec-pop { position: absolute; top: calc(100% + 8px); right: 0; z-index: 40; box-sizing: border-box; width: 250px; max-width: calc(100vw - 32px);
  margin: 0; padding: 0.4rem; background: #fff; border: 1px solid var(--c-line); border-radius: 14px; box-shadow: var(--ux-shadow-pop); text-align: left; }
body.ux.cec .cec-hdr details:not([open]) > .cec-pop { display: none; }   /* followup 15 Oct: a closed popover takes no space (it was widening the page by 2px at 390) */
body.ux.cec .cec-hdr .cec-pop form { display: block; margin: 0; }
body.ux.cec .cec-hdr .cec-pop .cec-pop-item, body.ux.cec .cec-hdr .cec-pop a, body.ux.cec .cec-hdr .cec-pop button {
  display: flex; align-items: center; gap: 0.6rem; box-sizing: border-box; width: 100%; min-height: 44px; margin: 0; padding: 0.55rem 0.75rem; border: 0; border-radius: 10px;
  background: transparent; color: var(--ux-ink); font: inherit; font-size: 0.9rem; font-weight: 700; line-height: 1.3; text-decoration: none; text-align: left; cursor: pointer; box-shadow: none; }
body.ux.cec .cec-hdr .cec-pop .cec-pop-item[hidden] { display: none; }
body.ux.cec .cec-hdr .cec-pop a:hover, body.ux.cec .cec-hdr .cec-pop button:hover, body.ux.cec .cec-hdr .cec-pop a:focus-visible, body.ux.cec .cec-hdr .cec-pop button:focus-visible {
  background: var(--c-pale); color: var(--c-accent-ink); outline: none; transform: none; }
body.ux.cec .cec-hdr .cec-pop a:focus-visible, body.ux.cec .cec-hdr .cec-pop button:focus-visible { box-shadow: inset 0 0 0 2px var(--c-accent); }
body.ux.cec .cec-hdr .cec-pop svg { flex: none; color: var(--c-accent); }
body.ux.cec .cec-hdr .cec-pop-status { margin: 0.15rem 0.75rem 0.35rem; font-size: 0.82rem; font-weight: 700; color: #1d6b3a; }
body.ux.cec .cec-hdr .cec-pop-status:empty { margin: 0; }
.cec-sr { position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* ---- action row: How am I connected?, the claim line and the other header links ---- */
body.ux.cec .cec-hdr-next { display: flex; flex-wrap: wrap; align-items: center; gap: 0.6rem 0.9rem; margin: 1.1rem 0 0; min-width: 0; }
body.ux.cec .cec-hdr-nextwrap .cec-hdr-next { margin: -0.2rem 0 1.25rem; }
body.ux.cec .cec-hdr-next .btn { min-height: 44px; }
body.ux.cec .cec-hdr-next .cec-hdr-primary svg { flex: none; }
body.ux.cec .cec-hdr-next form.ux-inline { display: inline-flex; margin: 0; }
body.ux.cec .cec-hdr-next .ux-menu { position: relative; }
body.ux.cec .cec-hdr-next .ux-menu-panel, body.ux.cec .cec-hdr-next .ux-invite-form { z-index: 30; }
body.ux.cec .cec-hdr-next details.ux-invite-btn { position: relative; }
body.ux.cec .cec-hdr-next .ux-invite-form { position: absolute; left: 0; top: calc(100% + 0.4rem); width: min(380px, 86vw); box-sizing: border-box; background: #fff; border: 1px solid var(--c-line); border-radius: 14px; box-shadow: var(--ux-shadow-pop); padding: 0.9rem 1rem; }
@media (max-width: 600px) { body.ux.cec .cec-hdr-next .ux-invite-form { position: static; width: 100%; margin-top: 0.5rem; } }
body.ux.cec .cec-hdr-next .cec-hdr-claim { flex: 1 1 280px; margin: 0; font-size: 0.85rem; line-height: 1.5; color: var(--ux-muted, #5f6368); }
body.ux.cec .cec-hdr-next .cec-hdr-claim a { font-weight: 700; }

/* ---- layout with a contact box: one grid, so the tiles start level with the contact box and nothing floats ---- */
body.ux.cec header.cec-hdr .cec-ph-row:has(.cec-contact) { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
  grid-template-areas: "title tools" "kpis side" "next side"; grid-template-rows: auto auto 1fr; column-gap: 1.25rem; row-gap: 0; align-items: start; }
body.ux.cec header.cec-hdr .cec-ph-row:has(.cec-contact) > .cec-ph-text,
body.ux.cec header.cec-hdr .cec-ph-row:has(.cec-contact) > .btn-row { display: contents; }
body.ux.cec header.cec-hdr .cec-ph-row:has(.cec-contact) .cec-hdr-title { grid-area: title; min-width: 0; padding-top: 0.2rem; }
body.ux.cec header.cec-hdr .cec-ph-row:has(.cec-contact) .cec-hdr-tools { grid-area: tools; justify-self: end; }
body.ux.cec header.cec-hdr .cec-ph-row:has(.cec-contact) .cec-ph-kpis { grid-area: kpis; margin: 1.25rem 0 0; padding: 0; }
body.ux.cec header.cec-hdr .cec-ph-row:has(.cec-contact) .cec-hdr-next { grid-area: next; }
body.ux.cec header.cec-hdr .cec-ph-row:has(.cec-contact) .cec-contact { grid-area: side; margin-top: 1.25rem; height: auto; align-self: start; }
body.ux.cec header.cec-hdr .cec-hdr-title > :last-child { margin-bottom: 0; }

/* ---- layout without a contact box: title left, tools top right ---- */
body.ux.cec header.cec-hdr .cec-ph-row:not(:has(.cec-contact)) { align-items: flex-start; }
body.ux.cec header.cec-hdr .cec-ph-row:not(:has(.cec-contact)) > .btn-row { align-self: flex-start; margin-left: auto; }

/* ---- tablets and phones: tools under the title, then tiles, actions, contact ---- */
@media (max-width: 980px) {
  body.ux.cec header.cec-hdr .cec-ph-row:has(.cec-contact) { grid-template-columns: minmax(0, 1fr); grid-template-areas: "title" "tools" "kpis" "next" "side"; grid-template-rows: none; }
  body.ux.cec header.cec-hdr .cec-ph-row:has(.cec-contact) .cec-hdr-tools { justify-self: start; margin-top: 1rem; }
}
@media (max-width: 980px) {
  body.ux.cec header.cec-hdr .cec-hdr-tools { align-items: flex-start; }
  body.ux.cec header.cec-hdr .cec-hdr-btns { justify-content: flex-start; }
  body.ux.cec header.cec-hdr .cec-pop { right: auto; left: 0; }
  body.ux.cec header.cec-hdr .cec-ib-tip { right: auto; left: 50%; transform: translate(-50%, -3px); }
  body.ux.cec header.cec-hdr .cec-ib:hover .cec-ib-tip, body.ux.cec header.cec-hdr .cec-ib:focus-visible .cec-ib-tip { transform: translate(-50%, 0); }
  body.ux.cec header.cec-hdr .cec-hdr-tools > .cec-ro-note { text-align: left; }
}
@media (max-width: 760px) {
  body.ux.cec header.cec-hdr .cec-ph-row:not(:has(.cec-contact)) > .btn-row { margin-left: 0; width: 100%; }
  body.ux.cec .cec-hdr-next .cec-hdr-claim { flex-basis: 100%; }
}
/* 18 Oct (Jason): "How am I connected?" leads the tools row, a slightly compact red pill before the round buttons */
body.ux.cec .cec-hdr .cec-hdr-btns .cec-hdr-route { flex: none; min-height: 44px; padding: 0 1rem; font-size: 0.9rem; white-space: nowrap; gap: 0.45rem; margin: 0 0.25rem 0 0; }
body.ux.cec .cec-hdr .cec-hdr-btns .cec-hdr-route svg { flex: none; }
@media (max-width: 600px) {
  body.ux.cec .cec-hdr .cec-hdr-btns { flex-wrap: wrap; justify-content: flex-start; }
  body.ux.cec .cec-hdr .cec-hdr-btns .cec-hdr-route { flex: 1 1 100%; justify-content: center; margin: 0 0 0.1rem; }
  body.ux.cec .cec-hdr .cec-hdr-tools { align-self: stretch; width: 100%; }
}
/* footer link */
.ux-ftr a.cec-rep-foot { white-space: nowrap; }

/* 16 Oct (Jason): gentle pulse on the unsaved Save button on person pages - starts after 5 s, three soft pulses, then rests */
@keyframes cecSavePulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(200,16,46,0); transform: scale(1); } 40% { box-shadow: 0 0 0 7px rgba(200,16,46,.16); transform: scale(1.06); } }
body.ux.cec .cec-hdr .cec-save.cec-pulse > .cec-ib { animation: cecSavePulse 2.4s ease-in-out 5s 3; }
body.ux.cec .cec-hdr .cec-save.cec-pulse > .cec-ib:hover, body.ux.cec .cec-hdr .cec-save.cec-pulse > .cec-ib:focus-visible { animation: none; }
@media (prefers-reduced-motion: reduce) { body.ux.cec .cec-hdr .cec-save.cec-pulse > .cec-ib { animation: none; } }
