/* Who's around them (js/around.js): the person page's picture of who's with them and who's against them, in the tile
   #pbRel (person.html; the owner's pick of mock-connect-person, November 16, 2026). Colours are the look's tokens
   (css/design.css) and this file's own on .aro; css/dark.css is built from it (tools/build_dark.py), and the picture's
   dark colours (the lines, the group squares) are set by hand in tools/dark_hand.css. */
.aro {
  --aro-card: #fff;
  --aro-help: #0a7d4f; --aro-hurt: #c0262d;   /* helped (allies, helpers, givers), attacked */
  --aro-grp: #4b4870; --aro-grp-ink: #fff;    /* the groups: one neutral ink, whatever side they're on */
}

/* the answer, first */
.pn .aro-answer { margin: 0; font: 500 19px/1.35 var(--font-head); letter-spacing: -.01em; color: var(--g-ink); text-wrap: pretty; }
.pn .aro-answer[hidden] { display: none; }

/* each half's heading: in words, never position or colour alone */
.aro-half { display: grid; gap: 8px; min-width: 0; }
.aro-half[hidden] { display: none; }
.aro-hhead { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-width: 0; }
.pn .aro-hhead h3 { margin: 0; display: flex; align-items: center; gap: 8px; font: 800 12px/1.3 var(--font-read); letter-spacing: .06em; text-transform: uppercase; }
.pn .aro-half.is-for h3 { color: var(--aro-help); }
.pn .aro-half.is-against h3 { color: var(--aro-hurt); }
.aro-hhead h3::before { content: ""; width: 18px; border-top: 3px solid currentColor; border-radius: 2px; }
.aro-half.is-against h3::before { border-top-style: dashed; border-top-width: 2px; }
/* the counts, and in their place the readout of the face or group tapped (room kept for three lines: nothing shifts) */
.aro-line { min-height: calc(3 * 1.4 * 13.5px); font-size: 13.5px; line-height: 1.4; }
.pn .aro-line p { margin: 0; }
.aro-line p[hidden] { display: none; }
.aro-sum { color: var(--g-muted); }
.aro-say { color: var(--g-ink-2); }
.aro-say b { color: var(--g-ink); font-weight: 700; }
.aro-go { position: relative; display: inline-flex; align-items: center; gap: 4px; padding: 0; border: 0; background: none; color: var(--g-accent); font: 700 13.5px/1.4 var(--font-read); text-decoration: none; cursor: pointer; white-space: nowrap; }
.aro-go::after { content: ""; position: absolute; inset: -14px -8px; }   /* (a 44px tap) */
.aro-go .g-icon { width: 14px; height: 14px; }
@media (min-width: 860px) { .aro-line { min-height: calc(2 * 1.4 * 13.5px); } }
.aro-more, .aro-pill, .aro-shut { flex: none; min-height: 44px; padding: 0 14px; border: 0; border-radius: 999px; background: var(--aro-card); color: var(--g-ink); box-shadow: 0 0 0 1px var(--g-line); font: 700 14px/1 var(--font-read); cursor: pointer; -webkit-tap-highlight-color: transparent; transition: background .15s, box-shadow .15s; }
.aro-more[aria-expanded="true"], .aro-pill[aria-expanded="true"] { background: var(--g-ink); color: var(--aro-card); box-shadow: none; }
.aro-pills { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; }
.aro-pl { color: var(--g-muted); font-size: 13px; margin-right: 2px; }
.aro-pill { position: relative; min-height: 36px; padding: 0 12px; font-size: 13px; }
.aro-pill::after { content: ""; position: absolute; inset: -4px 0; }   /* (a 44px tap) */
@media (hover: hover) { .aro-more:hover, .aro-pill:hover, .aro-shut:hover { box-shadow: 0 0 0 1px var(--g-muted); } }

/* the folds: the full lists, in place */
.aro-folds:empty { display: none; }
.aro-fold { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .32s var(--g-curve); }
.aro-fold.is-open { grid-template-rows: 1fr; }
.aro-fold-in { min-height: 0; overflow: hidden; display: grid; gap: 6px; }
.pn .aro-fold h4 { margin: 8px 0 0; font: 700 13px/1.3 var(--font-read); color: var(--g-ink-2); }
.aro-fold h4 span { color: var(--g-muted); font-weight: 600; }
.aro-list { list-style: none; margin: 0; padding: 0; display: grid; }
.aro-list li + li { border-top: 1px solid var(--g-line); }
.aro-row { display: flex; align-items: center; gap: 12px; min-height: 48px; padding: 4px 2px; color: var(--g-ink); text-decoration: none; }
.aro-row > .g-icon { width: 16px; height: 16px; margin-left: auto; color: var(--g-muted); flex: none; }
.aro-rt { display: grid; min-width: 0; line-height: 1.3; }
.aro-rt b { font-weight: 600; font-size: 15px; overflow-wrap: anywhere; }
.aro-rt small { color: var(--g-muted); font-size: 13px; }
.aro-src { margin-left: auto; flex: none; display: inline-flex; align-items: center; min-height: 44px; padding: 0 4px; color: var(--g-accent); font-size: 13px; font-weight: 600; }
.pn .aro-rest { margin: 4px 0 0; color: var(--g-muted); font-size: 13px; }
.aro-rest a { color: var(--g-accent); }
.aro-shut { justify-self: start; margin: 6px 0 4px; }
@media (hover: hover) { a.aro-row:hover b { color: var(--g-accent); } }

