/*
 * TAG Legal Desk v2.1: the art library's own pictures (js\v21_artlib.js). Game art is hidden at once while the core
 * marks the page quiet (a welfare message open, the quiet period, the nobody band), as every [data-v21="game"] is;
 * this is the library's own belt and braces. Nothing here animates.
 */
img.v21a-img { display: inline-block; max-width: 100%; height: auto; object-fit: contain; user-select: none; }
:root[data-quiet="on"] img.v21a-img[data-v21="game"],
:root[data-v21-welfare="on"] img.v21a-img[data-v21="game"] { display: none !important; }
@media print { img.v21a-img[data-v21="game"] { display: none !important; } }

/* =====================================================================================================================
 * BUILDER A (28 Sep 2026): Your animal, its outfits and its frames (js\v21_artlib_avatars.js).
 * A library picture covers the desk's own avatar circle on the person's colour disc (16 percent of --pc into --solid),
 * inside the 2 px ring in their colour, so identity reads first as colour and then as the animal. Each kind is cropped
 * to the circle: the world animals' own clip circle (r 44 of 48), the classic portraits' baked pale disc, the outfits'
 * circle. The presence dot and the leaf badge sit above; the initials stay for screen readers and come back on screen
 * at once in the quiet states. The art frames are drawn as SVG round the circle at 32 px and up. Never in a job, on
 * the email paper, on a welfare surface, in the Leaving card or in print. Nothing moves by itself; hover lifts are
 * still under reduced motion, Calm and the days that matter. Custom properties come through the CSSOM (--pc,
 * --v21aa-size, --v21aa-fb, --sw, --sw2); nothing here needs a style attribute.
 * ================================================================================================================== */

/* ---------- a picture in the avatar circle ---------- */
.av.v21aa-pt, .peer-b.v21aa-pt { background: color-mix(in srgb, var(--pc) 16%, var(--solid)); color: transparent; }
@supports not (color: color-mix(in srgb, red 16%, white)) { .av.v21aa-pt, .peer-b.v21aa-pt { background: var(--solid); } }
.av.v21aa-pt::after, .peer-b.v21aa-pt::after { content: ""; position: absolute; inset: 0; border-radius: 50%; box-shadow: inset 0 0 0 2px var(--pc); pointer-events: none; z-index: 1; }
.peer-b.v21aa-pt { overflow: hidden; }
.v21aa-pic { position: absolute; inset: 0; display: block; border-radius: 50%; overflow: hidden; z-index: 0; pointer-events: none; }
.v21aa-pic > img.v21a-img { position: absolute; left: 0; top: 0; display: block; width: 100%; height: 100%; max-width: none; object-fit: cover; transform: scale(var(--v21aa-crop, 1)); transform-origin: 50% 50%; }
.v21aa-k-world { --v21aa-crop: 1.092; }
.v21aa-k-legacy { --v21aa-crop: 1.14; }
.v21aa-k-critter { --v21aa-crop: 1.045; }
.v21aa-k-critterbase { --v21aa-crop: 1; }
.av.v21aa-pt > .dot, .av.v21aa-pt > .leafb { z-index: 3; }
.av.v21aa-pt > .crit-frm { z-index: 2; }
/* The initials: read by screen readers while the picture shows (visually hidden), and shown in the quiet states. */
.v21aa-pt > .v21aa-ini { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; }
:root[data-theme="high_contrast"] .av.v21aa-pt, :root[data-theme="high_contrast"] .peer-b.v21aa-pt { background: var(--solid); }

/* ---------- the art frames (and the first three, round a picture) ---------- */
/* J160 (29 Sep 2026): the frame covers the avatar's own box and its drawing is a share of the avatar's real width
   (--v21aa-k, the drawing's box over the px it was drawn for), so the band hugs the circle at whatever size the CSS
   draws the avatar. */
