/* > **CLAUDE-AUTHORED** — written or edited by Claude (`profile-rehost`), 2026-09-14. */
/* ============================================================
   The third mark: the portrait. Head and shoulders inside a ring.

   Separated from the search mark deliberately: search is an OFF-CENTRE
   circle WITH A TAIL (a magnifier). This is CENTRED, symmetrical, and
   tail-less. That is what keeps two round marks from reading as one
   mark drawn twice - the 2026-08-30 measurement behind the pair rule.

   Custom properties scoped to the component, never :root - and declared
   on the one element that reads them, the avatar wrap. They used to sit on
   bare `.portal-tools-register`, which put them on every register on every
   route; nothing outside this sheet reads either one (measured 2026-09-14:
   every served stylesheet, style attribute and script on portal home and
   both spaces, plus a grep of mu-plugins, themes and plugins).

   HOST - re-hosted 2026-09-14, off `body:has(.portal-home-grid)`
   `.portal-home-grid` is SureDash's home-content class: the rules below
   used to paint on portal home only, and elsewhere only because
   course-space.css carries literal copies of them. The host is now the
   register itself, `.portal-tools-register`. `body` and the repeated
   `.portal-tools-register` are WEIGHT, not scope: (0,1,1), exactly what
   `body:has(.portal-home-grid)` weighed (`:has()` counts its argument), so
   every selector keeps its old specificity and every contest it was in
   resolves as it did.
   ⛔ Do not tidy the repeated class down to one, or drop `body`.
   ⚠️ IT NOW REACHES EVERY ROUTE THAT HAS A REGISTER, not only portal home.
   On the course spaces it ties course-space.css's literal copies at
   (0,3,1) and prints earlier, so the copies still win and nothing moves.
   On routes with no copy and no `.portal-home-grid` - space map, user
   profile, user view, bookmarks, resource history while empty, community
   posts (measured 2026-09-14) - nothing styled the mark before, so
   SureDash's stock 40x40 initials chip showed there. This sheet now paints
   the portrait mark on them: a visible change, and a decision, not a
   side effect.
   portal-home.css's ink hover at (0,4,1) still wins the tie with the hover
   below on every route it loads on - and both are ink now.
   ⛔ No `var(--ph-*)` any more. `--ph-ink-muted`, `--ph-gold` and
   `--ph-ease` are declared by nothing on this install (computed empty on
   home and both spaces, 2026-09-14), so what painted was always the
   fallback; the fallbacks are now the values.
   ============================================================ */


/* Un-hide the platform's profile block, but ONLY inside the register.
   The shipping sheet hides .wp-block-suredash-profile globally on portal
   home with the note "avatar / profile chip - not drawn". It is drawn now,
   and only here - the rule stays in force everywhere else. */
body .portal-tools-register.portal-tools-register .wp-block-suredash-profile{
  display: block !important;
}

/* ⚠️ MEASURED BUG, fixed 2026-09-11 - `font-size: 0 !important; line-height: 0
   !important` used to sit on the rule above, on .wp-block-suredash-profile.
   That element is not only the mark: it is also the root of the PROFILE MENU,
   which SureDash renders as a SIBLING of the avatar wrap inside
   .portal-user-profiles-wrap, and which nobody had looked at.

   SureDash welds every descendant of that block to the root's type:

     .wp-block-suredash-profile *{ font-size: inherit !important;
       font-weight: inherit !important; line-height: inherit !important;
       color: inherit !important }          - blocks-rtl.min.css, 1.11.1

   At (0,1,0)+important that beats the platform's OWN
   `.portal-avatar-menu a{ font-size:14px; line-height:24px }`, so the menu has
   never had a size of its own - it takes whatever the block root has. The
   `font-size: 0` therefore propagated straight into the popover and every menu
   label computed to 0px/0px. Measured with the menu open: label box 0x0,
   four rows of bare 12px icons and no text at all. ⛔ It was never a contrast
   failure - the ink measured 18.05:1 on its own fill.

   What the suppression was actually for was the LINE BOX around the avatar
   wrap: the wrap was `display: inline-flex`, so its parent's 13px strut made
   the block 39px tall against its two 32px siblings. Making the wrap a
   block-level flex box removes the line box entirely and needs no type
   suppression at all. ✅ Measured both ways on the render: register 61px tall
   with the suppressor moved down, 54px with `display: flex` and no suppressor -
   54px is the anchor's own number, and all three marks sit at y 64 again. */

/* The clickable box, sized and coloured exactly like its two siblings, and
   carrying the mark ITSELF via a mask. The platform's inner avatar element
   is not styled into shape - it is removed from the picture entirely.
   Measured reason: forcing that element to 20px gave a computed 20px and a
   RENDERED 15px, so something on it was scaling the box. Painting the wrap
   sidesteps the whole question rather than fighting it. */
