/* Cosmetics (shared/cosmetics.ts): nameplates, the tag that opens on a cosmetic, how each kind is drawn small
   (client/cosart.ts), Trainer > Style (client/style.ts) and the Style tab of the card others open
   (client/profilecard.ts). Looks only. */

/* ---------- nameplates (shared/nameplates.ts) ----------
   The plate behind a trainer's name, on top of .ncol (style.css): every plate is dark and exactly as tall as the plain
   one, so any name color reads on it and a chat line never changes height. Nothing here moves.

   EVERYTHING A PLATE DRAWS IS INSIDE ITS BOX: inset rings, ornaments placed in its own padding, no outer shadow or
   glow, nothing at a negative offset. A name is clipped by whatever holds it (a chat line's name column, a card's
   one-line name with its ellipsis), and anything outside the box was cut off on one side and not the other (Cole
   2026-11-28: "the left side seems to be more cut off than the right"). Left and right are mirror images, measured in
   px from each edge, never in % of the plate. Ornaments sit in the padding, never under the letters.

   ONE COLOR THAT FADES (Cole 2026-11-28): a plate is the dark 1px line and then its fill, like the plain plate. Its
   edge color glows in from that line and fades into the fill (an inset blur), never a crisp lighter ring inside it:
   a ring, two rings or end bars read as "a name tag pasted onto the background". Ornaments are dimmer than the name
   and leave about 4px of plate before the first letter, or they read as letters.
   A NEW PLATE is one `.np-<id>` rule (tests/cosmetics.test.ts names a miss). */