.v21aa-frm { position: absolute; left: 0; top: 0; right: 0; bottom: 0; z-index: 2; pointer-events: none; }
.v21aa-frm > svg { position: absolute; display: block; width: calc(var(--v21aa-k, 1.2) * 100%); height: calc(var(--v21aa-k, 1.2) * 100%); left: calc(50% - var(--v21aa-k, 1.2) * 50%); top: calc(50% - var(--v21aa-k, 1.2) * 50%); overflow: visible; }
.v21aa-ofrm { position: absolute; left: -12.5%; top: -12.5%; width: 125%; height: 125%; z-index: 2; pointer-events: none; }
.v21aa-ofrm > img.v21a-img { display: block; width: 100%; height: 100%; max-width: none; }
.av-sm > .v21aa-frm, .av-sm > .v21aa-ofrm { display: none; }
:root[data-theme="dark"] .v21aa-frm > svg, :root[data-v21-theme="night_shift"] .v21aa-frm > svg { filter: brightness(1.2); }
:root[data-theme="high_contrast"] .v21aa-frm .f-s { stroke: #000000; }
:root[data-theme="high_contrast"] .v21aa-frm .f-f { fill: #000000; }
:root[data-theme="high_contrast"] .v21aa-frm .f-o { display: none; }
:root[data-theme="high_contrast"] .v21aa-frm .f-w { stroke: #FFFFFF; }
:root[data-theme="high_contrast"] .v21aa-ofrm > img { display: none; }
:root[data-theme="high_contrast"] .v21aa-ofrm { border-radius: 50%; box-shadow: inset 0 0 0 2px #000000; }
/* On the overlapping crew strip a framed avatar takes a gap instead of the 8 px overlap, so frames never collide. */
.crew .av.v21aa-framed, .crew .av.v21aa-framed + .av { margin-left: 10px; }
.crew .av.v21aa-framed:first-child { margin-left: 0; }
/* J160 review: the crew strip today (40 px avatars 12 px apart, each in its own button): a framed avatar takes 3 px
   more each side, the same as a drawn frame (styles\v21_shop_trees.css), so framed neighbours sit 18 px apart. */
#crew-slot .crew .av.v21aa-framed { margin-left: 3px; margin-right: 3px; }

/* A big framed avatar beside words (the trophy room's look) gives its frame room (J160). */
.v21tr-look > .av.v21aa-framed { margin: 6px 4px 6px 4px; }
/* ---------- a preview avatar at any size (Profile, the picker, a Canteen card) ---------- */
.av.v21aa-prev { width: var(--v21aa-size, 96px); height: var(--v21aa-size, 96px); font-size: calc(var(--v21aa-size, 96px) * .34); }

/* ---------- welfare first: the quiet states (a welfare message, the quiet period, the nobody band) ---------- */
:root[data-quiet="on"] .av.v21aa-pt, :root[data-quiet="on"] .peer-b.v21aa-pt { background: var(--pc) !important; color: var(--p-ink) !important; }
:root[data-quiet="on"] .av.v21aa-pt::after, :root[data-quiet="on"] .peer-b.v21aa-pt::after { display: none; }
:root[data-quiet="on"] .v21aa-pic, :root[data-quiet="on"] .v21aa-frm, :root[data-quiet="on"] .v21aa-ofrm, :root[data-quiet="on"] .v21aa-piece,
:root[data-quiet="on"] .v21aa-pk, :root[data-quiet="on"] .v21aa-prof, :root[data-quiet="on"] .v21aa-moment { display: none !important; }
:root[data-quiet="on"] .v21aa-pt > .v21aa-ini { position: static; width: auto; height: auto; overflow: visible; clip: auto; clip-path: none; }

/* ---------- never here: a job, the email paper, welfare, the Leaving card (the critters too, belt and braces) ---------- */
#job-layer .v21aa-pic, #job-layer .v21aa-frm, #job-layer .v21aa-ofrm, .paper .v21aa-pic, .paper .v21aa-frm, .paper .v21aa-ofrm,
#wf-layer .v21aa-pic, #wf-layer .v21aa-frm, #wf-layer .v21aa-ofrm, #wf-slot .v21aa-pic, #wf-slot .v21aa-frm, #wf-slot .v21aa-ofrm,
#wf-over-job .v21aa-pic, #wf-over-job .v21aa-frm, #wf-over-job .v21aa-ofrm, #wf-over-cover .v21aa-pic, #wf-over-cover .v21aa-frm, #wf-over-cover .v21aa-ofrm,
.wf-band .v21aa-pic, .wf-band .v21aa-frm, .band-welfare .v21aa-pic, .band-welfare .v21aa-frm,
#leave-root .v21aa-pic, #leave-root .v21aa-frm, #leave-root .v21aa-ofrm,
#job-layer .av.v21c-crit > .crit-art, #job-layer .av.v21c-crit > .crit-frm, #job-layer .av.v21c-crit > .crit-over,
#wf-layer .av.v21c-crit > .crit-art, #wf-layer .av.v21c-crit > .crit-frm, #wf-layer .av.v21c-crit > .crit-over,
#leave-root .av.v21c-crit > .crit-art, #leave-root .av.v21c-crit > .crit-frm, #leave-root .av.v21c-crit > .crit-over { display: none !important; }
#job-layer .av.v21aa-pt, #wf-layer .av.v21aa-pt, #wf-slot .av.v21aa-pt, #leave-root .av.v21aa-pt, .paper .av.v21aa-pt,
#job-layer .av.v21c-crit, #wf-layer .av.v21c-crit, #leave-root .av.v21c-crit { background: var(--pc) !important; color: var(--p-ink) !important; }
#job-layer .av.v21aa-pt::after, #wf-layer .av.v21aa-pt::after, #wf-slot .av.v21aa-pt::after, #leave-root .av.v21aa-pt::after, .paper .av.v21aa-pt::after,
#job-layer .av.v21c-crit::after, #wf-layer .av.v21c-crit::after, #leave-root .av.v21c-crit::after { display: none; }
#job-layer .v21aa-pt > .v21aa-ini, #wf-layer .v21aa-pt > .v21aa-ini, #wf-slot .v21aa-pt > .v21aa-ini, #leave-root .v21aa-pt > .v21aa-ini, .paper .v21aa-pt > .v21aa-ini { position: static; width: auto; height: auto; overflow: visible; clip: auto; clip-path: none; }
#job-layer .av.v21c-crit > .v21c-ini, #wf-layer .av.v21c-crit > .v21c-ini, #leave-root .av.v21c-crit > .v21c-ini { display: inline; }
@media print { .v21aa-pic, .v21aa-frm, .v21aa-ofrm, .v21aa-pk, .v21aa-prof, .v21aa-moment { display: none !important; } }
@media (forced-colors: active) {
  .v21aa-frm, .v21aa-ofrm, .v21aa-piece { display: none; }
  .av.v21aa-pt { forced-color-adjust: none; background: Canvas; }
  .av.v21aa-pt::after { box-shadow: inset 0 0 0 2px CanvasText; }
}

/* ---------- the picker (Profile and the Pick your animal card) ---------- */
.v21aa-pk { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 16px; min-width: 0; }
.v21aa-pk-side { flex: 1 1 200px; max-width: 100%; display: grid; gap: 10px; justify-items: center; align-content: start; min-width: 0; }
.v21aa-pk-main { flex: 3 1 320px; display: grid; gap: 10px; min-width: 0; }
.v21aa-pk.is-compact .v21aa-pk-main { flex-basis: 280px; }
.v21aa-pk-stage { display: grid; place-items: center; width: 100%; min-height: 176px; padding: 20px 12px; border-radius: 18px;
  background: radial-gradient(80% 90% at 50% 40%, color-mix(in srgb, var(--pc, var(--brand)) 14%, transparent) 0%, transparent 70%), var(--glass-2);
  box-shadow: inset 0 1px 0 var(--glass-hi), 0 0 0 1px var(--glass-rim); }
.v21aa-pk.is-compact .v21aa-pk-stage { min-height: 144px; padding: 14px 10px; }
/* Narrow (Profile's sheet, a phone): the preview sits beside its name and the pose and outfit choices. */
.v21aa-pk.is-narrow .v21aa-pk-side { flex-basis: 100%; display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: 14px; row-gap: 8px; justify-items: stretch; align-items: start; }
.v21aa-pk.is-narrow .v21aa-pk-stage { grid-row: 1 / span 2; width: auto; min-height: 0; padding: 12px; }
.v21aa-pk.is-narrow .v21aa-pk-name { text-align: left; align-self: end; }
.v21aa-pk.is-narrow .v21aa-pk-opts { grid-column: 2; }
.v21aa-pk-stage > .av { animation: v21aa-in var(--t-card, 280ms) var(--ease-out, ease) both; }
@keyframes v21aa-in { from { opacity: 0; transform: scale(.96); } to { opacity: 1; transform: none; } }
.v21aa-pk-name { margin: 0; text-align: center; font-weight: 700; line-height: 1.35; overflow-wrap: anywhere; }
.v21aa-pk-opts { display: grid; gap: 10px; width: 100%; }
.v21aa-pk-grp { display: grid; gap: 6px; min-width: 0; }
.v21aa-pk-gl { margin: 0; font-size: .75rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); }
.v21aa-pk-grp > .meta { margin: 0; }
.v21aa-pk-note { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; }
.v21aa-pk-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.v21aa-chip { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 4px 12px; border-radius: 999px; border: 1px solid var(--glass-edge); background: var(--glass-1); box-shadow: inset 0 1px 0 var(--glass-hi), 0 0 0 1px var(--glass-rim); color: var(--ink); font: inherit; font-size: .875rem; font-weight: 600; cursor: pointer; }
.v21aa-chip.has-pic { padding-left: 4px; }
.v21aa-chip[aria-checked="true"] { outline: 3px solid var(--focus); outline-offset: 1px; }
.v21aa-chip:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.v21aa-chip[aria-disabled="true"] { opacity: .55; cursor: not-allowed; }
.v21aa-pk-tabs { display: flex; flex-wrap: wrap; gap: 6px; padding: 2px; }
.v21aa-pk-tab { display: inline-flex; align-items: center; gap: 8px; flex: none; min-height: 44px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--glass-edge); background: var(--glass-1); box-shadow: inset 0 1px 0 var(--glass-hi), 0 0 0 1px var(--glass-rim); color: var(--ink); font: inherit; font-weight: 600; cursor: pointer; }
.v21aa-pk-tab[aria-selected="true"] { background: var(--brand-soft); box-shadow: inset 0 0 0 2px var(--brand-text); }
.v21aa-pk-tab:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.v21aa-pk-n { min-width: 24px; padding: 0 6px; border-radius: 999px; background: var(--solid-2, var(--glass-2)); color: var(--ink-2); font-size: .75rem; font-weight: 700; text-align: center; font-variant-numeric: tabular-nums; }
.v21aa-pk-n:empty { display: none; }
.v21aa-pk-find { display: grid; gap: 4px; }
.v21aa-pk-ql { font-size: .8125rem; font-weight: 700; color: var(--ink-2); }
.v21aa-pk-q { width: 100%; min-height: 44px; padding: 0 12px; border-radius: var(--r-chip, 10px); border: 1px solid var(--edge-strong); background: var(--solid); color: var(--ink); font: inherit; }
.v21aa-pk-q:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.v21aa-pk-count, .v21aa-pk-wait { margin: 0; }
.v21aa-pk-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(82px, 1fr)); gap: 8px; }
.v21aa-pk-card { position: relative; display: grid; justify-items: center; align-content: start; gap: 6px; min-height: 44px; padding: 10px 4px 8px; border-radius: 16px; border: 1px solid var(--glass-edge); background: var(--glass-1); box-shadow: inset 0 1px 0 var(--glass-hi), 0 0 0 1px var(--glass-rim); color: var(--ink); font: inherit; cursor: pointer; transition: transform var(--t-small, 180ms) var(--ease-out, ease); }
.v21aa-pk-card:hover { transform: translateY(-2px); }
.v21aa-pk-card:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.v21aa-pk-card[aria-checked="true"] { outline: 3px solid var(--focus); outline-offset: 1px; background: color-mix(in srgb, var(--pc, var(--brand)) 10%, var(--glass-1)); }
.v21aa-pk-check { position: absolute; top: 6px; right: 6px; width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; background: var(--focus); color: var(--solid); opacity: 0; }
.v21aa-pk-card[aria-checked="true"] .v21aa-pk-check { opacity: 1; }
.v21aa-pk-check svg { width: 12px; height: 12px; fill: none; stroke: currentColor; stroke-width: 2.2; }
.v21aa-pk-nm { max-width: 100%; font-size: .75rem; line-height: 1.2; font-weight: 600; text-align: center; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.v21aa-pk-pager { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; }
.v21aa-pk-pager[hidden] { display: none; }
.v21aa-pk-pg { font-variant-numeric: tabular-nums; }
.v21aa-disc { position: relative; flex: none; display: inline-block; width: var(--v21aa-size, 56px); height: var(--v21aa-size, 56px); border-radius: 50%; background: color-mix(in srgb, var(--pc, var(--brand)) 16%, var(--solid)); box-shadow: inset 0 0 0 1px var(--glass-rim); }
.v21aa-disc > .v21aa-pic { position: absolute; inset: 0; }
.v21aa-moment { display: grid; gap: 12px; min-width: 0; }
.v21aa-moment h2 { margin: 0; font-size: 1.0625rem; line-height: 1.5rem; font-weight: 600; }
.v21aa-moment p { margin: 0; }
.v21aa-prof-row { align-items: center; }
.v21aa-prof-av { flex: none; display: grid; place-items: center; width: 132px; min-height: 132px; }
/* J160: a framed avatar in Profile takes room above and below for its frame (a flame or a crest stands well clear of
   the avatar at 96 px), so the frame never runs into the heading below. */
.v21aa-prof-av > .av.v21st-framed, .v21aa-prof-av > .av.v21aa-framed { margin-block: 22px; }
.v21aa-prof-line { margin: 0; }
.v21aa-prof-frame { margin: 0; }
.v21aa-prof-area { display: grid; gap: 12px; margin-top: 12px; }

/* ---------- the Canteen: frame families and outfits ---------- */
.v21aa-win { display: grid; place-items: center; background: radial-gradient(70% 90% at 50% 30%, var(--glass-2) 0%, transparent 72%), var(--solid-2, var(--glass-2)); }
.v21aa-win-c { position: relative; }
.v21aa-piece { position: absolute; top: 8px; right: 8px; width: 44px; height: 44px; display: grid; place-items: center; border-radius: 12px; background: var(--glass-2); box-shadow: inset 0 1px 0 var(--glass-hi), 0 0 0 1px var(--glass-rim); }
.v21aa-piece > img.v21a-img { width: 38px; height: 38px; }
.v21aa-sw { display: flex; flex-wrap: wrap; gap: 4px; margin: 4px 0 0; }
.v21aa-swb { position: relative; display: grid; place-items: center; width: 40px; height: 40px; padding: 0; border: 0; border-radius: 50%; background: transparent; cursor: pointer; }
.v21aa-swd { display: block; width: 26px; height: 26px; border-radius: 50%; background: var(--sw); box-shadow: inset 0 0 0 3px var(--sw2), 0 0 0 1px var(--glass-rim); }
.v21aa-swb[aria-checked="true"] .v21aa-swd { box-shadow: inset 0 0 0 3px var(--sw2), 0 0 0 2px var(--solid), 0 0 0 4px var(--focus); }
.v21aa-swb:focus-visible { outline: 3px solid var(--focus); outline-offset: 0; }
.v21aa-swk { position: absolute; right: 2px; bottom: 2px; width: 16px; height: 16px; border-radius: 50%; display: grid; place-items: center; background: var(--solid); color: var(--ok); box-shadow: 0 0 0 1px var(--glass-rim); }
.v21aa-swk svg { width: 10px; height: 10px; fill: none; stroke: currentColor; stroke-width: 2.4; }
.v21aa-swb.is-worn::after { content: ""; position: absolute; left: 50%; bottom: 0; width: 6px; height: 6px; margin-left: -3px; border-radius: 50%; background: var(--brand-text); }
.v21aa-cwline { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 2px 0 0; min-height: 28px; }
.v21aa-cwname { font-weight: 700; }
.v21aa-need { font-weight: 600; color: var(--ink-2); }
:root[data-theme="high_contrast"] .v21aa-pk-card, :root[data-theme="high_contrast"] .v21aa-pk-tab, :root[data-theme="high_contrast"] .v21aa-chip { background: #FFFFFF; border: 2px solid #000000; box-shadow: none; }
:root[data-theme="high_contrast"] .v21aa-pk-card[aria-checked="true"], :root[data-theme="high_contrast"] .v21aa-chip[aria-checked="true"], :root[data-theme="high_contrast"] .v21aa-pk-tab[aria-selected="true"] { outline: 3px solid #000000; outline-offset: 2px; }
:root[data-theme="high_contrast"] .v21aa-pk-stage, :root[data-theme="high_contrast"] .v21aa-win { background: #FFFFFF; box-shadow: inset 0 0 0 2px #000000; }
:root[data-theme="high_contrast"] .v21aa-swd { box-shadow: inset 0 0 0 3px #000000; }
@media (forced-colors: active) { .v21aa-pk-card[aria-checked="true"], .v21aa-chip[aria-checked="true"], .v21aa-swb[aria-checked="true"] { outline: 3px solid Highlight; } }

/* ---------- still: reduced motion, Calm, the days that matter ---------- */
:root[data-motion="reduced"] .v21aa-pk-card, :root[data-calm="on"] .v21aa-pk-card, :root[data-day-matters] .v21aa-pk-card { transition: none; transform: none; }
:root[data-motion="reduced"] .v21aa-pk-stage > .av, :root[data-calm="on"] .v21aa-pk-stage > .av, :root[data-day-matters] .v21aa-pk-stage > .av { animation: none; }
@media (prefers-reduced-motion: reduce) { :root:not([data-motion="full"]) .v21aa-pk-card { transition: none; transform: none; } :root:not([data-motion="full"]) .v21aa-pk-stage > .av { animation: none; } }

/* ---------- narrow screens (390 px) ---------- */
@media (max-width: 520px) {
  .v21aa-pk { gap: 12px; }
  .v21aa-pk-side { flex-basis: 100%; }
  .v21aa-pk-grid { grid-template-columns: repeat(auto-fill, minmax(72px, 1fr)); gap: 6px; }
  .v21aa-pk-stage { min-height: 150px; }
  .v21aa-prof-av { width: 112px; min-height: 112px; }
  .v21aa-sw { gap: 1px; }
  .v21aa-swb { width: 36px; height: 36px; }
  .v21aa-swd { width: 24px; height: 24px; }
}
/* END BUILDER A */