body .portal-tools-register.portal-tools-register .portal-header-avatar-wrap{
  --apm-box: 32px;
  --apm-glyph: 20px;
  width: var(--apm-box) !important;
  height: var(--apm-box) !important;
  /* block-level flex, NOT inline-flex - see the note above. An inline box here
     puts the parent's 13px strut under the mark and grows the register 7px. */
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  cursor: pointer;

  /* painted with currentColor through the mask, so it inherits the register's
     muted ink at rest and full ink on hover - the same one rule as the siblings. */
  /* !important: the platform's profile block sets its own ink and wins
     without it - measured, the mark painted at --ph-ink and read louder
     than the two marks beside it. */
  color: oklch(0.745 0.006 258) !important;              /* was var(--ph-ink-muted, ...) */
  background-color: currentColor;
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22black%22%20stroke-width%3D%221.5%22%20stroke-linecap%3D%22butt%22%20stroke-linejoin%3D%22miter%22%3E%3Ccircle%20cx%3D%2212%22%20cy%3D%2212%22%20r%3D%228.5%22%2F%3E%3Ccircle%20cx%3D%2212%22%20cy%3D%229.5%22%20r%3D%222.6%22%2F%3E%3Cpath%20d%3D%22M7%2018.2%20C8.4%2015.4%2015.6%2015.4%2017%2018.2%22%2F%3E%3C%2Fsvg%3E");
          mask-image: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22black%22%20stroke-width%3D%221.5%22%20stroke-linecap%3D%22butt%22%20stroke-linejoin%3D%22miter%22%3E%3Ccircle%20cx%3D%2212%22%20cy%3D%2212%22%20r%3D%228.5%22%2F%3E%3Ccircle%20cx%3D%2212%22%20cy%3D%229.5%22%20r%3D%222.6%22%2F%3E%3Cpath%20d%3D%22M7%2018.2%20C8.4%2015.4%2015.6%2015.4%2017%2018.2%22%2F%3E%3C%2Fsvg%3E");
  -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat;
  -webkit-mask-position: center;   mask-position: center;
  -webkit-mask-size: var(--apm-glyph) var(--apm-glyph);
          mask-size: var(--apm-glyph) var(--apm-glyph);
  transition: color 300ms cubic-bezier(0.22,0.61,0.36,1); /* was var(--ph-ease, ...) */
}

/* everything the platform drew inside it: the cream sd-bg-yellow-300 initials
   tile, the initials themselves, and the gravatar that 404s. */
body .portal-tools-register.portal-tools-register .portal-user-avatar,
body .portal-tools-register.portal-tools-register .portal-avatar-initials-text,
body .portal-tools-register.portal-tools-register .portal-user-gravatar{
  display: none !important;
}