.ncol.nc-w { --nc: #f3e6cc; }
.ncol.np { position: relative; }
.ncol.np-ember { --np-em: 1; background: linear-gradient(180deg, #2c110b 0, #571b0c 55%, #b8501c 100%); box-shadow: inset 0 0 0 1px #1a0906, inset 0 0 5px 1px rgba(255, 160, 80, .42), inset 0 -5px 5px -3px rgba(255, 170, 80, .5); }
.ncol.np-gilt { --np-em: 0; --np-px: 24px; background: linear-gradient(180deg, #3a2b17, #20160b); box-shadow: inset 0 0 0 1px #150d06, inset 0 0 5px 1px rgba(232, 192, 102, .72), inset 0 2px 2px -1px rgba(255, 236, 190, .28); }
.ncol.np-gilt::before, .ncol.np-gilt::after { content: ''; position: absolute; top: 50%; width: 3.5px; height: 3.5px; margin-top: -1.75px; background: #cfae63; transform: rotate(45deg); }
.ncol.np-gilt::before { left: 4px; }
.ncol.np-gilt::after { right: 4px; }
.ncol.np-frost { --np-em: 1; background: linear-gradient(180deg, #27506e, #132a40); box-shadow: inset 0 0 0 1px #0d1a26, inset 0 0 5px 1px rgba(170, 222, 250, .45), inset 0 8px 6px -5px rgba(220, 245, 255, .5); }
.ncol.np-lantern { --np-em: 0; --np-px: 24px; background: radial-gradient(circle at 6px 50%, rgba(255, 196, 96, .95) 0 2px, rgba(255, 170, 60, .28) 3px, transparent 6px), radial-gradient(circle at calc(100% - 6px) 50%, rgba(255, 196, 96, .95) 0 2px, rgba(255, 170, 60, .28) 3px, transparent 6px), linear-gradient(180deg, #262a5e, #151838); box-shadow: inset 0 0 0 1px #0b0d22, inset 0 0 5px 1px rgba(255, 190, 110, .32); }
.ncol.np-starlit { --np-em: 0; --np-px: 24px; background: radial-gradient(circle at 5px 34%, #fff 0 .8px, transparent 1.4px), radial-gradient(circle at 9px 68%, #d6dcff 0 .7px, transparent 1.3px), radial-gradient(circle at calc(100% - 5px) 34%, #fff 0 .8px, transparent 1.4px), radial-gradient(circle at calc(100% - 9px) 68%, #d6dcff 0 .7px, transparent 1.3px), linear-gradient(180deg, #221c52, #3a1f63 70%, #16436a); box-shadow: inset 0 0 0 1px #0e0b26, inset 0 0 5px 1px rgba(190, 170, 255, .42); }
.ncol.np-laurel { --np-em: .9; background: linear-gradient(90deg, rgba(126, 184, 98, .38), rgba(126, 184, 98, 0) 10px, rgba(126, 184, 98, 0) calc(100% - 10px), rgba(126, 184, 98, .38)), linear-gradient(180deg, #234a2c, #12281a); box-shadow: inset 0 0 0 1px #0a160d, inset 0 0 5px 1px rgba(214, 196, 112, .5), inset 0 2px 2px -1px rgba(220, 255, 200, .14); }
.ncol.np-cup { --np-em: 1.1; background: linear-gradient(180deg, #5a1a22, #2b0c12); box-shadow: inset 0 0 0 1px #16060a, inset 0 0 5px 1px rgba(240, 196, 90, .42), inset 0 3px 3px -2px rgba(240, 196, 90, .55), inset 0 -3px 3px -2px rgba(240, 196, 90, .55); }

/* ---------- card frames, wherever one is drawn but the card above the team (themes/codex.css .pc-<id>) ----------
   A NEW FRAME is one `.fr-<id>` rule naming its 9-slice (shared/frames.ts; tests/cosmetics.test.ts names a miss). */
.fr-pass { --frame: url(frames/pass.png); }
.fr-ranked-s1 { --frame: url(frames/ranked-s1.png); }
/* The head of the card others open wears the trainer's frame. */
.ppx-head.ppx-fr { position: relative; box-shadow: none; padding: 16px 18px; }
.ppx-head.ppx-fr::after { content: ''; position: absolute; inset: 0; pointer-events: none; border: 12px solid transparent; border-image: var(--frame) 12 round; image-rendering: pixelated; }
/* The frame opens its tag from the card's border (client/profilecard.ts): a ring over the drawn frame, a little wider for a finger. */
.ppx-fr-hit { position: absolute; inset: 0; z-index: 1; --r: 14px; outline-offset: -3px; clip-path: polygon(evenodd, 0 0, 100% 0, 100% 100%, 0 100%, 0 0, var(--r) var(--r), calc(100% - var(--r)) var(--r), calc(100% - var(--r)) calc(100% - var(--r)), var(--r) calc(100% - var(--r)), var(--r) var(--r)); }

/* ---------- a cosmetic drawn small (client/cosart.ts) ---------- */
.cos-fit { width: 40px; height: 40px; image-rendering: pixelated; }
.cos-ic { width: 30px; height: 30px; image-rendering: auto; }
.cos-tt { font: italic 600 20px/1 var(--sans); color: #eadbbd; }
.cos-ribbon { display: block; width: 28px; height: 28px; color: #e9cc82; }
.cos-tt.cos-ttf { font: italic 600 15px/1.15 var(--sans); color: var(--ink); text-align: center; overflow-wrap: anywhere; }
/* The facts in the bar: each on one line, a dot between them that stays with the one before. */
.cz-f { white-space: nowrap; }
.cz-f.cz-f-how { white-space: normal; }
.cz-f:has(+ .cz-f)::after { content: ' \00b7'; }
.cos-tt.cos-tt-no { font-style: normal; font-weight: 500; color: var(--muted); }
.cos-plain { font: 700 15px/1.3 var(--sans); color: var(--ink); }
.cos-fr { display: block; width: 36px; height: 28px; box-sizing: border-box; border: 9px solid transparent; border-image: var(--frame) 12 round; image-rendering: pixelated; }
.cos-none { position: relative; display: block; width: 22px; height: 22px; border-radius: 50%; box-shadow: inset 0 0 0 2px color-mix(in srgb, currentColor 45%, transparent); }
.cos-none::after { content: ''; position: absolute; left: 50%; top: 2px; bottom: 2px; width: 2px; margin-left: -1px; background: color-mix(in srgb, currentColor 45%, transparent); transform: rotate(45deg); }
/* The dark square a cosmetic sits in on a slot, on the bar and on the card others open. */
.cz-th { flex: none; width: 40px; height: 40px; display: grid; place-items: center; border-radius: 3px; background: radial-gradient(circle, #4a3726, #22170e); box-shadow: inset 0 0 0 1px #7a6240; overflow: hidden; color: #cdb992; }
.cz-th .ncol { font: 700 13px/1.4 var(--sans); }
/* A slot thumb under 40px (phones, the itch window, tablets) is narrower than a plate with ornaments (Gilt, Lantern,
   Starlit: 38px with "Aa"), which was cut at one side: the sample is drawn smaller there, ornaments and all. */
@media (max-width: 1100px) { .cz-slot .cz-th-plate .ncol { zoom: .79; } }
.cz-th .cos-plain { color: #f3e6cc; font-size: 13px; }
.cz-th .cbadge { margin: 0; }
.cz-k { display: block; font: 600 10.5px/1 var(--pixel); letter-spacing: .06em; white-space: nowrap; text-transform: uppercase; opacity: .8; }
.cz-lock { display: inline-grid; width: 11px; height: 11px; flex: none; }
.cz-lock svg { width: 100%; height: 100%; }

/* ---------- the tag that opens on a cosmetic (client/costag.ts): dark, like every pop-up ---------- */
.ctag { position: fixed; z-index: 1300; width: 292px; max-width: calc(100vw - 16px); box-sizing: border-box; padding: 11px 12px 10px; color: #eadbbd; font: 14px/1.3 var(--sans); text-align: left;
  background: linear-gradient(180deg, #33251a, #241910); border-radius: 3px;
  box-shadow: 0 0 0 1px #120b06, 0 0 0 2px #b0915a, 0 0 0 3px #120b06, 0 10px 26px rgba(0, 0, 0, .55); }
.ctag[hidden] { display: none; }
.ctag-top { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 10px; align-items: center; }
.ctag-art { min-width: 52px; height: 52px; padding: 0 6px; box-sizing: border-box; display: grid; place-items: center; background: radial-gradient(circle, #4a3726, #1d140c); box-shadow: inset 0 0 0 1px #6f5836; border-radius: 3px; color: #cdb992; }
.ctag-art .cos-ic, .ctag-art .cbadge.art { width: 38px; height: 38px; }
.ctag-art .cos-fit { width: 46px; height: 46px; }
.ctag-art .cos-plain { color: #f3e6cc; }
.ctag-art .cbadge { margin: 0; font-size: 26px; }
.ctag-id { min-width: 0; }
.ctag-top.ctag-bare { grid-template-columns: minmax(0, 1fr); }
.ctag-bare .ctag-name { font: italic 700 20px/1.15 var(--sans); color: #f0d48c; margin-top: 5px; }
.ctag-kind { display: block; font: 600 10px/1 var(--pixel); letter-spacing: .14em; text-transform: uppercase; color: #b79a62; }
.ctag-name { display: block; font: 700 19px/1.1 var(--pixel); color: #f6e7c4; margin-top: 3px; overflow-wrap: anywhere; }
.ctag p { margin: 8px 0 0; color: #e2d2b2; }
.ctag-meta { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 9px; }
.ctag-chip { padding: 2px 7px; border-radius: 2px; background: #1a120b; box-shadow: inset 0 0 0 1px #5c482c; font-size: 12.5px; color: #d9c8a6; white-space: nowrap; }
.ctag-chip b { color: #f6e7c4; }
.ctag-chip.rare { box-shadow: inset 0 0 0 1px #c9a95e; color: #f0d48c; }
.ctag-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 10px; padding-top: 9px; border-top: 1px solid #4a3a25; font-size: 13px; color: #c9b792; }
.ctag-foot .btn { flex: none; text-decoration: none; }
/* A name's tag holds two: its nameplate, then its color. */
.ctag-one + .ctag-one { margin-top: 10px; padding-top: 10px; border-top: 1px solid #4a3a25; }
.ctag-price { display: inline-flex; align-items: center; gap: 4px; font-weight: 700; color: #f6e7c4; }
.ctag-price .dia { width: 16px; height: 16px; margin: 0; }
/* Anything that opens the tag says so to a mouse. */
[data-cos] { cursor: pointer; }
[data-cos]:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }

/* ---------- Trainer > Style (client/style.ts) ---------- */
.player-hub.ph-tab-style { display: block; }
.cz { display: grid; grid-template-columns: 320px minmax(0, 1fr); gap: 14px; align-items: start; }
.cz .ph-pv { margin: 0; min-width: 0; }
.cz .pv-try { color: var(--warn, #5e3f0e); font-weight: 700; font-style: italic; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.cz-main { display: grid; gap: 10px; padding: 14px 18px; min-width: 0; }
.cz-rail { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; }
.cz-slot { display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: 7px; align-items: center; text-align: left; padding: 6px 8px; min-height: 54px; border: 1px solid var(--line); border-radius: 4px; background: rgba(255, 248, 225, .25); color: var(--ink); font: inherit; cursor: pointer; min-width: 0; }
.cz-slot:hover { background: rgba(255, 248, 225, .45); }
.cz-slot.on { background: var(--accent); border-color: #16263a; color: #f3e7cb; box-shadow: inset 0 0 0 1px rgba(255, 240, 200, .35), 0 2px 0 rgba(0, 0, 0, .25); }
.cz-sl-t { min-width: 0; }
.cz-k-s, .cz-lk-s { display: none; }
.cz-v { display: block; margin-top: 3px; font: 700 14px/1.08 var(--sans); overflow: hidden; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow-wrap: anywhere; }
.cz-head { display: flex; align-items: center; gap: 12px; min-height: 32px; }
.cz-head h4 { margin: 0; white-space: nowrap; }
.cz-head .muted { font-size: 14px; white-space: nowrap; }
.cz-head .spacer { flex: 1; }
.cz-head .fsearch { width: 190px; flex: 0 1 190px; min-width: 0; }
.cz-seg { display: inline-flex; flex: none; }
.cz-seg button { padding: 4px 11px; min-height: 30px; border: 1px solid var(--line); background: transparent; color: var(--ink); font: 600 13.5px var(--sans); margin-left: -1px; cursor: pointer; }
.cz-seg button:first-child { border-radius: 4px 0 0 4px; margin-left: 0; }
.cz-seg button:last-child { border-radius: 0 4px 4px 0; }
.cz-seg button.on { background: var(--accent); color: #f3e7cb; border-color: #16263a; }
.cz-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; }
.cz-tile { position: relative; display: grid; grid-template-rows: 46px auto auto; justify-items: center; align-content: start; gap: 3px; padding: 8px 6px 7px; border: 1px solid var(--line); border-radius: 4px; background: rgba(255, 248, 225, .28); color: var(--ink); font: inherit; cursor: pointer; min-width: 0; }
.cz-tile:hover { background: rgba(255, 248, 225, .5); }
.cz-show { display: grid; place-items: center; width: 100%; height: 46px; padding: 0 4px; box-sizing: border-box; border-radius: 3px; background: linear-gradient(180deg, rgba(60, 42, 26, .16), rgba(60, 42, 26, .07)); min-width: 0; overflow: hidden; color: var(--muted); }
.cz-show .ncol { font: 700 15px/1.3 var(--sans); max-width: 100%; box-sizing: border-box; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cz-show .cos-plain { max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cz-show .cbadge { margin: 0; font-size: 22px; }
.cz-show .cos-fr { width: 64px; height: 36px; border-width: 12px; }
.cz-tile > b { font: 700 14.5px/1.1 var(--sans); max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cz-st { font-size: 12.5px; line-height: 1.2; color: var(--muted); display: inline-flex; align-items: center; gap: 3px; white-space: nowrap; max-width: 100%; min-width: 0; }
.cz-st > span { overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.cz-st .dia { width: 15px; height: 15px; margin: 0; }
.cz-st.price { color: var(--ink); font-weight: 700; }
.cz-st.on { color: #f3e7cb; background: var(--accent); padding: 1px 8px; border-radius: 2px; font-weight: 700; }
.cz-tile.worn { border-color: #16263a; box-shadow: inset 0 0 0 2px var(--accent); }
.cz-tile.try { border-color: #7a5a1a; box-shadow: inset 0 0 0 2px #c9a95e, 0 0 0 2px rgba(201, 169, 94, .35); background: rgba(255, 244, 205, .6); }
.cz-tile.lock .cz-show > * { opacity: .78; }
.cz-gone { position: absolute; top: 3px; right: 5px; z-index: 1; font: 600 10px/1 var(--pixel); letter-spacing: .08em; text-transform: uppercase; color: var(--bad, #77291f); }
/* Titles are their own picture: the words fill the tile, how each is got sits under them. */
.cz-g-title { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.cz-t-title { grid-template-rows: 46px auto; }
.cz-none { margin: 6px 0; }
.cz .fit-pager { margin: -2px 0; justify-content: flex-end; }
/* The bar: what the picked thing is and the way to it. Dark, like the tag. */
.cz-bar { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 14px; align-items: center; min-height: 62px; box-sizing: border-box; padding: 8px 14px; border-radius: 3px; color: #eadbbd; background: linear-gradient(180deg, #33251a, #241910); box-shadow: 0 0 0 1px #120b06, inset 0 0 0 1px #6f5836; }
.cz-bar > .cz-th { min-width: 46px; width: auto; height: 46px; padding: 0 10px; overflow: visible; background: radial-gradient(circle, #4a3726, #1d140c); }
.cz-bar > .cz-th .ncol { font-size: 15px; }
.cz-bar > .cz-th-outfit, .cz-bar > .cz-th-icon { padding: 0; width: 46px; }
.cz-bar-t { min-width: 0; }
.cz-bar-k { font: 600 10px/1 var(--pixel); letter-spacing: .14em; text-transform: uppercase; color: #b79a62; }
.cz-bar-n { font: 700 19px/1.1 var(--pixel); color: #f6e7c4; margin-left: 8px; overflow-wrap: anywhere; }
.cz-bar p { margin: 4px 0 0; font-size: 14px; line-height: 1.25; color: #d9c8a6; }
.cz-bar p b { color: #f6e7c4; }
.cz-buy { display: flex; align-items: center; gap: 10px; }
/* The chat button floats over the page's bottom right corner (style.css .cdock): the bar's button stays clear of it. */
@media (min-width: 761px) { .cz-bar { padding-right: 78px; } }
.cz-buy .btn { white-space: nowrap; text-decoration: none; }
.cz-buy .dia { width: 17px; height: 17px; }
.cz-on, .cz-locked { display: inline-flex; align-items: center; gap: 5px; font: 700 14px var(--sans); color: #b79a62; white-space: nowrap; }
.cz-on { color: #a8d090; }
/* Skin and hair, in the Outfit slot. */
.cz-look .lookpk { margin: 0; }

/* A desktop window short on height (1366x657, 1280x720): thinner tiles, so two rows and the bar still fit. */
@media (min-width: 1101px) and (max-height: 800px) {
  .cz-main { gap: 8px; padding: 10px 16px; }
  .cz-tile { grid-template-rows: 38px auto auto; padding: 6px 6px 5px; gap: 2px; }
  .cz-show { height: 38px; }
  .cz-t-title { grid-template-rows: 38px auto; }
  .cz-show .cos-fit { width: 36px; height: 36px; }
  .cz-slot { min-height: 50px; padding: 4px 8px; }
  .cz-bar { min-height: 56px; padding-top: 6px; padding-bottom: 6px; }
}
/* The big chat dock beside the page (1360 and up) narrows it. */
@media (min-width: 1101px) and (max-width: 1500px) {
  .cz { grid-template-columns: 312px minmax(0, 1fr); gap: 12px; }
  .cz-rail { gap: 6px; }
  .cz-slot { padding: 5px 6px; gap: 6px; }
}

/* Below desktop the preview lies across the top (a chat line and the card above your team, side by side) and the
   picker takes the full width. */
@media (max-width: 1100px) {
  .cz { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .cz .ph-pv { padding: 8px 12px 10px; }
  .cz .ph-pv > .ph-h { position: relative; min-height: 0; height: 0; margin: 0; }
  .cz .ph-pv > .ph-h h4 { display: none; }
  .cz .ph-pv .pv-try { position: absolute; right: 0; top: -2px; max-width: 60%; font-size: 12.5px; z-index: 1; }
  .cz .pv-views { grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 6px 10px; align-items: center; }
  .cz .pv-profile { display: none; }
  .cz-main { padding: 10px 12px; gap: 8px; }
  .cz .fit-pager { height: 28px; margin: -2px 0; }
  .cz .fit-pager .btn { min-height: 26px; height: 26px; }
}
@media (min-width: 761px) and (max-width: 1100px) {
  .cz-slot { grid-template-columns: 36px minmax(0, 1fr); padding: 4px 6px; gap: 6px; min-height: 46px; }
  .cz-slot .cz-th { width: 36px; height: 36px; }
  .cz-k-l { display: none; }
  .cz-k-s { display: inline; }
  .cz-v { font-size: 13px; -webkit-line-clamp: 1; }
  .cz-tile { grid-template-rows: 38px auto auto; padding: 6px 6px 5px; gap: 2px; }
  .cz-show { height: 38px; }
  .cz-t-title { grid-template-rows: 38px auto; }
  .cz-bar { min-height: 52px; padding-top: 6px; padding-bottom: 6px; }
  .cz-head .fsearch { height: 30px; }
}
@media (min-width: 761px) and (max-width: 1100px) and (max-height: 700px) {
  .cz .pv-l { display: none; }
  .cz .ph-pv { padding: 5px 10px; }
  .cz .pv-chat .pv-box { padding: 3px 8px; }
  .cz-main { padding: 8px 12px; gap: 6px; }
  .cz-grid, .cz-g-title { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
  /* The bar on one line: what it is, then how it is got. */
  .cz-bar { min-height: 0; padding-top: 4px; padding-bottom: 4px; }
  .cz-bar > .cz-th { height: 32px; min-width: 32px; }
  .cz-bar > .cz-th-outfit, .cz-bar > .cz-th-icon { width: 32px; }
  .cz-bar > .cz-th .cos-fit { width: 32px; height: 32px; }
  .cz-bar-t { display: flex; align-items: baseline; gap: 0 10px; flex-wrap: nowrap; min-width: 0; }
  .cz-bar-k, .cz-bar-n { flex: none; }
  .cz-bar-n { margin-left: 0; }
  .cz-bar p { margin: 0; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .cz-f-held { display: none; }
  .cz-f:has(+ .cz-f-held)::after { content: none; }
  .cz { gap: 6px; }
  .cz-main { gap: 5px; padding: 6px 12px; }
  .cz-slot { min-height: 40px; padding: 3px 6px; grid-template-columns: 32px minmax(0, 1fr); }
  .cz-slot .cz-th { width: 32px; height: 32px; }
  .cz-slot .cz-th .cos-fit { width: 32px; height: 32px; }
}
@media (min-width: 1000px) and (max-width: 1100px) and (max-height: 700px) { .cz-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); } }

/* The small tile, on a phone and on a short tablet (itch's 800x600, 860x585): the picture, then its name and state on one line. */
@media (max-width: 760px), (max-width: 1100px) and (max-height: 700px) {
  .cz-tile { grid-template-rows: 32px auto; grid-template-columns: minmax(0, 1fr) auto; align-items: center; justify-items: stretch; padding: 5px 8px; gap: 3px 6px; }
  .cz-t-title { grid-template-rows: 32px auto; }
  .cz-show { grid-column: 1 / -1; height: 32px; }
  .cz-show .cos-fit { width: 32px; height: 32px; }
  .cz-show .cos-ic, .cz-show .cbadge.art { width: 26px; height: 26px; }
  .cz-show .cos-fr { width: 52px; height: 26px; border-width: 8px; }
  .cz-show .cos-ttf { font-size: 14px; line-height: 1.05; }
  .cz-tile > b { justify-self: start; font-size: 14px; }
  .cz-st { justify-self: end; font-size: 12px; }
  .cz-t-title .cz-st { grid-column: 1 / -1; justify-self: center; }
  .cz-t-title > b + .cz-st { grid-column: auto; justify-self: end; }
  .cz-st > span { max-width: 9ch; }
  /* A locked thing keeps its lock and its whole name here; how it is got is on the bar when it is tapped. */
  .cz-tile:not(.cz-t-title) .cz-st > .cz-lock + span { display: none; }
  /* The name gets the whole line on a thing you own: only Worn, a price or a lock is worth the room. */
  .cz-tile:not(.cz-t-title) .cz-st.own { display: none; }
  .cz-tile:not(.cz-t-title) > b:has(+ .cz-st.own) { grid-column: 1 / -1; }
  .cz-t-title .cz-st > span { max-width: none; }
  .cz-gone { font-size: 9px; top: 2px; right: 4px; }
}

/* A phone: the preview one view under the other, six small slots, two tiles across. */
@media (max-width: 760px) {
  .cz .pv-views { grid-template-columns: minmax(0, 1fr); gap: 5px; }
  .cz .pv-l { display: none; }
  .cz .ph-pv { padding: 6px 8px 8px; }
  .cz .ph-pv .pv-try { position: static; display: block; max-width: none; text-align: right; }
  .cz .ph-pv > .ph-h { height: auto; }
  .cz .ph-pv > .ph-h:has(.pv-try:empty) { display: none; }
  .cz .pv-chat .pv-box { padding: 3px 6px; }
  .cz-main { padding: 8px 10px; gap: 7px; }
  .cz-rail { gap: 5px; }
  .cz-slot { grid-template-columns: minmax(0, 1fr); justify-items: center; gap: 3px; padding: 5px 2px 4px; min-height: 0; }
  .cz-slot .cz-v, .cz-k-l, .cz-lk-l { display: none; }
  .cz-k-s, .cz-lk-s { display: inline; }
  .cz-slot .cz-k { font-size: 10px; letter-spacing: .02em; }
  .cz-slot .cz-th { width: 36px; height: 36px; }
  .cz-head { gap: 8px; min-height: 30px; }
  .cz-head h4, .cz-head .spacer { display: none; }
  .cz-head .cz-count { order: 3; margin-left: auto; font-size: 13px; }
  .cz-head .fsearch { order: 3; flex: 1 1 0; width: auto; height: 30px; padding: 0 6px; }
  .cz-head:has(.fsearch) .cz-count { display: none; }
  .cz-head .fsearch input { height: 28px; min-height: 0; min-width: 0; }
  /* The Outfit slot's row holds Skin and hair in the search box's place. */
  .cz-head .cz-lk { order: 4; margin-left: auto; white-space: nowrap; }
  .cz-head:has(.cz-lk) :is(.cz-count, .fsearch) { display: none; }
  .cz-seg button { padding: 4px 8px; font-size: 13px; }
  .cz-grid, .cz-g-title { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
  .cz-bar { grid-template-columns: minmax(0, 1fr) auto; padding: 7px 10px; gap: 8px; min-height: 0; }
  .cz-bar > .cz-th { display: none; }
  .cz-bar-n { display: block; margin: 3px 0 0; font-size: 17px; }
  .cz-bar p { font-size: 13px; margin-top: 3px; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; }
  .cz-buy .btn { padding-left: 10px; padding-right: 10px; }
}
/* A short phone has room for the chat line alone above the picker, and the bar keeps to a name and one line. */
@media (max-width: 760px) and (max-height: 700px) {
  .cz .pv-card { display: none; }
  .cz .ph-pv { padding: 4px 6px; }
  .cz-main { gap: 6px; padding: 6px 8px; }
  .cz-slot { padding: 3px 2px 2px; gap: 2px; }
  .cz-slot .cz-th { width: 32px; height: 32px; }
  .cz-slot .cz-th .cos-fit { width: 32px; height: 32px; }
  .cz-tile { grid-template-rows: 26px auto; padding: 3px 7px; gap: 2px 6px; }
  .cz-t-title { grid-template-rows: 26px auto; }
  .cz-show { height: 26px; }
  .cz-show .cos-fit { width: 26px; height: 26px; }
  .cz-show .ncol { font-size: 14px; }
  .cz-grid, .cz-g-title { gap: 5px; }
  .cz-bar { padding: 5px 10px; }
  .cz-bar-k { display: none; }
  .cz-bar-n { margin: 0; }
  .cz-bar p { -webkit-line-clamp: 1; margin-top: 2px; }
  .cz-f-held { display: none; }
  .cz-f:has(+ .cz-f-held)::after { content: none; }
  /* One line on a short phone: the day you got it, or how it is got when you have not. */
  .cz-f-how:has(+ .cz-f:not(.cz-f-held)) { display: none; }
  .cz .ph-pv { padding: 2px 6px; }
  .cz .pv-chat .pv-box { padding: 0 2px; background: none; box-shadow: none; }
  .cz-main { gap: 4px; padding: 5px 8px; }
  .cz { gap: 6px; }
}
/* The shortest phones (320x568, 360x640): the preview keeps the line your name is on. */
@media (max-width: 760px) and (max-height: 650px) { .cz .pv-chat .cl-text { display: none; } }
@media (max-width: 340px) { .cz-seg button { padding: 4px 6px; } }

/* ---------- the Style tab of your own card (client/profilecard.ts styleTab; nobody else sees it) ---------- */
.ppx-wrs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.ppx-wr { display: grid; grid-template-columns: 46px minmax(0, 1fr); gap: 10px; align-items: center; padding: 8px 10px; min-height: 62px; box-sizing: border-box; border: 1px solid var(--line); border-radius: 4px; background: rgba(255, 248, 225, .28); min-width: 0; text-align: left; }
.ppx-wr[data-cos]:hover { background: rgba(255, 248, 225, .5); }
.ppx-wr > .cz-th { width: 46px; height: 46px; }
.ppx-wr.none > .cz-th { opacity: .6; }
.ppx-wr-t { display: grid; gap: 2px; min-width: 0; }
.ppx-wr-t > b { font: 700 16px/1.1 var(--sans); color: var(--ink); overflow-wrap: anywhere; }
.ppx-wr.none .ppx-wr-t > b { color: var(--muted); font-weight: 600; }
.ppx-wr-how { font-size: 12.5px; line-height: 1.2; color: var(--muted); text-wrap: balance; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; overflow: hidden; }
.ppx-wr-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 10px; font-size: 14.5px; color: var(--muted); }
.ppx-wr-foot b { color: var(--ink); }
.ppx-wr-foot .btn { text-decoration: none; }
.ppx-badge[data-cos], .ppx-title[data-cos] { cursor: pointer; }
/* On a phone each piece is its picture, slot and name; a tap opens its tag with the rest. */
@media (max-width: 760px) {
  .ppx-wrs { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 5px; }
  .ppx-wr { grid-template-columns: 34px minmax(0, 1fr); gap: 7px; padding: 4px 7px; min-height: 44px; }
  .ppx-wr > .cz-th { width: 34px; height: 34px; }
  .ppx-wr > .cz-th .cos-fit { width: 34px; height: 34px; }
  .ppx-wr > .cz-th .cos-ic, .ppx-wr > .cz-th .cbadge.art { width: 26px; height: 26px; }
  .ppx-wr > .cz-th .cos-fr { width: 30px; height: 24px; border-width: 8px; }
  .ppx-wr-t { gap: 1px; }
  .ppx-wr-t > b { font-size: 14px; line-height: 1.1; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; }
  .ppx-wr-how { display: none; }
  .ppx-wr-foot { margin-top: 6px; font-size: 13.5px; }
  .ppx-head.ppx-fr { padding: 14px 14px; }
}

/* ---------- the Diamond shop's Names shelf (client/style.ts shopPlates) ---------- */
.ds-ic-np { display: inline-grid; place-items: center; }
.ds-ic-np .ncol { font: 700 13px/1.4 var(--sans); }
.ds-np { flex: none; width: 56px; height: 56px; display: grid; place-items: center; border-radius: 3px; background: radial-gradient(circle, #4a3726, #22170e); box-shadow: inset 0 0 0 1px #7a6240; }
.ds-np .ncol { font: 700 14px/1.4 var(--sans); }
.ds-np-name .ncol { font-weight: 700; }

/* The preview's chat line: no time, so the icon and the title being picked have the room. */
.cz .pv-chat .cl .t { display: none; }
.ds-np-name { margin-left: 5px; }
@media (max-width: 760px) and (max-height: 600px) {
  .cz { gap: 4px; }
  .cz-main { padding: 4px 8px; }
  .cz-bar { padding: 3px 10px; }
  .cz-tile, .cz-t-title { grid-template-rows: 24px auto; padding: 2px 7px; }
  .cz-grid, .cz-g-title { gap: 4px; }
  .cz-show { height: 24px; }
  .cz-show .cos-fit, .cz-show .cos-ic, .cz-show .cbadge.art { width: 24px; height: 24px; }
  .cz-show .cos-fr { width: 48px; height: 20px; border-width: 7px; }
}
/* A short tablet: the small tile a little shorter, so two rows fit over the bar. */
@media (min-width: 761px) and (max-width: 1100px) and (max-height: 700px) {
  .cz-tile, .cz-t-title { grid-template-rows: 28px auto; padding: 4px 8px; }
  .cz-show { height: 28px; }
  .cz-show .cos-fit { width: 28px; height: 28px; }
  .cz-show .cos-fr { width: 52px; height: 24px; border-width: 8px; }
}
/* Six shelves on the Diamond shop's rail: on a phone their names set a little smaller, so "Featured" still reads. */
@media (max-width: 760px) { [data-theme="codex"] .bs-rail.ds-rail[style*="--n:6"] button { font-size: 11.5px; letter-spacing: 0; padding: 5px 0 4px; } }
@media (max-width: 360px) { [data-theme="codex"] .bs-rail.ds-rail[style*="--n:6"] { gap: 2px; } [data-theme="codex"] .bs-rail.ds-rail[style*="--n:6"] button { font-size: 10px; } }
/* Skin and hair on a phone: the look picker under the slots, with nothing else on the page's bottom. */
@media (max-width: 760px) {
  .cz-looking .pv-card { display: none; }
  .cz-look .lk-big { width: 88px; height: 88px; }
}
/* ...and on a short phone the picker has the page to itself (its own picture shows the look). */
@media (max-width: 760px) and (max-height: 700px) {
  .cz-looking .ph-pv, .cz-looking .cz-rail { display: none; }
  .cz-looking .cz-head .cz-seg { display: none; }
  .cz-looking .cz-head h4 { display: block; }
}
@media (max-width: 760px) and (max-height: 600px) { .cz-look .lk-big { width: 72px; height: 72px; } .cz-look .lookpk { gap: 5px; } }
@media (max-width: 760px) and (max-height: 600px) { .cz-look .lk-big { width: 64px; height: 64px; } .cz-look .lk-opts { gap: 3px; } }
/* Trainer > Showcase on a short phone: the companion's picture a little smaller, so the switches under it fit. */
@media (max-width: 760px) and (max-height: 700px) { .ph-show .ph-comp .picon-xl { zoom: .7; } }

/* The card's five tabs on a phone: each as wide as its word, so the longest is never cut. */
@media (max-width: 760px) {
  .ppop .psec-tabs { grid-template-columns: repeat(var(--n), auto); }
  .ppop .psec-tabs button { padding-inline: 2px; }
}

/* The card above your team, as wide as the real one on this screen (the hunt's left rail), so a long name sets at the
   size it really gets there. */
@media (min-width: 761px) { .cz .pv-card .pc { max-width: 286px; } }
@media (min-width: 761px) and (max-width: 1399px) { .cz .pv-card .pc { max-width: 254px; } }
.cz .pv-profile .ppx-name { font-size: 16px; }
/* The preview's card head is narrow: its frame takes a little less room than on the real card, so a name fits. */
.pv-profile .ppx-head.ppx-fr { padding: 14px 14px; gap: 8px; }
/* The shortest tablet window (860x585): a shade shorter again, which is what the second row needs. */
@media (min-width: 761px) and (max-width: 1100px) and (max-height: 590px) {
  .cz-tile, .cz-t-title { grid-template-rows: 24px auto; padding: 2px 8px; }
  .cz-grid, .cz-g-title { gap: 5px; }
  .cz-show { height: 24px; }
  .cz-show .cos-fit, .cz-show .cos-ic, .cz-show .cbadge.art { width: 24px; height: 24px; }
  .cz-show .cos-fr { width: 48px; height: 20px; border-width: 7px; }
  .cz-show .cos-ttf { font-size: 12px; line-height: 1; }
}

/* A trainer in their idle loop (client/tridle.ts): a canvas the size of the still it replaces. Its backing pixels
   are the screen's own, so nothing here scales it. */
canvas.tr-idle { flex: none; background-repeat: no-repeat; image-rendering: pixelated; }

/* The Trainer page on a phone. The name is sized by its length (--nl, client/player-hub.ts) to the room beside the
   portrait, so a long one on a nameplate never runs off the card; and the trainer stands a little higher, with
   their feet inside the portrait's frame. */
@media (max-width: 760px) {
  [data-theme="codex"] .ph-name { font-size: clamp(12px, calc((100vw - 196px) / (var(--nl, 10) * .56 + 1.5)), 28px); white-space: nowrap; }
}
@media (max-width: 1100px) { .ph-portrait .picon-xl { transform: translateY(-3px); } }
