/* PrepBuddy shared: the avatar as a button, app-wide (tokens doc §components "Avatar", 2026-10-03 "like WhatsApp").
   Pairs with avatar.js (the drawing) and chat.js (PBChat.avatarButton / peek / fullPicture / wireAvatars: the people data lives there).
   A ring means a story (the feed's gradient ring, grey once seen), a green dot means online; both can show together.
   Tap: the story when ringed, otherwise the picture card (picture large, name, Message · Chat info · Profile) → the picture full screen.
   Flutter: PbAvatar in an InkWell → StoryViewer | showDialog(PictureCard) | a fullscreenDialog route with InteractiveViewer. */
/* the avatar button: story ring (the feed's gradient ring, grey once seen) when the buddy did something in the last 24 h, the green dot when online.
   A ring means a story everywhere in the app, so online is the dot (Instagram's pattern: ring + dot can show together). */
.cht-avb { position: relative; display: inline-flex; align-self: center; align-items: center; flex-shrink: 0; padding: 0; border-radius: 999px; -webkit-tap-highlight-color: transparent; }   /* never stretched by a flex row (comments) */
.cht-avb::after { content: ""; position: absolute; inset: min(-6px, calc((100% - 44px) / 2)); border-radius: 999px; }   /* a 40 dp comment avatar still gets a 44+ dp target; a 28 dp one (a reply, a story ring) grows to 44 (sweep A2, 2026-10-18) */
.cht-avb:focus-visible { outline: 2px solid var(--primary); outline-offset: 3px; }
.cht-av { position: relative; flex-shrink: 0; align-self: center; display: inline-flex; border-radius: 999px; }
.cht-av .pb-avatar { position: relative; z-index: 1; }
.card .cht-av, .fd .cht-av, .comment .cht-av { --av-gap: var(--surface); }   /* the ring's gap and the dot's edge match what is behind the avatar */
.cht-av.cht-story { padding: 5px; margin: -5px; background: linear-gradient(135deg, var(--primary), var(--tertiary)); }   /* 3 dp ring + 2 dp gap, the 56 dp layout box unchanged */
.cht-av.cht-story::before { content: ""; position: absolute; inset: 3px; border-radius: 999px; background: var(--av-gap, var(--bg)); }
.cht-av.sm.cht-story { padding: 3px; margin: -3px; } .cht-av.sm.cht-story::before { inset: 2px; }
.cht-av.cht-story.cht-seen { background: color-mix(in srgb, var(--text-secondary) 30%, transparent); }
.cht-av .on { position: absolute; inset-inline-end: 0; bottom: 0; z-index: 2; width: 14px; height: 14px; border-radius: 999px; background: var(--success); border: 3px solid var(--av-gap, var(--bg)); box-sizing: content-box; }
.cht-av.sm .on { width: 9px; height: 9px; border-width: 2px; }
.cht-av.cht-story .on { inset-inline-end: 3px; bottom: 3px; }

/* ---------- the picture card (WhatsApp's profile-picture popup, from the avatar in a row): the picture large with the name over it, then Message · Chat info · Profile ---------- */
.cht-pk-bd { position: fixed; inset: 0; z-index: 60; background: var(--scrim); opacity: 0; transition: opacity 150ms ease; }
.cht-pkw.open .cht-pk-bd { opacity: 1; }
.cht-pk { position: fixed; z-index: 61; top: 50%; left: 50%; width: min(300px, calc(100vw - 48px)); transform: translate(-50%, -50%) scale(.92); opacity: 0; transition: transform 150ms cubic-bezier(.16, 1, .3, 1), opacity 150ms ease; background: var(--surface); border-radius: 24px; overflow: hidden; box-shadow: inset 0 0 0 1px var(--edge), 0 24px 64px color-mix(in srgb, var(--shadow-ink) 35%, transparent); }
.cht-pkw.open .cht-pk { transform: translate(-50%, -50%) scale(1); opacity: 1; }
.cht-pk-pic { position: relative; display: block; width: 100%; aspect-ratio: 1; padding: 0; overflow: hidden; cursor: zoom-in; }
.cht-pk-pic .pb-avatar { display: block; width: 100% !important; height: 100% !important; border-radius: 0 !important; }
.cht-pk-nm { position: absolute; top: 0; inset-inline: 0; padding: 16px 16px 32px; text-align: start; font-size: calc(17px * var(--font-scale)); font-weight: 700; color: var(--on-media); background: linear-gradient(color-mix(in srgb, var(--media-ink) 50%, transparent), transparent); text-shadow: 0 1px 2px color-mix(in srgb, var(--media-ink) 40%, transparent); }
.cht-pk-acts { display: flex; justify-content: space-around; align-items: center; padding: 8px; }
.cht-pk-a { width: 48px; height: 48px; border-radius: 999px; display: inline-flex; align-items: center; justify-content: center; color: var(--primary-text); } .cht-pk-a .ico, .cht-pk-a .mi { font-size: 26px; }
.cht-pk-a:hover { background: color-mix(in srgb, var(--primary) 10%, transparent); }
/* the picture full screen (tap the picture in the card): black, the name in a bar, back or a tap closes */
/* the picture's full screen is the shared .viewer (components.css, 2026-10-19); .cht-full keeps the bar, the back button and the picture inside it */
.cht-full .bar { display: flex; align-items: center; gap: 8px; min-height: 56px; padding: 4px 8px; padding-top: calc(4px + env(safe-area-inset-top, 0px)); }
.cht-full .bar .x { width: 48px; height: 48px; border-radius: 999px; display: inline-flex; align-items: center; justify-content: center; color: var(--on-media); } .cht-full .bar .x .ico, .cht-full .bar .x .mi { font-size: 24px; }
.cht-full .bar b { font-size: calc(16px * var(--font-scale)); font-weight: 700; }
.cht-full .pic { flex: 1; display: flex; align-items: center; justify-content: center; cursor: zoom-out; }
.cht-full .pic .pb-avatar { width: min(100vw, 72vh) !important; height: auto !important; aspect-ratio: 1; border-radius: 0 !important; }
@media (prefers-reduced-motion: reduce) { .cht-pk, .cht-pk-bd { transition: none; } }