/* faces: a photo in the party's ring, initials without one */
.aro-face { --party: var(--party-other); position: relative; display: grid; place-items: center; flex: none; border-radius: 50%; overflow: hidden; background: var(--g-track); color: var(--g-ink-2); box-shadow: 0 0 0 2.5px var(--party); }
.aro-face.is-D { --party: var(--party-democrat); }
.aro-face.is-R { --party: var(--party-republican); }
.aro-face img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center 22%; opacity: 0; transition: opacity .3s ease; }
.aro-face.has-photo img { opacity: 1; }
.aro-face.has-photo .aro-ini { visibility: hidden; }
.aro-ini { font: 700 13px/1 var(--font-read); letter-spacing: .02em; }
.aro-face.is-row { width: 36px; height: 36px; box-shadow: 0 0 0 2px var(--party); }

/* ---------- the picture ---------- */
.aro-pic { position: relative; width: 100%; min-width: 0; -webkit-tap-highlight-color: transparent; }
.aro-pic[hidden] { display: none; }
.aro-lines { position: absolute; left: 0; top: 0; overflow: visible; pointer-events: none; }
.aro-ln { stroke-linecap: round; transition: opacity .2s ease; }
.aro-ln.is-help { stroke: var(--aro-help); opacity: .62; }
.aro-ln.is-hurt { stroke: var(--aro-hurt); opacity: .62; }
.aro-ln.is-dash { stroke-dasharray: 6 5; stroke-linecap: butt; }
.aro-ln.is-gave { opacity: .45; }
.aro-pic.has-sel .aro-ln { opacity: .14; }
.aro-pic.has-sel .aro-ln.is-sel { opacity: 1; }
.aro-me { position: absolute; z-index: 2; transform: translate(-50%, -50%); pointer-events: none; }
.aro-face.is-me { box-shadow: 0 0 0 3px var(--aro-card), 0 0 0 6px var(--party); }
.aro-face.is-me .aro-ini { font-size: 22px; }

.aro-node { position: absolute; z-index: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-start; gap: 3px; margin: 0; padding: 0; border: 0; border-radius: 12px; background: none; color: var(--g-ink); font: inherit; cursor: pointer; -webkit-tap-highlight-color: transparent; transition: opacity .2s ease; }
.aro-node.is-up { justify-content: flex-end; }
.aro-node[hidden] { display: none; }
.aro-node:focus-visible { outline: 3px solid var(--g-accent); outline-offset: 2px; }
.aro-node .aro-face.is-node { width: var(--sz); height: var(--sz); transition: box-shadow .2s ease, transform .2s var(--g-curve); }
.aro-node .aro-face.is-node .aro-ini { font-size: calc(var(--sz) * .32); }
.aro-sq { display: grid; place-items: center; flex: none; width: var(--sz, 36px); height: var(--sz, 36px); border-radius: 28%; background: var(--aro-grp); color: var(--aro-grp-ink); transition: box-shadow .2s ease, transform .2s var(--g-curve); }
.aro-sq .g-icon { width: 56%; height: 56%; stroke-width: 1.8; }
.aro-sq.is-row { width: 36px; height: 36px; border-radius: 10px; }
.aro-cap { display: grid; justify-items: center; width: 100%; max-width: 100%; text-align: center; line-height: 13px; font-size: 11.5px; color: var(--g-ink-2); }
.aro-node.is-p .aro-cap { display: block; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-weight: 600; }
.aro-gn { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 1; overflow: hidden; overflow-wrap: anywhere; max-width: 100%; }
.aro-node.is-two .aro-gn { -webkit-line-clamp: 2; }
.aro-cap b { font-size: 12.5px; line-height: 15px; color: var(--g-ink); font-weight: 800; }
.aro-node:is(.is-d, .is-a) .aro-cap { font-size: 11px; color: var(--g-muted); }
.aro-node:is(.is-d, .is-a) .aro-cap b { font-size: 11.5px; font-weight: 700; color: var(--g-ink-2); }
.aro-node:is(.is-d, .is-a) .aro-sq { opacity: .8; }
.aro-pic.has-sel .aro-node:not(.is-sel) { opacity: .45; }
.aro-node.is-sel .aro-face { box-shadow: 0 0 0 2.5px var(--party), 0 0 0 5px var(--aro-card), 0 0 0 7px var(--g-ink); }
.aro-node.is-sel .aro-sq { box-shadow: 0 0 0 3px var(--aro-card), 0 0 0 5px var(--g-ink); }
@media (hover: hover) { .aro-node:hover .aro-face, .aro-node:hover .aro-sq { transform: scale(1.06); } }

/* Fact check mode (js/factcheck.js): a face is asked about, not opened; a grey ring when the reason is recorded (as the
   old circles had: css/style.css) */
.fact-mode .aro-node.is-p { cursor: help; }
.fact-mode .aro-node[data-fc-status] .aro-face { box-shadow: 0 0 0 2.5px var(--party), 0 0 0 7px rgba(var(--fc), .85); }

@media (prefers-reduced-motion: reduce) { .aro-fold, .aro-ln, .aro-node, .aro-sq, .aro-face { transition: none; } }