/* ⛔ GUEST LOGIN PRESERVED - the repair for the hide directly above.
   THE DEFECT: that hide is scoped by ELEMENT, not by STATE, so it also empties the GUEST's
   login link. For a not-logged-in visitor the platform renders
   `.portal-header-avatar-wrap[data-view="not-logged-in"] > a.portal-user-menu-link.portal-logout-url`
   whose only content is `.portal-user-avatar` - the element hidden above. The link then
   measures 32x0 and cannot be tapped. A member is unaffected: a member's mark is the wrap
   itself, opened by script.
   ⭐ THE RULE, not a note: HIDING A LOGGED-IN CONTROL MUST NEVER REMOVE THE GUEST'S LOGIN
   AFFORDANCE. And the general mechanism under it: A HIDE SCOPED BY ELEMENT RATHER THAN BY
   STATE REMOVES THAT ELEMENT IN EVERY STATE. Two defects on this portal were this one
   mistake. The other is in `portal-home.css`, repaired there beside its own hide.
   ⚠️ FIND IT BY SELECTOR, NOT BY LINE. Grep that sheet for
   `.wp-block-suredash-profile:not(:where(.portal-tools-register *))` - two raw hits, the comment
   that names it and the selector itself; exactly ONE with comments stripped. It was called
   `portal-home.css:1531` throughout 2026-10-02 and THAT NAME IS STALE: documenting the rule
   pushed it 51 lines down, and the fix to this very cross-reference pushed it further.
   Currently line 1592 of portal-home.css at md5 `8c522fb3daaa6a65d6d65958d80cf53d`.
   ⛔ A DIFFERING HASH VOIDS THAT LINE NUMBER - the selector text is then how you find it.
   ⭐ THE MECHANISM, worth stating once because the next person commenting above a rule will
   repeat it: A LINE-NUMBER REFERENCE IS INVALIDATED BY DOCUMENTING THE THING IT POINTS AT.
   ⚠️ `position: relative` is ASSERTED, NOT RESTORED. Nothing ever positioned this wrap:
   this unit declares no `position` at all (the only match is `mask-position`), no mu-plugin
   stylesheet of ours positions `.portal-header-avatar-wrap`, and the platform's `.sd-relative`
   sits on `.portal-user-profiles-wrap` - measured, `proof/2026-10-02_probe-chromium.json`:
   "portal-user-profiles-wrap sd-relative portal-content". There was no override to stop.
   ⛔ AND IN THE RAIL THE ESCAPE IS GUARANTEED IF THIS LINE IS DROPPED, not merely possible.
   Both candidate ancestors are static here: the wrap because nobody positioned it, and its
   parent because WE force it static on purpose - `antigravity-portal-profile-menu/style.css`
   sets `.portal-user-profiles-wrap` to `position: static !important`, scoped to
   `body .portal-sidebar.portal-sidebar .portal-tools-register`, to hand the containing block
   up to the register (profile-mark NATIVES.md:13). So an absolutely positioned link takes
   `.portal-tools-register` instead and becomes 221x64 over the entire register, SEARCH
   INCLUDED - the post lane's first version did exactly that AND STILL LANDED ON
   /portal-login/. ⛔ Do NOT touch that `position: static !important`: it looks like the bug
   and it is load-bearing.
   ⚠️ The phone bar needs no line like this, and THAT ASYMMETRY IS OURS, not the
   platform's: the static-forcing above is rail-scoped, so in the bar
   `.portal-user-profiles-wrap` keeps its `.sd-relative`. Same fix, two hosts, one needs a
   positioning line and one does not. Do not harmonise them.
   ⭐ 44x44 over the 32x32 mark: `inset: -6px` with `width`/`height` auto gives 32+6+6 per
   axis. The post lane measured 44x44 at [1327,34] over the mark at [1333,40]; 1333-6=1327
   and 40-6=34, so this reproduces their box with no adjustment. Reused, not derived.
   ⚠️ DERIVED AND UNPROVEN - FIRST RENDER IS ITS B-ACCEPTANCE TEST. It cannot be rendered
   on A (qa-autologin), so it is staged HAVING NEVER BEEN RENDERED ANYWHERE. The gate: guest,
   home + spaces + lessons at 1440, before/after, made to fail on purpose.
   ⛔ THE CHECK IS THE LINK'S RECT AND WHAT IT OVERLAPS - NEVER THE LANDING URL ALONE. The
   broken version above reached /portal-login/ correctly while covering search, so a
   destination assertion certifies that failure.
   ⚠️ ASSERT THE DECLARATIONS FIRST, GEOMETRY SECOND: computed `position` = `relative` on
   the wrap and `absolute` on the link, `inset` resolving to -6px on all four sides. A 44x44
   rect could arise from something else and read as a pass; a computed `static` can only mean
   this never matched. ⭐ IF IT DID NOT MATCH, probe the two conditions SEPARATELY - does
   `body` carry `suredash-guest-user`, does the wrap carry `data-view="not-logged-in"` - and
   report WHICH is absent. An ANDed selector that fails tells you nothing; the same
   conditions probed one at a time tell you which half was wrong.
   ⚠️ PROVENANCE: the entire guest chain - body class, attribute, link classes, and this
   wrap's computed position - comes from the POST LANE's measurement, not from anything
   verifiable here. Both of this lane's 2026-10-02 probes are qa-autologin sessions with zero
   occurrences of any of it, and neither the platform stylesheet nor
   `suredash/core/renderer.php` is in this release directory. Their rail rule:
   `screens/post/Code/post.src.css:1480-1481`.
   ⚠️ Specificity (0,5,1) wrap and (0,6,2) link, against this unit's (0,2,1) rules - so no
   doubled-class trick is needed and the existing rules are untouched. !important only to
   match this unit, where every declaration carries it; the platform stylesheet is not in
   this release directory, so whether ITS declarations are !important is UNVERIFIED. */
body.suredash-guest-user .portal-sidebar .portal-tools-register .portal-header-avatar-wrap[data-view="not-logged-in"]{
  position: relative !important;
}
body.suredash-guest-user .portal-sidebar .portal-tools-register .portal-header-avatar-wrap[data-view="not-logged-in"] > a.portal-user-menu-link{
  display: block !important;
  position: absolute !important;
  inset: -6px !important;
  width: auto !important;
  height: auto !important;
  padding: 0 !important;
  margin: 0 !important;
}

/* full ink on hover and on keyboard focus - the value the approved render
   paints today, where portal-home.css's own ink rule wins this tie on
   order. The previous design's gold, `oklch(0.800 0.150 78)`, stood here
   and lost that tie on every route; standing alone it would have come back
   wherever portal-home.css stops loading. Ink variant, 2026-09-14.
   ⛔ THIS INK IS SHARED BY THREE MARKS, CHANGE ALL THREE TOGETHER: the search
   and notices glyphs hover to it as `stroke` in portal-home.css:624-635
   (`… .only-search-icon-wrap:hover svg`, `… .portal-notification-trigger:hover
   svg`); the set is documented in `elements/notices-mark/TRAPS.md` § 5. The
   literal stays a literal here - this sheet has to stand alone. */
body .portal-tools-register.portal-tools-register .portal-header-avatar-wrap:hover,
body .portal-tools-register.portal-tools-register .portal-header-avatar-wrap:focus-visible{
  color: #EEF4F5 !important;                              /* --agf-ink, same in both token blocks */
}
