/* V4 adopts the final Set Planner V2 workstation design from the
   staging V2 liquid-glass-v1, liquid-glass-bubbles-v2 and planner-slim-v1.
   Only visual/UI markup is adapted. Engine canvas, state and listeners stay V4. */
:root{
  --v2-design-bg:#080e1a;
  --v2-design-panel:linear-gradient(155deg,rgba(36,65,107,.70),rgba(13,30,55,.86) 60%,rgba(13,34,58,.78));
  --v2-design-edge:rgba(181,222,255,.19);
  --v2-design-accent:#8aeaff;
  --v2-design-muted:#8ba7bf;
  --v2-bubble-rim:rgba(195,229,255,.48);
  --v2-bubble-base:radial-gradient(circle at 28% 4%,rgba(247,254,255,.30),transparent 48%),linear-gradient(145deg,rgba(129,181,239,.34),rgba(43,83,155,.23));
  --v2-bubble-hover:radial-gradient(circle at 26% 6%,rgba(248,253,255,.39),transparent 49%),linear-gradient(145deg,rgba(163,212,255,.40),rgba(67,113,194,.30));
  --v2-bubble-shadow:inset 0 2px 1px rgba(255,255,255,.27),inset 0 -1px rgba(0,20,50,.5),0 8px 21px rgba(2,15,40,.23);
}
html{background:var(--v2-design-bg)}
body{
  font:500 13px/1.55 Inter,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;
  background:#080e1a;
  color:#eef8ff;
}
body:before{
  content:"";position:fixed;z-index:-1;pointer-events:none;inset:0;
  background:radial-gradient(ellipse 55% 60% at 48% -13%,rgba(74,142,218,.13),transparent 70%),
    radial-gradient(ellipse 42% 48% at 99% 96%,rgba(30,101,167,.12),transparent 70%);
}
.top{display:none}
main{
  display:grid;
  width:100%;max-width:none;
  min-height:100dvh;height:100dvh;
  margin:0;gap:11px;
  padding:9px 11px 11px;
  grid-template-columns:minmax(238px,300px) minmax(390px,1fr) minmax(248px,300px);
  grid-template-rows:minmax(0,1fr);
  align-items:stretch;
}
main>.catalog{grid-column:1;grid-row:1}
main>.scene{grid-column:2;grid-row:1}
main>.side{grid-column:3;grid-row:1}
main>.panel,main>.side>.panel{
  min-width:0;min-height:0;max-height:none;
  display:flex;flex-direction:column;
  border:1px solid var(--v2-design-edge);
  border-radius:24px;
  background:var(--v2-design-panel);
  box-shadow:inset 0 1px 0 rgba(255,255,255,.15),0 10px 26px rgba(0,0,0,.20);
  backdrop-filter:none;-webkit-backdrop-filter:none;
  overflow:hidden;
}
main>.side{
  display:flex;
  grid-column:3;
  flex-direction:column;
  min-width:0;min-height:0;
  gap:10px;
  overflow-x:hidden;
  overflow-y:auto;
  scrollbar-width:thin;
}
main>.catalog{min-height:0;height:100%;max-height:none}
main>.scene{min-height:0;height:100%;max-height:none;overflow-y:auto;scrollbar-width:thin}
main>.side>.v4-appearance-pane{flex:0 0 auto}
.v4-v2-panelheader{
  display:flex;justify-content:space-between;align-items:center;
  gap:11px;
  min-height:53px;
  padding:10px 13px;
  flex:0 0 auto;
  border-bottom:1px solid rgba(175,216,249,.16);
  background:linear-gradient(180deg,rgba(179,223,255,.038),transparent);
}
.v4-section-title{display:flex;flex-direction:column;gap:2px;min-width:0}
.v4-section-title h2{
  font-size:15px;
  line-height:1.3;
  font-weight:720;
  color:#edf9ff;
  letter-spacing:-.018em;
  margin:0;
}
.v4-section-title>span{
  font-size:11px;line-height:1.3;
  font-weight:500;color:#8ba7bf;
}
.v4-v2-panel-icon{
  width:30px;height:30px;flex:0 0 30px;
  display:grid;place-items:center;
  color:#9ee9ff;
  border:1px solid rgba(145,217,255,.16);
  background:rgba(81,156,215,.11);
  border-radius:10px;
}
.v4-v2-panel-icon svg{
  width:17px;height:17px;
  fill:none;stroke:currentColor;stroke-width:1.7;
  stroke-linecap:round;stroke-linejoin:round;
}
.v4-v2-panelheader .compare-actions{
  flex:1;justify-content:flex-end;min-width:0;flex-wrap:wrap;
}
.v4-preview-pane .scenetop{
  padding:10px 13px;
  margin:-12px -12px 0;
}
.v4-preview-pane .scenetop:after,.v4-library-pane .panelheader:after{display:none}
.v4-preview-pane .scenetop .flag{display:none}
.v4-preview-pane .compare-actions #compare-toggle,
.v4-preview-pane .compare-actions #difference-toggle,
.v4-preview-pane .compare-actions #v4-focus-toggle{
  font-size:10px;min-height:30px;padding:5px 8px;
}
.v4-preview-pane .canvaswrap{
  width:100%;
  height:auto;
  min-height:255px;
  aspect-ratio:200/128;
  border:1px solid rgba(142,200,241,.21);
  border-radius:17px;
  background:repeating-conic-gradient(rgba(107,159,201,.075) 0 25%,rgba(5,15,30,.16) 0 50%) 50%/22px 22px,
   linear-gradient(145deg,rgba(7,20,36,.74),rgba(14,33,53,.48));
  box-shadow:inset 0 1px 1px rgba(200,235,255,.12),inset 0 -35px 70px rgba(3,11,21,.18),0 13px 32px rgba(0,0,0,.16);
  overflow:hidden;
}
.v4-preview-pane .canvaswrap canvas{width:100%;height:auto;aspect-ratio:3/2;image-rendering:pixelated}
.v4-preview-pane .canvaswrap:before{opacity:.22}
.v4-preview-pane .canvas-hint{
  background:rgba(7,21,39,.7);
  border-color:rgba(164,219,250,.18);
  color:#b6cde0;
}
.v4-preview-pane .progress{
  border-color:rgba(144,204,242,.13);
  background:rgba(4,17,31,.23);
}
.v4-preview-pane .v4-toolbar-grid{gap:9px}
.v4-preview-pane .v4-toolbar-grid .v4-toolbar-block{
  border:1px solid rgba(153,213,255,.11);
  border-radius:16px;padding:11px;
  background:rgba(4,17,31,.23);
}
.v4-toolbar-label strong{color:#a1c7dd;font-size:11px;font-weight:700;letter-spacing:.07em}
.v4-preview-pane .control,
.v4-appearance-pane button{
  color:#d9ecf9;
  border:1px solid rgba(149,202,250,.25);
  border-radius:10px;
  background:linear-gradient(145deg,rgba(67,111,167,.21),rgba(20,47,86,.38));
  box-shadow:inset 0 1px 0 rgba(255,255,255,.10);
}
.v4-preview-pane .control:hover{color:#f2fcff;background:rgba(99,180,233,.24);border-color:rgba(122,216,255,.38)}
.v4-preview-pane .control.active{color:#d9f8ff;background:rgba(47,164,216,.20);border-color:rgba(113,220,253,.42)}
.v4-wearing-group{min-width:0}
.v4-wearing-group>#v4-equipped{
  border:1px solid rgba(153,213,255,.11);
  border-radius:16px;
  background:rgba(4,17,31,.23);
  padding:11px;
  box-shadow:none;
  overflow:visible;
}
.v4-wearing-group #v4-equipped .panelheader{
  min-height:auto;
  margin:0 0 10px;
  padding:1px 0 9px;
  border-bottom:1px solid rgba(153,213,255,.11);
  background:none;
}
.v4-wearing-group #v4-equipped .panelheader h2{
  font-size:11px;letter-spacing:.07em;font-weight:700;color:#a1c7dd;
}
.v4-wearing-group #v4-equipped .panelheader:after{display:none}
.v4-wearing-group #v4-equipped .slots{padding:0;gap:9px}
.v4-wearing-group #v4-equipped .slot-item.v4-equipped-item{
  border:1px solid rgba(141,207,248,.16);
  background:linear-gradient(135deg,rgba(78,127,187,.13),rgba(30,56,94,.09));
  min-height:64px;
}
.v4-wearing-group #v4-equipped .v4-empty-slot{
  border-color:rgba(141,207,248,.14);
  background:linear-gradient(135deg,rgba(78,127,187,.065),rgba(30,56,94,.045));
}
.v4-library-pane .catalog-controls{padding:0 11px 9px;gap:8px}
.v4-library-pane .coverage{margin:10px 11px 8px}
.v4-library-pane .v4-viewbar{padding:0 1px}
.v4-library-pane .tab{
  color:#b3d1e6;
  background:radial-gradient(circle at 30% 0%,rgba(212,238,255,.11),transparent 60%),linear-gradient(145deg,rgba(91,147,206,.22),rgba(29,62,108,.2));
  border:1px solid rgba(165,218,255,.27);
  border-radius:11px;
  box-shadow:inset 0 1px rgba(247,252,255,.12);
  padding:6px 10px;
}
.v4-library-pane .tab:hover{border-color:rgba(212,242,255,.63);color:#f3faff}
.v4-library-pane .tab.active{
  color:#e7faff;
  background:linear-gradient(145deg,rgba(96,195,246,.35),rgba(37,92,173,.3));
  border-color:rgba(169,239,255,.89);
  box-shadow:inset 0 1px rgba(255,255,255,.2),0 0 14px rgba(79,185,255,.13);
}
.v4-library-pane .items{flex:1 1 0;min-height:0;max-height:none;height:auto;overflow:auto}
#v4-library[data-v4-layout=tiles] .items{
  grid-template-columns:repeat(auto-fill,minmax(65px,1fr));
  gap:9px;padding:11px 11px 16px;
}
#v4-library[data-v4-layout=tiles] .item{
  display:grid;
  place-items:center;
  isolation:isolate;
  position:relative;
  aspect-ratio:1;
  width:100%;height:auto;
  min-height:0;
  padding:0;overflow:hidden;
  border-radius:22px;
  border:1px solid var(--v2-bubble-rim);
  background:var(--v2-bubble-base);
  box-shadow:var(--v2-bubble-shadow);
  transition:transform .2s,border-color .2s,box-shadow .2s,background .2s;
}
#v4-library[data-v4-layout=tiles] .item:before{
  content:"";position:absolute;inset:0;z-index:0;
  border-radius:inherit;pointer-events:none;
  background:radial-gradient(ellipse 70% 30% at 36% 7%,rgba(255,255,255,.13),transparent 82%);
}
#v4-library[data-v4-layout=tiles] .item:after{
  content:"";position:absolute;inset:0;z-index:2;
  width:auto;height:auto;right:0;top:0;
  border-radius:inherit;pointer-events:none;
  display:block;place-items:unset;
  color:transparent;box-shadow:none;
  background:linear-gradient(145deg,rgba(255,255,255,.21),transparent 44%);
}
#v4-library[data-v4-layout=tiles] .item:hover,
#v4-library[data-v4-layout=tiles] .item:focus-visible{
  border-color:rgba(212,242,255,.68);
  background:var(--v2-bubble-hover);
  box-shadow:inset 0 2px 1px rgba(255,255,255,.40),0 13px 28px rgba(5,24,61,.34),0 0 23px rgba(109,186,255,.14);
}
#v4-library[data-v4-layout=tiles] .item.selected{
  border-color:rgba(157,240,255,.94);
  background:radial-gradient(circle at 25% 5%,rgba(243,255,255,.40),transparent 48%),
    linear-gradient(145deg,rgba(97,188,244,.47),rgba(20,98,178,.38));
  box-shadow:inset 0 2px 1px rgba(255,255,255,.41),inset 0 -1px rgba(9,45,84,.5),
    0 0 0 2px rgba(51,182,243,.22),0 8px 22px rgba(16,88,160,.24);
}
#v4-library[data-v4-layout=tiles] .item.selected:before{
  box-shadow:inset 0 0 0 1px rgba(181,251,255,.2);
}
#v4-library[data-v4-layout=tiles] .item img,
#v4-library[data-v4-layout=tiles] .item canvas{
  position:relative;z-index:1;
  width:40px;height:40px;
  min-width:40px;max-width:40px;
  flex:0 0 40px;
  border:0;border-radius:0;
  background:transparent;
  object-fit:contain;
  image-rendering:pixelated;
  box-shadow:none;
}
#v4-library[data-v4-layout=tiles] .item .text{
  position:absolute;
  width:1px;height:1px;
  overflow:hidden;
  clip-path:inset(50%);
  white-space:nowrap;
}
.v4-appearance-column .v4-appearance-pane{
  border-radius:24px;
}
.v4-appearance-column .v4-appearance-content{
  display:flex;
  flex-direction:column;
  gap:11px;
  padding:11px;
}
.v4-appearance-column .v4-appearance-group{
  display:flex;flex-direction:column;
  gap:10px;
  padding:11px;
  border:1px solid rgba(155,206,251,.11);
  border-radius:16px;
  background:linear-gradient(145deg,rgba(67,113,177,.15),rgba(24,58,109,.14));
}
.v4-appearance-column .v4-appearance-group-title{
  color:#9ec3dc;font-size:10px;font-weight:720;letter-spacing:.11em;text-transform:uppercase;
}
.v4-appearance-column .v4-character-options{
  display:flex;flex-direction:column;
  gap:7px;
}
.v4-appearance-column #skin{
  min-height:37px;max-width:none;width:100%;
  background:rgba(4,15,29,.52);
  border:1px solid rgba(155,207,245,.19);
  border-radius:12px;
}
.v4-appearance-column .v4-effects-label{
  display:flex;align-items:center;gap:9px;
  font-size:11px;color:#d5e9f6;
}
.v4-appearance-column .v4-effects-label #effects{
  width:17px;height:17px;min-width:17px;
  accent-color:#8aeaff;
}
.v4-appearance-column #item-options{
  padding:0;
}
.v4-appearance-column .v4-advanced-tools{
  flex:0 0 auto;
  overflow:hidden;
}
.v4-appearance-column #item-options:empty::before{
  font-size:11px;color:#8ba7bf;
}
.v4-v2-swatches{
  display:grid;
  grid-template-columns:repeat(7,minmax(0,1fr));
  gap:7px;
  width:100%;
}
.v4-v2-swatches button{
  display:block;
  position:relative;
  width:100%;
  aspect-ratio:1;
  min-height:29px;
  padding:0;border:1px solid rgba(226,241,255,.35);
  border-radius:9px;
  background:var(--v2-swatch,#ba927b);
  box-shadow:inset 0 1px 0 rgba(255,255,255,.37),inset 0 -2px 2px rgba(0,0,0,.27),0 4px 11px rgba(0,0,0,.16);
}
.v4-v2-swatches button.on{
  outline:2px solid #8be7ff;outline-offset:2px;
}
.v4-v2-swatches button:hover{filter:brightness(1.15)}
.v4-v2-swatches button:disabled{opacity:.42;cursor:not-allowed}
.v4-appearance-column .v4-character-options[data-v4-has-swatches]{
  display:none;
}
@media(min-width:1181px) and (max-width:1440px){
  main{grid-template-columns:minmax(230px,300px) minmax(350px,1fr) minmax(230px,300px)}
  #v4-library[data-v4-layout=tiles] .items{
    grid-template-columns:repeat(auto-fill,minmax(63px,1fr));
  }
}
@media(max-width:1180px){
  main{
    height:auto;min-height:100dvh;
    grid-template-columns:minmax(0,1fr) minmax(0,1fr);
    grid-template-rows:auto auto;
    align-items:stretch;
  }
  main>.scene{
    grid-column:1/-1;grid-row:1;
    height:auto;overflow:visible;
    min-height:400px;
  }
  main>.catalog{grid-column:1;grid-row:2;min-height:400px;height:680px}
  main>.side{grid-column:2;grid-row:2;min-height:400px;height:680px;overflow-y:auto;display:flex}
  .v4-preview-pane .canvaswrap{width:min(100%,860px);align-self:center;min-height:0}
}
@media(max-width:760px){
  .v4-mobile-jump.v4-v2-mobile-tabs{
    display:grid;
    grid-template-columns:repeat(3,minmax(0,1fr));
    gap:5px;padding:4px;
    position:sticky;top:0;z-index:40;
    margin:6px 7px 0;
    border:1px solid rgba(168,224,255,.22);
    border-radius:13px;
    background:linear-gradient(145deg,rgba(89,150,210,.20),rgba(18,42,78,.88));
  }
  .v4-v2-mobile-tabs button{
    min-height:40px;
    border:0;
    border-radius:10px;
    background:transparent;
    color:#a8c6db;
    font:700 12px/1.2 Inter,system-ui,sans-serif;
    cursor:pointer;
  }
  .v4-v2-mobile-tabs button[aria-selected=true]{
    color:#e8faff;
    background:linear-gradient(145deg,rgba(103,190,241,.32),rgba(34,102,178,.3));
    box-shadow:inset 0 1px rgba(255,255,255,.16);
  }
  main{
    display:flex;
    flex-direction:column;
    min-height:calc(100dvh - 64px);
    height:auto;
    padding:7px 7px 18px;gap:8px;
  }
  main>.panel,main>.side{width:100%;min-width:0}
  main>.scene{order:0}
  main>.catalog{order:1}
  main>.side{order:2}
  body[data-v4-view=preview] main>.catalog,
  body[data-v4-view=preview] main>.side,
  body[data-v4-view=items] main>.scene,
  body[data-v4-view=items] main>.side,
  body[data-v4-view=edit] main>.catalog,
  body[data-v4-view=edit] main>.scene{display:none!important}
  body[data-v4-view=items] main>.catalog{
    height:calc(100dvh - 81px);
    max-height:calc(100dvh - 81px);
    min-height:470px;
  }
  body[data-v4-view=edit] main>.side{
    height:auto;min-height:0;max-height:none;
  }
  main>.scene{height:auto;min-height:0}
  .v4-preview-pane .scenetop{margin:-9px -9px 0;padding:9px 11px;min-height:48px}
  .v4-preview-pane .canvaswrap{width:100%;min-height:0}
  .v4-v2-panelheader{min-height:48px;padding:9px 11px}
  #v4-library[data-v4-layout=tiles] .items{
    grid-template-columns:repeat(auto-fill,minmax(64px,1fr));
    gap:10px;padding:12px 14px 20px;
  }
  .v4-appearance-column .v4-appearance-content{padding:9px;gap:9px}
  .v4-appearance-column .v4-appearance-group{padding:11px}
  .v4-mobile-jump button{min-width:0}
  .v4-preview-pane .compare-actions{min-width:0}
  .v4-preview-pane .scenetop .v4-v2-panel-icon{display:none}
  .v4-preview-pane .scenetop .compare-actions{
    flex:0 1 auto;
    gap:4px;
  }
  .v4-preview-pane .scenetop #compare-toggle{
    font-size:10px;padding:5px 7px;
  }
  main #v4-character,main #v4-library,main #v4-appearance{
    scroll-margin-top:64px;
  }
}
@media(max-width:370px){
  .v4-preview-pane .v4-section-title>span{display:none}
  .v4-preview-pane .scenetop #compare-toggle{font-size:9px}
  .v4-v2-panel-icon{display:none}
}
@media(prefers-reduced-motion:reduce){
  #v4-library[data-v4-layout=tiles] .item{transition:none}
}

/* Renderer diagnostics remain available, but don't clutter the V2 shell. */
.v4-renderer-mode{
  padding:11px 10px 9px;
  margin:8px 8px 2px;
  background:rgba(4,16,31,.29);
  border:1px solid rgba(159,210,246,.12);
  border-radius:12px;
}
.v4-renderer-mode nav{
  display:flex;
  flex-wrap:wrap;
  gap:6px;
  margin-top:9px;
}
.v4-renderer-mode nav .link{
  flex:1 1 auto;
  display:inline-flex;
  align-items:center;justify-content:center;
  min-height:34px;
  font-size:10px;padding:7px;
  border-radius:9px;
  text-decoration:none;
}
.v4-renderer-mode nav .link.v4-mode-active{
  border-color:rgba(153,229,255,.75);
  color:#e6faff;
}

/* The exact V2 native category artwork and wrapped category navigation. */
.v4-library-pane .catalog-controls .tabs{
  display:flex;
  flex-wrap:wrap;
  align-content:flex-start;
  overflow-x:hidden;
  overflow-y:auto;
  max-height:132px;
  gap:6px;
  padding:1px 1px 4px;
  scroll-snap-type:none;
  scrollbar-width:thin;
}
.v4-library-pane .catalog-controls .tabs .tab{
  flex:0 0 auto;
  white-space:nowrap;
  min-height:36px;
  display:inline-flex;
  justify-content:center;
  align-items:center;
  gap:5px;
  padding:5px 8px;
  font-size:11px;
  scroll-snap-align:none;
}
.v4-library-pane .catalog-controls .tabs .tab[data-v2-icon]:before{
  content:"";
  display:block;
  flex:0 0 30px;
  width:30px;height:30px;
  border:0;border-radius:0;
  background-image:url("/lab/v2-original-category-icons.png");
  background-repeat:no-repeat;
  background-size:360px 30px;
  background-position:var(--v2-category-offset,0px) center;
  image-rendering:pixelated;
  filter:drop-shadow(0 1px 2px #0008);
}
@media(max-width:760px){
  .v4-library-pane .catalog-controls .tabs{max-height:120px}
  .v4-library-pane .catalog-controls .tabs .tab{min-height:35px;padding:5px 7px}
  .v4-library-pane .catalog-controls .tabs .tab[data-v2-icon]:before{
    flex:0 0 26px;width:26px;height:26px;
    background-size:312px 26px;
    background-position:var(--v2-category-mobile-offset,0px) center;
  }
}

/* Screenshot parity: V2 prioritizes a tall preview and a slim action strip.
   V4 movement/aim remain accessible through the source-backed Go! toggle. */
.v4-preview-pane .canvaswrap{
  flex:0 0 auto!important;
  width:100%!important;
  height:auto!important;
  min-height:0!important;
  aspect-ratio:200/128;
  background:linear-gradient(145deg,rgba(25,26,32,.97),rgba(35,34,41,.94));
  box-shadow:inset 0 1px 1px rgba(208,229,242,.11),0 11px 31px rgba(0,0,0,.17);
}
.v4-preview-pane .canvaswrap::before{display:none}
.v4-preview-pane .canvas-hint{
  bottom:9px;left:50%;right:auto;
  color:#a7b4c5;font-size:9px;
  background:rgba(13,24,38,.8);
}
.v4-v2-go{
  position:absolute;bottom:12px;left:12px;z-index:7;
  display:inline-flex;align-items:center;justify-content:center;
  min-height:32px;padding:5px 13px;
  color:#edf8ff;
  font:700 11px/1.2 Inter,system-ui,sans-serif;
  border:1px solid rgba(162,216,250,.38);
  border-radius:14px;
  cursor:pointer;
  background:radial-gradient(circle at 24% 5%,rgba(242,249,255,.21),transparent 52%),
    linear-gradient(145deg,rgba(87,136,202,.45),rgba(32,66,115,.43));
  box-shadow:inset 0 1px rgba(255,255,255,.21),0 4px 10px rgba(0,10,28,.32);
}
.v4-v2-go:hover{
  color:#fff;border-color:#b8eaff;background:rgba(74,165,222,.49);
}
.v4-v2-go[aria-expanded=true]{
  background:rgba(80,173,219,.46);border-color:#8ce5ff;
}
.v4-preview-pane .v4-toolbar-grid{
  display:flex!important;
  flex-direction:column;
  flex-wrap:nowrap;
  gap:7px;
  grid-template-columns:none!important;
}
.v4-preview-pane .v4-toolbar-grid .v4-toolbar-block{
  min-width:0;
  border:1px solid rgba(155,213,255,.11);
  border-radius:11px;
  padding:7px;
  background:rgba(4,17,31,.20);
}
.v4-preview-pane .v4-toolbar-grid .v4-toolbar-block:nth-child(2){
  order:-1;
  display:flex!important;
  flex-direction:column;
  flex:0 0 auto;
  padding:8px 9px;
}
.v4-preview-pane .v4-toolbar-grid .v4-toolbar-block:nth-child(1),
.v4-preview-pane .v4-toolbar-grid .v4-toolbar-block:nth-child(3){
  display:none!important;
}
.v4-preview-pane.v4-v2-play-open .v4-toolbar-grid .v4-toolbar-block:nth-child(1),
.v4-preview-pane.v4-v2-play-open .v4-toolbar-grid .v4-toolbar-block:nth-child(3){
  display:flex!important;
  flex-direction:column;
}
.v4-preview-pane .v4-toolbar-grid .v4-toolbar-label{display:none!important}
.v4-preview-pane .v4-toolbar-grid .bar{
  display:flex;flex-wrap:wrap;justify-content:center;
  align-items:center;gap:6px;
}
.v4-preview-pane .v4-toolbar-grid .control{
  min-height:30px;
  padding:6px 9px;
  font-size:11px;
  border-radius:8px;
}
.v4-preview-pane #v4-v2-fx{
  min-width:35px;min-height:30px;
  color:#a9becf;
  font-size:17px;
  line-height:1;
  font-weight:750;
}
.v4-preview-pane #v4-v2-fx.active{
  color:#98edff;
  background:rgba(53,159,219,.27);
  border-color:rgba(132,222,255,.65);
}
.v4-preview-pane #pause{min-width:35px;min-height:30px;font-size:15px}
.v4-preview-pane #clear{color:#daeafa}
.v4-preview-pane #zoom-label{font-size:10px}
.v4-preview-pane .v4-wearing-group{
  flex:0 0 auto;
}
@media(max-width:760px){
  .v4-preview-pane .canvaswrap{
    min-height:0!important;
    aspect-ratio:200/128!important;
  }
  .v4-v2-go{bottom:10px;left:9px;min-height:31px}
  .v4-preview-pane .canvas-hint{
    max-width:calc(100% - 100px);
    left:calc(50% + 34px);
    font-size:9px;
  }
  .v4-preview-pane .v4-toolbar-grid .bar{gap:5px;justify-content:center}
  .v4-preview-pane .v4-toolbar-grid .control{
    min-height:36px;padding:7px 8px;font-size:10px;flex:0 1 auto;
  }
  .v4-preview-pane .v4-toolbar-grid .v4-toolbar-block:nth-child(1) .control,
  .v4-preview-pane .v4-toolbar-grid .v4-toolbar-block:nth-child(3) .control{
    min-height:40px;
  }
}

/* Final V2 action-strip fidelity: native V4 buttons are relocated without
   replacing their click handlers or adding CSS sprite/animation substitutions. */
.v4-v2-stage-zoom{
  position:absolute;z-index:9;right:9px;top:9px;
  display:flex;align-items:center;justify-content:center;
  min-height:35px;gap:2px;padding:4px;
  border-radius:16px;
  border:1px solid rgba(171,215,255,.42);
  background:linear-gradient(160deg,rgba(82,119,170,.65),rgba(42,66,102,.82));
  box-shadow:inset 0 1px rgba(255,255,255,.22),0 4px 13px rgba(0,8,28,.34);
}
.v4-v2-stage-zoom .control{
  width:25px;min-width:25px!important;height:26px;min-height:26px;
  padding:0!important;
  border-radius:50%;border:1px solid rgba(157,224,255,.38);
  background:linear-gradient(160deg,rgba(98,158,215,.55),rgba(38,85,142,.65));
  font-size:0!important;color:#f5fbff;
  box-shadow:inset 0 1px rgba(255,255,255,.2);
}
.v4-v2-stage-zoom #zoom-out::before{content:"−";font-size:16px}
.v4-v2-stage-zoom #zoom-in::before{content:"+";font-size:16px}
.v4-v2-stage-zoom #zoom-label{color:#e0f6ff;min-width:43px;text-align:center;font-weight:700;font-size:11px}
.v4-v2-stage-zoom .control:hover{background:rgba(126,191,247,.56)}
.v4-v2-action-row{
  display:flex;align-items:center;flex-wrap:wrap;justify-content:flex-start;
  gap:7px;min-width:0;
  margin:8px 0 0;padding:8px;
  border:1px solid rgba(149,209,255,.12);
  border-radius:14px;
  background:linear-gradient(155deg,rgba(18,42,75,.30),rgba(7,22,43,.23));
}
.v4-v2-action-row .v4-v2-core-actions{display:flex;align-items:center;gap:6px;flex:0 0 auto}
.v4-v2-action-row button.control{
  min-height:33px;padding:7px 10px;
  border-radius:9px;
  border:1px solid rgba(166,220,253,.25);
  color:#dbeeff;
  background:radial-gradient(circle at 23% 0%,rgba(232,249,255,.15),transparent 62%),
    linear-gradient(145deg,rgba(91,152,214,.24),rgba(27,61,111,.34));
  box-shadow:inset 0 1px rgba(255,255,255,.12),0 2px 6px rgba(0,9,26,.12);
  font:700 11px/1.2 Inter,system-ui,sans-serif;
}
.v4-v2-action-row button.control:hover{
  background:linear-gradient(145deg,rgba(123,197,255,.34),rgba(42,102,184,.32));
  border-color:rgba(186,239,255,.72);
  color:#f4fcff;
}
.v4-v2-action-row #pause,
.v4-v2-action-row #v4-v2-fx{width:37px;min-width:37px;max-width:37px;padding:6px 4px;font-size:17px}
.v4-v2-action-row #v4-v2-fx.active{color:#b3f8ff;border-color:rgba(143,221,251,.65);background:rgba(42,148,206,.29)}
.v4-v2-action-row #clear{min-width:53px}
.v4-v2-action-row .v4-v2-action{white-space:nowrap}
.v4-v2-menu{position:relative;display:flex;min-width:0}
.v4-v2-menu-items{
  position:absolute;bottom:calc(100% + 7px);right:0;z-index:55;
  min-width:155px;padding:5px;
  display:flex;flex-direction:column;gap:3px;
  border:1px solid rgba(162,215,248,.34);
  border-radius:13px;
  background:linear-gradient(145deg,rgba(32,59,94,.99),rgba(10,28,54,.99));
  box-shadow:0 12px 27px rgba(0,9,26,.42),inset 0 1px rgba(255,255,255,.13);
}
.v4-v2-menu-items[hidden]{display:none!important}
.v4-v2-menu-items button{
  min-height:34px;border-radius:8px;border:0;
  background:transparent;color:#d9f0ff;
  font:600 11px/1.2 Inter,system-ui,sans-serif;
  text-align:left;padding:8px 10px;cursor:pointer;
}
.v4-v2-menu-items button:hover{background:rgba(93,168,226,.22)}
.v4-v2-more-tools{margin-left:auto;position:relative;min-width:0}
.v4-v2-more-tools>summary{
  padding:8px 9px;
  min-height:33px;
  list-style:none;cursor:pointer;
  border-radius:9px;
  font-size:11px;font-weight:620;
  color:#9fbdd2;
  border:1px solid rgba(142,205,246,.18);
  background:rgba(36,72,119,.17);
}
.v4-v2-more-tools>summary::-webkit-details-marker{display:none}
.v4-v2-more-tools>summary:hover{color:#e3f9ff;border-color:rgba(142,205,246,.48)}
.v4-v2-more-items{
  display:flex;flex-wrap:wrap;justify-content:flex-end;gap:6px;
  position:absolute;right:0;bottom:calc(100% + 5px);z-index:55;
  width:max-content;min-width:210px;max-width:min(400px,85vw);
  padding:9px;border:1px solid rgba(165,222,255,.29);
  border-radius:11px;
  background:linear-gradient(145deg,#243c5c,#091e38);
  box-shadow:0 12px 25px #00162891;
}
.v4-v2-more-tools:not([open]) .v4-v2-more-items{display:none}
.v4-preview-pane .v4-toolbar-grid .v4-toolbar-block:nth-child(2){display:none!important}
.v4-v2-dialog{
  width:min(620px,calc(100vw - 24px));max-width:100%;
  max-height:90dvh;overflow:auto;
  padding:17px;color:#eaf6ff;
  border:1px solid rgba(181,222,255,.37);border-radius:22px;
  background:linear-gradient(145deg,#233d61,#0e213d 65%,#101c32);
  box-shadow:0 19px 75px #000d23c4,inset 0 1px rgba(255,255,255,.19);
  font:500 12px/1.5 Inter,system-ui,sans-serif;
}
.v4-v2-dialog::backdrop{background:rgba(1,10,21,.75);backdrop-filter:blur(5px)}
.v4-v2-dialog-header{display:flex;justify-content:space-between;align-items:center;gap:10px}
.v4-v2-dialog-header h2{font-size:20px;margin:0;letter-spacing:-.03em}
.v4-v2-dialog>.small{color:#aac9df;line-height:1.5;margin:8px 0 14px}
.v4-v2-dialog button.control,
.v4-v2-dialog .v4-v2-saved-actions button{
  padding:8px 12px;min-height:35px;
  border:1px solid rgba(157,218,255,.27);
  background:linear-gradient(145deg,rgba(87,145,199,.25),rgba(23,58,107,.4));
  border-radius:9px;color:#e6f6ff;cursor:pointer;font:650 11px/1.2 Inter,system-ui,sans-serif;
}
.v4-v2-dialog button:hover{border-color:#9beaff;background:rgba(91,171,229,.32)}
.v4-v2-dialog button:disabled{opacity:.36;cursor:not-allowed}
.v4-v2-saved-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
.v4-v2-saved-card{
  display:flex;flex-direction:column;gap:9px;padding:11px;
  border:1px solid rgba(157,216,255,.21);border-radius:13px;
  background:linear-gradient(150deg,rgba(64,111,173,.28),rgba(9,35,70,.3));
}
.v4-v2-saved-title{display:flex;justify-content:space-between;align-items:center;gap:8px}
.v4-v2-saved-title strong{font-size:13px}
.v4-v2-saved-title small{color:#a5c7db;font-size:10px}
.v4-v2-saved-icons{
  display:flex;gap:4px;align-items:center;min-height:39px;overflow:hidden;
  font-size:11px;color:#91acc5;
}
.v4-v2-saved-icons img{
  width:31px;height:31px;object-fit:contain;image-rendering:pixelated;
  border:1px solid #a4d7f737;border-radius:8px;background:rgba(51,94,148,.2);
}
.v4-v2-saved-actions,.v4-v2-dialog-actions{display:flex;gap:7px;flex-wrap:wrap}
.v4-v2-dialog-actions{margin-top:14px;justify-content:flex-end}
.v4-v2-dialog #v4-v2-code-text{
  display:block;width:100%;min-height:102px;padding:11px;margin:10px 0 0;
  resize:vertical;color:#f0f9ff;
  border:1px solid rgba(142,214,249,.34);border-radius:12px;
  background:rgba(4,20,39,.65);font:500 12px/1.5 ui-monospace,SFMono-Regular,monospace;
}
.v4-v2-toast{
  position:fixed;z-index:200;bottom:24px;left:50%;transform:translateX(-50%);
  min-width:160px;max-width:calc(100vw - 26px);
  padding:11px 15px;color:#f5fbff;text-align:center;
  border:1px solid rgba(158,225,255,.39);border-radius:13px;
  background:linear-gradient(150deg,#2e5377,#102c4c);
  box-shadow:0 12px 30px #000a1c9c;font-size:12px;
}
.v4-v2-toast[hidden]{display:none!important}
@media(max-width:760px){
  .v4-v2-stage-zoom{right:8px;top:7px;gap:2px}
  .v4-v2-stage-zoom #zoom-label{min-width:39px;font-size:10px}
  .v4-v2-action-row{gap:7px;justify-content:space-evenly;padding:8px}
  .v4-v2-action-row .v4-v2-core-actions{flex:1 1 38%;justify-content:center}
  .v4-v2-action-row .v4-v2-action{flex:1 1 auto;min-width:0}
  .v4-v2-action-row .v4-v2-menu{flex:1 1 35%}
  .v4-v2-action-row .v4-v2-menu>.control{width:100%}
  .v4-v2-action-row .v4-v2-more-tools{margin-left:0}
  .v4-v2-saved-grid{grid-template-columns:minmax(0,1fr)}
}
@media(max-width:380px){
  .v4-v2-action-row .v4-v2-core-actions{flex:1 1 100%}
  .v4-v2-action-row .v4-v2-menu{flex:1 1 43%}
  .v4-v2-action-row .v4-v2-more-tools{flex:0 0 auto}
}

/* V2's Wearing area is deliberately empty until clothing is equipped.
   Its item category buttons already live in Item Library; keeping ten
   invisible empty categories in this zone makes V4's preview unnecessarily tall. */
.v4-wearing-group>#v4-equipped{padding:10px 11px 12px;min-height:55px}
.v4-wearing-group #v4-equipped .panelheader{margin-bottom:5px;border:0;padding:0}
.v4-wearing-group #v4-equipped .panelheader h2{
  font-size:10px;line-height:1.3;text-transform:uppercase;
  color:#a3bdd4;letter-spacing:.09em;
}
.v4-wearing-group #v4-equipped .panelheader .small{display:none}
.v4-wearing-group #v4-equipped .v4-empty-slot{display:none!important}
.v4-wearing-group #v4-equipped .slots{
  grid-template-columns:repeat(auto-fit,minmax(155px,1fr));
  gap:7px;min-height:0;
}
.v4-wearing-group #v4-equipped .slot-item.v4-equipped-item{min-height:55px}
.v4-wearing-group #v4-equipped .v4-equipped-icon{
  width:36px;height:36px;flex-basis:36px;
}
@media(max-width:760px){
  .v4-wearing-group>#v4-equipped{min-height:53px}
  .v4-wearing-group #v4-equipped .slots{
    grid-template-columns:repeat(auto-fit,minmax(136px,1fr));
  }
}

/* V2 Favorites: native categories remain engine-owned; favourites is an
   independent exact-ID library view, not a fake page-level visual filter. */
.v4-library-pane.v4-v2-favorites-active #results,
.v4-library-pane.v4-v2-favorites-active .pagination{display:none!important}
.v4-library-pane .v4-v2-favorites-tab.active{
  color:#f0fbff;
  border-color:rgba(155,230,255,.8);
  background:linear-gradient(145deg,rgba(102,191,243,.34),rgba(46,95,184,.36));
  box-shadow:inset 0 1px rgba(255,255,255,.2),0 0 14px rgba(79,185,255,.16);
}
#v4-v2-favorites-grid{
  flex:1 1 0;
  display:grid;align-content:start;
  grid-template-columns:repeat(auto-fill,minmax(65px,1fr));
  gap:9px;padding:11px 11px 16px;
  height:auto;min-height:0;max-height:none;
  overflow:auto;
  scrollbar-width:thin;
}
#v4-v2-favorites-grid[hidden]{display:none!important}
#v4-v2-favorites-grid .v4-v2-favorites-empty{
  grid-column:1/-1;
  margin:0;padding:18px 12px;
  border:1px dashed rgba(166,224,255,.26);
  border-radius:14px;
  background:rgba(21,53,88,.17);
  color:#b0cfe1;text-align:center;
  font-size:11px;line-height:1.55;
}
#v4-v2-favorites-grid .item{
  display:grid;place-items:center;
  isolation:isolate;position:relative;
  aspect-ratio:1;
  width:100%;height:auto;min-height:0;
  padding:0;overflow:hidden;
  border-radius:22px;
  border:1px solid var(--v2-bubble-rim);
  background:var(--v2-bubble-base);
  box-shadow:var(--v2-bubble-shadow);
  transition:transform .2s,border-color .2s,box-shadow .2s,background .2s;
  cursor:pointer;
}
#v4-v2-favorites-grid .item:before{
  content:"";position:absolute;inset:0;z-index:0;
  pointer-events:none;
  background:radial-gradient(ellipse 70% 30% at 36% 7%,rgba(255,255,255,.13),transparent 82%);
}
#v4-v2-favorites-grid .item:after{
  content:"";position:absolute;inset:0;z-index:2;pointer-events:none;
  background:linear-gradient(145deg,rgba(255,255,255,.21),transparent 44%);
}
#v4-v2-favorites-grid .item:hover{
  transform:translateY(-2px);
  border-color:rgba(212,242,255,.68);
  box-shadow:inset 0 2px 1px rgba(255,255,255,.4),0 13px 28px rgba(5,24,61,.34);
}
#v4-v2-favorites-grid .item.selected{
  border-color:rgba(157,240,255,.94);
  background:linear-gradient(145deg,rgba(97,188,244,.47),rgba(20,98,178,.38));
  box-shadow:inset 0 2px 1px rgba(255,255,255,.41),0 0 0 2px rgba(51,182,243,.22),0 8px 22px rgba(16,88,160,.24);
}
#v4-v2-favorites-grid .item img{
  position:relative;z-index:1;
  width:40px;height:40px;
  min-width:40px;max-width:40px;
  object-fit:contain;image-rendering:pixelated;
}
#v4-v2-favorites-grid .item .text{
  position:absolute;width:1px;height:1px;overflow:hidden;
  clip-path:inset(50%);
  white-space:nowrap;
}
#v4-library .item .v4-v2-favorite-star{
  position:absolute;right:3px;top:2px;z-index:5;
  display:grid;place-items:center;
  width:23px;height:23px;min-width:23px;
  padding:0;
  color:#dbeeff;
  font-size:18px;line-height:1;
  border-radius:8px;
  background:rgba(5,23,49,.3);
  border:1px solid transparent;
  opacity:0;
  cursor:pointer;
  text-shadow:0 2px 5px #00112f;
  user-select:none;
  transition:opacity .13s,border-color .13s,background .13s;
}
#v4-library .item:hover .v4-v2-favorite-star,
#v4-library .item:focus-within .v4-v2-favorite-star,
#v4-library .item .v4-v2-favorite-star[data-selected=true]{
  opacity:1;
}
#v4-library .item .v4-v2-favorite-star[data-selected=true]{color:#ffe484}
#v4-library .item .v4-v2-favorite-star:focus-visible{
  opacity:1;
  outline:2px solid #8defff;outline-offset:1px;
}
#v4-library .item .v4-v2-favorite-star:hover{
  background:rgba(57,140,215,.54);
  border-color:rgba(192,237,255,.7);
}
#v4-library[data-v4-layout=list] #v4-v2-favorites-grid{
  display:flex;flex-direction:column;gap:7px;
}
#v4-library[data-v4-layout=list] #v4-v2-favorites-grid .item{
  display:flex;align-items:center;justify-content:flex-start;
  width:100%;min-height:55px;height:auto;aspect-ratio:auto;
  padding:7px 36px 7px 10px;
  border-radius:12px;
}
#v4-library[data-v4-layout=list] #v4-v2-favorites-grid .item .text{
  position:static;width:auto;height:auto;overflow:visible;clip-path:none;
  display:flex;flex-direction:column;text-align:left;
  white-space:normal;min-width:0;
}
#v4-library[data-v4-layout=list] #v4-v2-favorites-grid .item img{
  width:38px;height:38px;flex:0 0 38px;margin-right:10px;
}
@media(max-width:760px){
  #v4-v2-favorites-grid{
    grid-template-columns:repeat(auto-fill,minmax(64px,1fr));
    gap:10px;padding:12px 14px 20px;
  }
  #v4-library .item .v4-v2-favorite-star{opacity:.8}
}
@media(pointer:coarse){
  #v4-library .item .v4-v2-favorite-star{opacity:1}
}

/* Final V2 library controls: search + Filters in one row, Favorites exposed.
   Native category tabs and Tiles/List are available on disclosure. */
.v4-library-pane .coverage{display:none!important}
.v4-library-pane .catalog-controls{
  gap:8px;
  padding:11px 11px 9px;
  border-bottom:1px solid rgba(175,216,249,.13);
}
.v4-library-pane .v4-v2-searchrow{
  display:grid;
  grid-template-columns:minmax(0,1fr) minmax(95px,auto);
  gap:8px;align-items:center;
  min-width:0;
}
.v4-library-pane .v4-v2-searchrow .v4-searchbox{width:100%;min-width:0}
.v4-library-pane .v4-v2-searchrow #search{
  height:39px;min-height:39px;
  padding:9px 26px 9px 10px;
  font-size:11px;
  border-radius:11px;
  border:1px solid rgba(156,214,251,.23);
  background:rgba(6,22,43,.63);
}
.v4-library-pane .v4-v2-searchrow .v4-search-shortcut{display:none}
.v4-library-pane .v4-v2-filters-button{
  white-space:nowrap;
  min-width:95px;min-height:39px;
  padding:8px 11px;
  font:700 11px/1.2 Inter,system-ui,sans-serif;
  text-align:center;
  color:#e0f3ff;
  background:radial-gradient(circle at 23% 1%,rgba(227,250,255,.21),transparent 56%),
    linear-gradient(145deg,rgba(63,154,219,.39),rgba(20,80,145,.33));
  border:1px solid rgba(143,215,255,.56);
  border-radius:11px;
  box-shadow:inset 0 1px rgba(255,255,255,.16),0 3px 8px rgba(0,15,37,.18);
}
.v4-library-pane .v4-v2-filters-button:hover,
.v4-library-pane .v4-v2-filters-button[aria-expanded=true]{
  background:linear-gradient(145deg,rgba(93,184,239,.48),rgba(29,103,176,.41));
  border-color:rgba(195,241,255,.87);
}
#v4-library:not(.v4-v2-filters-open) .v4-viewbar{display:none!important}
#v4-library:not(.v4-v2-filters-open) #tabs button.tab:not(.v4-v2-favorites-tab){
  display:none!important;
}
.v4-library-pane .catalog-controls .tabs{
  max-height:none;
  overflow:visible;
  gap:7px;
  padding:0 1px;
}
.v4-library-pane .catalog-controls .tabs .v4-v2-favorites-tab{
  border-color:rgba(165,230,255,.34);
  background:linear-gradient(145deg,rgba(82,151,215,.24),rgba(35,88,145,.22));
  min-height:33px;
  border-radius:11px;
}
.v4-library-pane .catalog-controls .tabs .v4-v2-favorites-tab[data-v2-icon]:before{
  width:24px;height:24px;flex-basis:24px;
  background-size:288px 24px;
  background-position:-264px center;
}
.v4-library-pane .v4-v2-browse-help{
  margin:0;
  color:#94adbf;
  font-size:10px;
  line-height:1.4;
}
#v4-library.v4-v2-filters-open .v4-viewbar{
  padding:7px 0 2px;
  border-top:1px solid rgba(167,219,251,.11);
}
#v4-library.v4-v2-filters-open #tabs{
  max-height:250px;
  overflow-y:auto;
  padding:3px 1px 5px;
}
@media(max-width:760px){
  .v4-library-pane .v4-v2-searchrow{
    grid-template-columns:minmax(0,1fr) auto;
  }
  .v4-library-pane .v4-v2-searchrow #search{min-height:42px;height:42px}
  .v4-library-pane .v4-v2-filters-button{min-height:42px}
  #v4-library .catalog-controls .tabs .v4-v2-favorites-tab[data-v2-icon]:before{
    width:24px;height:24px;flex-basis:24px;
    background-size:288px 24px;
    background-position:-264px center;
  }
}


/* FIX: real V4 inventory buttons contain an unclassed <span> with a full
   name and ID. The old V2 tile CSS hid .text only (test fixtures), leaving
   native text to inflate content while implicit grid tracks collapsed on iOS.
   Explicit track height plus hidden native tile labels avoids overlap. */
#v4-library[data-v4-layout="tiles"] #results{
  display:grid;
  grid-template-columns:repeat(auto-fill,minmax(70px,1fr));
  grid-auto-rows:90px;
  align-content:start;
  align-items:start;
  justify-items:stretch;
  gap:9px;
  min-width:0;
}
#v4-library[data-v4-layout="tiles"] #results>.item{
  display:grid;
  align-self:start;
  justify-self:center;
  width:100%;
  max-width:88px;
  height:auto;
  min-height:0;
  aspect-ratio:1/1;
  margin:0;
  padding:0;
  overflow:hidden;
  box-sizing:border-box;
  flex:none;
}
#v4-library[data-v4-layout="tiles"] #results>.item>span:not(.v4-v2-favorite-star){
  position:absolute;
  width:1px;height:1px;
  overflow:hidden;
  clip-path:inset(50%);
  white-space:nowrap;
  pointer-events:none;
}
#v4-library[data-v4-layout="tiles"] #results>.item>img{
  width:40px;height:40px;
  min-width:40px;max-width:40px;
  object-fit:contain;
  image-rendering:pixelated;
  background:none;
}
@media(max-width:760px){
  #v4-library[data-v4-layout="tiles"] #results{
    grid-template-columns:repeat(auto-fill,minmax(60px,1fr));
    grid-auto-rows:80px;
    gap:8px;
    padding:11px 11px 15px;
  }
  #v4-library[data-v4-layout="tiles"] #results>.item{max-width:75px;}
  #v4-library[data-v4-layout="tiles"] #results>.item>img{
    width:38px;height:38px;min-width:38px;max-width:38px;
  }
}
@media(max-width:365px){
  #v4-library[data-v4-layout="tiles"] #results{
    grid-template-columns:repeat(auto-fill,minmax(59px,1fr));
    grid-auto-rows:77px;
    gap:7px;
  }
}


/* First-party V2 title-picker styling adapted to the V4 Appearance panel.
   V2 source: title-picker-visuals.css, October 23, 2026. */
#v4-appearance .v4-v2-identity-group{gap:9px}
#v4-appearance #v4-v2-player-name{
  display:block;width:100%;min-height:39px;
  border-radius:11px;
  border:1px solid rgba(155,207,245,.25);
  color:#f1faff;background:rgba(4,15,29,.54);
  font:600 13px/1.3 Inter,system-ui,sans-serif;
  padding:9px 11px;box-sizing:border-box;
}
#v4-appearance #v4-v2-player-name:focus{outline:2px solid rgba(120,224,255,.62);outline-offset:1px}
#v4-appearance .v4-v2-title-heading{
  display:flex;align-items:center;gap:6px;flex-wrap:wrap;
  padding:7px 0 3px;border-top:1px solid rgba(156,212,249,.12);
}
#v4-appearance .v4-v2-title-heading strong{font-size:12px;color:#d6ecfb}
#v4-appearance .v4-v2-title-heading>span{margin-left:auto;font-size:10px;color:#9eb9ce}
#v4-appearance #v4-v2-title-clear{
  min-height:29px;padding:5px 9px;font-size:10px;border-radius:8px;
  color:#c5e7f9;background:rgba(50,105,158,.25);
  border:1px solid rgba(157,217,248,.19);
}
#v4-appearance #v4-v2-title-clear:disabled{opacity:.45;cursor:default}
#v4-appearance .v4-v2-title-list{display:flex;flex-direction:column;gap:12px}
#v4-appearance .v4-v2-title-section{display:flex;flex-direction:column;gap:6px}
#v4-appearance .v4-v2-title-section>.small{font-size:10px;color:#94b4c7;font-weight:650}
#v4-appearance .v4-v2-title-buttons{display:flex;flex-wrap:wrap;gap:6px;min-width:0}
#v4-appearance .v4-v2-title-choice{
  display:inline-flex;align-items:center;justify-content:center;
  gap:4px;min-height:38px;
  border-radius:999px;
  padding:8px 12px;
  font:640 12px/1.2 Inter,system-ui,sans-serif;
  border:1px solid rgba(164,217,255,.18);
  background:rgba(35,63,88,.27);
  color:var(--v4-title-ink,#d8ecfc);
  cursor:pointer;
  transition:background-color .16s,border-color .16s,box-shadow .16s;
}
#v4-appearance .v4-v2-title-choice.on{
  border-color:var(--v4-title-ring,rgba(169,225,255,.55));
  background:rgba(40,75,104,.43);
  box-shadow:inset 0 0 0 1px rgba(255,255,255,.06),0 0 15px var(--v4-title-glow,rgba(114,206,255,.1));
}
#v4-appearance .v4-v2-title-choice:hover{background:rgba(48,81,109,.36);border-color:rgba(179,222,255,.4)}
#v4-appearance .v4-title-label{white-space:pre;line-height:1.3}
.v4-title-letter{display:inline-block;white-space:pre}
[data-t="owner"],[data-title="owner"]{--v4-title-ink:#49fc00;--v4-title-ring:rgba(73,252,0,.55);--v4-title-glow:rgba(73,252,0,.13);text-shadow:1px 1px #0b0b09}
[data-t="dev"],[data-title="dev"]{--v4-title-ink:#ffca6f;--v4-title-ring:rgba(255,202,111,.58);--v4-title-glow:rgba(255,202,111,.13);text-shadow:1px 1px #0b0b09}
[data-t="mod"],[data-title="mod"]{--v4-title-ink:#ff8ff3;--v4-title-ring:rgba(255,143,243,.54);--v4-title-glow:rgba(255,143,243,.13);text-shadow:1px 1px #0b0b09}
[data-t="legend"],[data-title="legend"],
[data-t="immortal"],[data-title="immortal"]{--v4-title-ink:#e5f1ff;--v4-title-ring:rgba(203,227,255,.52);--v4-title-glow:rgba(162,222,255,.15)}
[data-t="legend"] .v4-title-letter,[data-t="immortal"] .v4-title-letter,
[data-title="legend"] .v4-title-letter,[data-title="immortal"] .v4-title-letter{
  color:#eff4ff;animation:v4-title-legend-hue 3.7s linear infinite;
  animation-delay:calc(var(--v4-title-i)*-.075s);
}
[data-t="legend"] .v4-title-letter,[data-title="legend"] .v4-title-letter{text-shadow:1px 1px #0b0b09,0 0 8px #c7e0ff1f}
[data-t="immortal"] .v4-title-letter,[data-title="immortal"] .v4-title-letter{text-shadow:1px 1px #fff,0 0 8px #fff3}
@keyframes v4-title-legend-hue{0%,100%{color:#edf7ff}17%{color:#e0d6ff}35%{color:#ffe8e9}52%{color:#e0fff3}70%{color:#fffbd6}85%{color:#d9ecff}}
[data-t="l125"],[data-title="l125"]{
  --v4-title-ink:#00dbe5;--v4-title-ring:rgba(0,219,229,.52);--v4-title-glow:rgba(0,219,229,.15);
  text-shadow:1px 1px 0 #134b62,0 0 6px #00f0ff22;animation:v4-title-level-glow 3s ease-in-out infinite;
}
@keyframes v4-title-level-glow{0%,100%{color:#00b6bf}50%{color:#5cf8ff}}
[data-t="g4g"],[data-title="g4g"]{--v4-title-ink:#ddf7fd;--v4-title-ring:rgba(181,229,244,.52);--v4-title-glow:rgba(151,225,252,.12)}
[data-t="g4g"] .v4-title-letter,[data-title="g4g"] .v4-title-letter{
  color:#bcefff;text-shadow:1px 1px 0 #0b0b0988;
  animation:v4-title-g4g-hue 3.9s ease-in-out infinite;animation-delay:calc(var(--v4-title-i)*-.27s);
}
@keyframes v4-title-g4g-hue{0%,100%{color:#b8ecff}23%{color:#e9c8ff}47%{color:#ffdfef}70%{color:#fff1b5}86%{color:#b8ffd3}}
[data-t="party"],[data-title="party"]{--v4-title-ink:#fff;--v4-title-ring:rgba(246,193,255,.5);--v4-title-glow:rgba(255,0,255,.1)}
[data-t="party"] .v4-title-letter,[data-title="party"] .v4-title-letter{color:var(--v4-party-ink,#ff00ff);text-shadow:1px 1px #0b0b09}
[data-t="dr"],[data-title="dr"]{--v4-title-ink:#ff0000;--v4-title-ring:rgba(255,0,0,.55);--v4-title-glow:rgba(255,0,0,.11);text-shadow:1px 1px #0b0b09}
[data-t="mentor"],[data-title="mentor"]{--v4-title-ink:#f7941e;--v4-title-ring:rgba(247,148,30,.55);--v4-title-glow:rgba(247,148,30,.12);text-shadow:1px 1px #ccc561}
#v4-appearance .v4-v2-title-choice{color:var(--v4-title-ink,#d8ecfc)}
.v4-v2-nameplate{
  position:absolute;z-index:6;top:18%;left:50%;
  transform:translateX(-50%);
  max-width:85%;min-width:0;
  display:flex;flex-direction:column;gap:2px;align-items:center;
  pointer-events:none;user-select:none;
  text-align:center;
}
#v4-v2-nameplate-title{
  color:#ddeeff;
  font:750 clamp(9px,1vw,14px)/1.2 Inter,system-ui,sans-serif;
  text-shadow:1px 2px #1119;
  white-space:nowrap;
}
#v4-v2-nameplate-title[hidden]{display:none}
#v4-v2-nameplate-name{
  color:var(--v4-title-ink,#f1f7ff);
  font:800 clamp(12px,1.2vw,18px)/1.25 Inter,system-ui,sans-serif;
  max-width:100%;overflow:hidden;text-overflow:ellipsis;
  white-space:nowrap;
  text-shadow:1px 2px 0 #09111f,0 0 5px #0009;
}
@media(max-width:760px){
  #v4-appearance .v4-v2-title-choice{min-height:42px;font-size:12px;padding:9px 13px}
  #v4-v2-nameplate-title{font-size:10px}
  #v4-v2-nameplate-name{font-size:12px}
  .v4-v2-nameplate{top:15%}
}
@media(prefers-reduced-motion:reduce){
  #v4-appearance .v4-v2-title-choice,
  .v4-v2-nameplate .v4-title-letter,
  #v4-v2-nameplate-name[data-title="l125"]{animation:none!important;transition:none!important}
}


/* V2 title controls: port the native title-picker dimensions and type scale.
 * Source: static/setplanner-reference-prototype/title-picker-visuals.css.
 * Keep the buttons native to V4; do not load the packed V2 game renderer.
 */
@font-face{
  font-family:"GT Native Century";
  src:url("/v18-assets/fonts/gt-century-bold-subset.woff2") format("woff2");
  font-weight:700;font-style:normal;font-display:swap;
}
#v4-appearance #v4-v2-title-list .v4-v2-title-choice{
  min-height:42px;padding:9px 15px;gap:6px;
  font:640 14px/1.25 Inter,system-ui,sans-serif;
  letter-spacing:normal;border-radius:999px;
}
#v4-appearance #v4-v2-title-list .v4-v2-title-choice img.v4-v2-title-icon{
  width:auto;height:19px;max-width:22px;
  object-fit:contain;image-rendering:pixelated;
}
#v4-appearance #v4-v2-title-list .v4-v2-title-choice.on{
  color:var(--v4-title-ink,#fff);
}
#v4-appearance #v4-v2-title-list .v4-v2-title-buttons.v4-v2-icon-grid{
  display:grid;
  grid-template-columns:repeat(auto-fill,minmax(50px,1fr));
  gap:8px;width:100%;
}
#v4-appearance #v4-v2-title-list .v4-v2-icon-grid .v4-v2-title-choice{
  width:100%;height:52px;min-height:52px;
  padding:6px;border-radius:12px;
  border:1px solid rgba(164,217,255,.18);
  background:rgba(35,63,88,.27);
}
#v4-appearance #v4-v2-title-list .v4-v2-icon-grid .v4-v2-title-choice:hover{
  border-color:rgba(179,222,255,.4);
  background:rgba(48,81,109,.38);
}
#v4-appearance #v4-v2-title-list .v4-v2-icon-grid .v4-v2-title-choice.on{
  border-color:rgba(134,220,255,.65);
  background:rgba(40,100,145,.44);
  box-shadow:inset 0 0 0 1px rgba(255,255,255,.06);
}
#v4-appearance #v4-v2-title-list .v4-v2-icon-grid .v4-v2-title-choice img.v4-v2-title-icon{
  width:auto;height:34px;max-width:36px;max-height:34px;
}
#v4-appearance #v4-v2-title-list .v4-v2-title-section>.small{
  font-size:11px;
}
#v4-v2-nameplate-title{display:none!important}
#v4-v2-nameplate-name{
  display:inline-flex;justify-content:center;align-items:center;
  gap:3px;overflow:visible;text-overflow:clip;
  max-width:100%;
  font:700 clamp(12px,1.25vw,18px)/1.15 "GT Native Century","Century Gothic",Arial,sans-serif;
  white-space:nowrap;
}
#v4-v2-nameplate-name .v4-v2-title-prefix-icons,
#v4-v2-nameplate-name .v4-v2-title-suffix-icons{
  display:inline-flex;align-items:center;flex:0 0 auto;gap:2px;
}
#v4-v2-nameplate-name .v4-v2-title-mirrored{transform:scaleX(-1)}
#v4-v2-nameplate-name .v4-v2-title-icon-fallback{
  font:700 10px/1.1 "GT Native Century",Arial,sans-serif;
  color:#d1eafc;text-shadow:1px 1px #0b0b09;
}
#v4-appearance .v4-v2-icon-grid .v4-v2-title-icon-fallback{
  display:inline-block;font:700 9px/1.1 Inter,system-ui,sans-serif;
  color:#c9ddec;white-space:normal;text-align:center;overflow-wrap:break-word;
}
#v4-v2-nameplate-name .v4-v2-name-icon{
  width:18px;height:18px;object-fit:contain;
  image-rendering:pixelated;flex-shrink:0;
}
#v4-v2-nameplate-name .v4-v2-name-letters{
  display:inline-block;white-space:pre;
  color:var(--v4-title-ink,#f1f7ff);
  text-shadow:1px 1px 0 #0b0b09;
}
#v4-v2-nameplate-name .v4-v2-name-letters[data-title="immortal"] .v4-title-letter{
  text-shadow:1px 1px 0 #ffffff;
}
#v4-v2-nameplate-name .v4-v2-name-letters[data-title="legend"][data-status="owner"] .v4-title-letter,
#v4-v2-nameplate-name .v4-v2-name-letters[data-title="immortal"][data-status="owner"] .v4-title-letter{
  text-shadow:1px 1px 0 #49fc00;
}
#v4-v2-nameplate-name .v4-v2-name-letters:is([data-title="legend"],[data-title="immortal"])[data-status="dr"] .v4-title-letter{
  text-shadow:1px 1px 0 #ff0000;
}
#v4-v2-nameplate-name .v4-v2-name-letters:is([data-title="legend"],[data-title="immortal"])[data-status="dev"] .v4-title-letter{
  text-shadow:1px 1px 0 #ff9445;
}
#v4-v2-nameplate-name .v4-v2-name-letters:is([data-title="legend"],[data-title="immortal"])[data-status="mod"] .v4-title-letter{
  text-shadow:1px 1px 0 #ff8ff3;
}
@media(max-width:600px){
  #v4-appearance #v4-v2-title-list .v4-v2-title-choice{
    min-height:40px;padding:8px 12px;font-size:13px;
  }
  #v4-appearance #v4-v2-title-list .v4-v2-title-buttons.v4-v2-icon-grid{
    grid-template-columns:repeat(auto-fill,minmax(46px,1fr));gap:6px;
  }
  #v4-appearance #v4-v2-title-list .v4-v2-icon-grid .v4-v2-title-choice{
    height:48px;min-height:48px;padding:5px;
  }
  #v4-appearance #v4-v2-title-list .v4-v2-icon-grid .v4-v2-title-choice img.v4-v2-title-icon{
    height:31px;max-width:34px;max-height:31px;
  }
  #v4-v2-nameplate-name{font-size:12px}
  #v4-v2-nameplate-name .v4-v2-name-icon{width:14px;height:14px}
}

/* V2 owner status tints Grow4Good's duplicate shadow without replacing its
 * independently cycling rainbow foreground. */
#v4-v2-nameplate-name .v4-v2-name-letters[data-title="g4g"][data-status="owner"] .v4-title-letter{
  text-shadow:1px 1px 0 #49fc00;
}


/* The name is now rendered at the V2 native character anchor by the canvas
 * compositor. Keep DOM text for accessibility, selection and CSS-driven
 * title colors, but NEVER paint the former fixed-top overlay as a second
 * visibly floating name. Opacity (not display:none) retains live
 * per-letter CSS color animation sampling during native canvas painting. */
#v4-v2-nameplate.v4-v2-nameplate{
  opacity:0!important;
  pointer-events:none!important;
}


/* Title regression recovery: live DOM keeps V2 letter animations and shadows.
   Name placement and native size come from the avatar camera, not viewport %. */
#v4-v2-nameplate.v4-v2-nameplate {
  opacity:1!important;
  z-index:8;
  top:0;
  left:0;
  transform:translateX(-50%);
  width:max-content;
  max-width:none;
  overflow:visible;
  text-align:center;
  pointer-events:none;
}
#v4-v2-nameplate-name {
  font-family:"GT Native Century","Century Gothic",Arial,sans-serif;
  font-size:var(--v4-name-font-size,16px)!important;
  line-height:1.2;
  overflow:visible;
  max-width:none;
  white-space:nowrap;
}
#v4-v2-nameplate-name .v4-v2-name-icon,
#v4-v2-nameplate-name .v4-v2-rank-fallback {
  width:var(--v4-badge-size,18px);
  height:var(--v4-badge-size,18px);
  flex:0 0 auto;
}
#v4-v2-nameplate-name .v4-v2-name-letters {
  font:inherit;
  white-space:pre;
}
#v4-appearance #v4-v2-title-list .v4-v2-icon-grid {
  grid-template-columns:repeat(auto-fill,minmax(67px,1fr));
  gap:8px;
}
#v4-appearance #v4-v2-title-list .v4-v2-icon-grid .v4-v2-title-choice {
  height:72px;
  min-height:72px;
  padding:6px 3px 5px;
  flex-direction:column;
  justify-content:center;
  align-items:center;
  gap:3px;
  overflow:hidden;
  border-radius:11px;
  background:rgba(35,63,88,.24);
}
#v4-appearance #v4-v2-title-list .v4-v2-icon-grid .v4-v2-title-choice img.v4-v2-title-icon {
  display:block;
  width:32px;
  height:32px;
  max-width:32px;
  max-height:32px;
  flex:0 0 32px;
  object-fit:contain;
  image-rendering:pixelated;
}
#v4-appearance #v4-v2-title-list .v4-v2-title-caption {
  display:block;
  max-width:100%;
  color:#d3e5f3;
  font:600 9px/1.12 Inter,system-ui,sans-serif;
  text-align:center;
  white-space:normal;
  overflow-wrap:break-word;
}
#v4-appearance #v4-v2-title-list .v4-v2-title-choice.on .v4-v2-title-caption {
  color:#fff;
}
#v4-appearance #v4-v2-title-list .v4-v2-title-section>.small {
  display:block;
  margin-top:8px;
  margin-bottom:6px;
  color:#b4cddd;
  font-size:11px;
  font-weight:700;
}
.v4-v2-rank-fallback {
  display:inline-flex;
  justify-content:center;
  align-items:center;
  width:32px;
  height:32px;
  min-width:0;
  flex:0 0 32px;
  border:1px solid var(--rank-ring,#b4c6d2);
  background:linear-gradient(145deg,var(--rank-fill,#506676),rgba(14,25,37,.86));
  color:#fff;
  border-radius:7px;
  font:800 11px/1 Inter,system-ui,sans-serif;
  text-shadow:1px 1px #0b111a;
}
.v4-v2-rank-fallback[data-rank="bronze"] {--rank-ring:#c98a62;--rank-fill:#936045}
.v4-v2-rank-fallback[data-rank="silver"] {--rank-ring:#d5e4ec;--rank-fill:#8294a2}
.v4-v2-rank-fallback[data-rank="gold"] {--rank-ring:#ffdb81;--rank-fill:#bd9234}
.v4-v2-rank-fallback[data-rank="ruby"] {--rank-ring:#ff7b9b;--rank-fill:#ac3456}
.v4-v2-rank-fallback[data-rank="emerald"] {--rank-ring:#76f0c0;--rank-fill:#257e5b}
.v4-v2-rank-fallback[data-rank="sapphire"] {--rank-ring:#86caff;--rank-fill:#315fa1}
@media(max-width:600px){
 #v4-appearance #v4-v2-title-list .v4-v2-icon-grid {
   grid-template-columns:repeat(auto-fill,minmax(62px,1fr));
   gap:6px;
 }
 #v4-appearance #v4-v2-title-list .v4-v2-icon-grid .v4-v2-title-choice {
   height:68px;min-height:68px;
 }
 #v4-appearance #v4-v2-title-list .v4-v2-icon-grid .v4-v2-title-choice img.v4-v2-title-icon {
   width:29px;height:29px;max-width:29px;max-height:29px;flex-basis:29px;
 }
}

#v4-appearance #v4-v2-title-list .v4-v2-event-subhead {
 display:block;
 margin:8px 0 5px;
 padding-left:1px;
 font:650 10px/1.2 Inter,system-ui,sans-serif;
 color:#96b4c9;
}
#v4-appearance #v4-v2-title-list .v4-v2-event-subhead:first-of-type {margin-top:5px}
#v4-appearance #v4-v2-title-list .v4-v2-title-choice .v4-v2-title-caption {text-shadow:none}


/* V4 correction: restore the original compact V2 title badge picker.
   Annual-events sorting belongs to ITEM LIBRARY, not title badges. */
#v4-appearance #v4-v2-title-list .v4-v2-icon-grid{
  grid-template-columns:repeat(auto-fill,minmax(50px,1fr));
  gap:8px;
}
#v4-appearance #v4-v2-title-list .v4-v2-icon-grid .v4-v2-title-choice{
  height:52px;min-height:52px;
  padding:6px;display:flex;flex-direction:row;
  align-items:center;justify-content:center;
  border-radius:12px;overflow:visible;
}
#v4-appearance #v4-v2-title-list .v4-v2-icon-grid .v4-v2-title-choice img.v4-v2-title-icon{
  width:auto;height:34px;max-width:36px;max-height:34px;flex:0 1 auto;
}
#v4-appearance #v4-v2-title-list .v4-v2-title-caption{display:none!important}

/* Center the real NAME on the avatar, letting title decorations grow
   outward without moving the player's letters away from the camera. */
#v4-v2-nameplate-name{
  position:relative;
  display:inline-flex;justify-content:center;align-items:center;
  gap:0;transform-origin:center center;
  width:max-content;
  font-size:var(--v4-name-font-size,16px)!important;
}
#v4-v2-nameplate-name .v4-v2-name-letters{
  display:inline-block;position:relative;flex:0 0 auto;
  white-space:pre;font:inherit;
}
#v4-v2-nameplate-name .v4-v2-title-prefix-icons,
#v4-v2-nameplate-name .v4-v2-title-suffix-icons{
  position:absolute;top:50%;transform:translateY(-50%);
  display:inline-flex;align-items:center;flex:0 0 auto;
  gap:calc(var(--v4-badge-size,18px)*.10);
}
#v4-v2-nameplate-name .v4-v2-title-prefix-icons{right:calc(100% + 2px)}
#v4-v2-nameplate-name .v4-v2-title-suffix-icons{left:calc(100% + 2px)}
#v4-v2-nameplate-name .v4-v2-name-letters .v4-title-letter{
  animation:none!important;transition:none!important;
}
#v4-v2-nameplate-name[data-title="l125"]{
  animation:none!important;
}
@media(max-width:600px){
 #v4-appearance #v4-v2-title-list .v4-v2-icon-grid{
   grid-template-columns:repeat(auto-fill,minmax(46px,1fr));
   gap:6px;
 }
 #v4-appearance #v4-v2-title-list .v4-v2-icon-grid .v4-v2-title-choice{
   height:48px;min-height:48px;padding:5px;
 }
 #v4-appearance #v4-v2-title-list .v4-v2-icon-grid .v4-v2-title-choice img.v4-v2-title-icon{
   height:31px;max-height:31px;max-width:34px;
 }
}
/* Clothing release events: an independent filter below the slot choices. */
.v4-event-filter{
  display:flex;align-items:center;gap:9px;
  padding:4px 3px 7px;min-width:0;
}
.v4-event-filter label{
  flex:0 0 auto;color:#b4d4e6;font:650 11px/1.2 Inter,system-ui,sans-serif;
}
.v4-event-filter select{
  width:100%;min-width:0;max-width:260px;height:36px;
  background:#183852;color:#e1f5ff;
  border:1px solid rgba(155,224,255,.38);
  border-radius:10px;padding:6px 9px;
  font:600 12px/1.2 Inter,system-ui,sans-serif;
}
.v4-event-filter select:focus-visible{outline:2px solid #78defb;outline-offset:2px}
/* Keep the entire visible sprite centered in every tile; no art is clipped. */
#v4-library[data-v4-layout=tiles] .item .v4-icon-fit,
#v4-v2-favorites-grid .item .v4-icon-fit{
  position:relative;z-index:1;
  width:84%;height:84%;max-width:84%;min-width:0;
  object-fit:contain;image-rendering:pixelated;
  background:transparent;border:0;border-radius:0;box-shadow:none;
  pointer-events:none;
}
#v4-library[data-v4-layout=tiles] .item img.v4-icon-fit-source,
#v4-v2-favorites-grid .item img.v4-icon-fit-source{
  position:absolute!important;opacity:0!important;
  width:1px!important;height:1px!important;pointer-events:none;
}

/* Bubble canvas appears ONLY in tiles/favorites; preserve the unmodified
   original icon in List view, where the full item metadata is visible. */
.v4-icon-fit{display:none}
#v4-library[data-v4-layout="tiles"] .item canvas.v4-icon-fit,
#v4-v2-favorites-grid .item canvas.v4-icon-fit{
 display:block;position:relative;z-index:1;
 width:84%;height:84%;max-width:84%;min-width:0;
 background:transparent;image-rendering:pixelated;
 border:0;border-radius:0;box-shadow:none;pointer-events:none;
}

/* Allow fitted pixel art to use most of the bubble without truncation. */
#v4-library[data-v4-layout="tiles"] .item canvas.v4-icon-fit,
#v4-v2-favorites-grid .item canvas.v4-icon-fit {
 width:90%;height:90%;max-width:90%;
}

/* Override the older generic '.item canvas{display:block}' in List view. */
.item canvas.v4-icon-fit {display:none}
#v4-library[data-v4-layout="tiles"] .item canvas.v4-icon-fit,
#v4-v2-favorites-grid .item canvas.v4-icon-fit {display:block}

/* V2 workstation proportions: wardrobe and appearance stay generously wide,
   while the character stage is a compact tool between them. */
@media(min-width:1181px){
 main{
  grid-template-columns:minmax(340px,1.15fr) minmax(310px,.88fr) minmax(355px,1.10fr);
  gap:10px;
 }
 .v4-preview-pane .canvaswrap{min-height:0;max-height:min(54vh,520px)}
 .v4-preview-pane .canvaswrap canvas{width:100%;height:auto}
 main>.side{overflow-y:auto}
 main>.catalog .items{min-height:200px}
 #v4-appearance #v4-v2-title-list .v4-v2-icon-grid{
  grid-template-columns:repeat(auto-fill,minmax(56px,1fr));
 }
}
@media(min-width:1500px){
 main{grid-template-columns:minmax(390px,1.15fr) minmax(350px,.82fr) minmax(405px,1.15fr)}
}
@media(min-width:761px) and (max-width:1180px){
 main{
  grid-template-columns:minmax(0,1.16fr) minmax(0,.84fr);
  grid-template-rows:minmax(0,1fr) minmax(420px,auto);
 }
 main>.catalog{grid-column:1;grid-row:1;height:100%}
 main>.scene{grid-column:2;grid-row:1;height:100%}
 main>.side{grid-column:1/-1;grid-row:2;max-height:600px}
 main>.side>.v4-appearance-pane{width:100%}
}

/* Original native title shadow is on BOTH the name run and individual
   glyphs, at subpixel game-space offsets. Never let the picker CSS animation
   substitute a different shadow once the actual avatar name is rendered. */
#v4-v2-nameplate-name .v4-v2-name-letters{
 text-shadow:.70px .72px 0 var(--v4-shadow,#0b0b09);
 transform-origin:left center;
 overflow:visible;
}
#v4-v2-nameplate-name .v4-v2-name-letters .v4-title-letter{
 text-shadow:.70px .72px 0 var(--v4-shadow,#0b0b09);
}
#v4-v2-nameplate-name .v4-v2-title-prefix-icons,
#v4-v2-nameplate-name .v4-v2-title-suffix-icons{
 flex-shrink:0;white-space:nowrap;
}

/* V2 Explore clothing filter, replacing the plain HTML select with a compact
   two-column image-button dialog. All event images use real GT sprite paths. */
.v4-event-filter{
 padding:5px 1px 8px;
}
.v4-events-native-select{
 position:absolute!important;width:1px!important;height:1px!important;
 overflow:hidden!important;opacity:0!important;pointer-events:none!important;
 clip-path:inset(50%);
}
.v4-event-filter>.v4-events-open{
 display:flex;align-items:center;justify-content:space-between;gap:8px;
 width:100%;height:38px;padding:7px 12px;
 border-radius:12px;border:1px solid rgba(157,221,255,.34);
 background:linear-gradient(140deg,#205070,#102d4b);color:#e5f7ff;
 font:650 12px/1.2 Inter,system-ui,sans-serif;
 cursor:pointer;
}
.v4-events-open[data-active="true"]{
 border-color:#8edcff;
 background:linear-gradient(140deg,#30698d,#164566);
}
.v4-events-chevron{font-size:16px;color:#bcdcf3}
.v4-events-dialog{
 padding:0;border:1px solid #6995b1;border-radius:17px;
 width:min(445px,calc(100vw - 22px));max-height:min(650px,calc(100dvh - 24px));
 background:linear-gradient(150deg,#225475,#122f51 28%,#0f2947 90%);
 color:#e8f4ff;box-shadow:0 25px 85px #000b;
 overflow:hidden;
}
.v4-events-dialog::backdrop{background:rgba(3,11,22,.68);backdrop-filter:blur(3px)}
.v4-events-header{
 display:flex;align-items:flex-start;justify-content:space-between;
 padding:13px 14px 9px;gap:12px;
}
.v4-events-header-text{display:flex;flex-direction:column;gap:1px}
.v4-events-header-text strong{font-size:13px;line-height:1.4}
.v4-events-header-text small{font-size:11px;color:#b6d1e6}
.v4-events-close{
 width:27px;height:27px;border-radius:9px;border:1px solid #a4cde65c;
 background:rgba(91,144,188,.2);color:#cde9ff;font-size:19px;cursor:pointer;
}
.v4-events-tabs{
 display:grid;grid-template-columns:1fr 1fr;gap:5px;margin:0 12px 11px;
}
.v4-events-tabs button{
 min-height:36px;border-radius:10px;border:1px solid #8cc6ec38;
 color:#b9d4e8;background:#122f50;
 font:700 11px/1.2 Inter,system-ui,sans-serif;cursor:pointer;
}
.v4-events-tabs button.active{
 background:linear-gradient(135deg,#316f95,#215476);
 border-color:#9fd8f1;color:#fff;
}
.v4-events-content{
 padding:0 12px 3px;max-height:min(430px,calc(100dvh - 195px));
 overflow:auto;scrollbar-width:thin;scrollbar-color:#9dbed5 transparent;
}
.v4-events-grid{display:grid;grid-template-columns:1fr 1fr;gap:5px;align-content:start}
.v4-events-grid .v4-event-option{
 display:flex;align-items:center;gap:8px;padding:6px 8px;
 min-width:0;min-height:44px;text-align:left;
 border-radius:11px;border:1px solid rgba(139,190,230,.15);
 background:linear-gradient(125deg,#22517d,#18375d);
 color:#e6f3ff;font:650 10.5px/1.18 Inter,system-ui,sans-serif;
 cursor:pointer;
}
.v4-events-grid .v4-event-option:hover,.v4-events-grid .v4-event-option.selected{
 border-color:#96d0f7;background:linear-gradient(125deg,#30668d,#214d74);
}
.v4-event-option img.v4-event-icon,.v4-event-all-icon{
 display:block;flex:0 0 32px;width:32px;height:32px;
 object-fit:contain;image-rendering:pixelated;
}
.v4-event-all-icon{display:grid;place-items:center;font-size:25px;color:#ffe77c}
.v4-event-option-name{min-width:0;overflow-wrap:break-word}
.v4-events-footer{
 display:flex;justify-content:space-between;align-items:center;gap:9px;
 margin:9px 12px 11px;padding-top:8px;
 border-top:1px solid #88abc43d;
 color:#c0d2e1;font:600 9px/1.3 Inter,system-ui,sans-serif;
}
.v4-events-reset{
 white-space:nowrap;padding:6px 11px;
 border:1px solid #9cc8e453;border-radius:9px;
 background:#254667;color:#e9f4ff;font:700 11px Inter,system-ui,sans-serif;
 cursor:pointer;
}
@media(max-width:400px){
 .v4-events-grid .v4-event-option{padding:5px 4px;gap:4px;font-size:10px}
 .v4-event-option img.v4-event-icon{width:27px;height:27px;flex-basis:27px}
}

/* The item-type tab uses the existing V2 equipment icon sprite sheet. */
.v4-events-grid .v4-type-icon{
 display:block;flex:0 0 26px;width:26px;height:26px;
 background-repeat:no-repeat;
 image-rendering:pixelated;
}
.v4-events-grid .v4-type-icon-fallback{
 display:grid;place-items:center;font-size:19px;color:#bfe8fa;
}


/* V2-style integrated column grips replace the detached adjustment sliders. */
main.v4-inline-resizable-panels{position:relative!important;min-width:0}
@media(min-width:1181px){
 main.v4-inline-resizable-panels{
  grid-template-columns:minmax(260px,var(--v4-clothes-px,35%))
    minmax(285px,1fr) minmax(260px,var(--v4-titles-px,34%))!important;
 }
}
@media(min-width:761px) and (max-width:1180px){
 main.v4-inline-resizable-panels{
  grid-template-columns:minmax(220px,var(--v4-medium-items-px,50%)) minmax(220px,1fr)!important;
 }
}
main.v4-inline-resizable-panels .v4-inline-panel-grip{
 position:absolute!important;z-index:60;width:20px;
 display:flex;align-items:center;justify-content:center;
 padding:0;border:0;border-radius:20px;
 background:transparent;color:rgba(190,232,255,.94);
 cursor:col-resize;touch-action:none;user-select:none;
 -webkit-user-select:none;outline-offset:2px;
}
main.v4-inline-resizable-panels .v4-inline-panel-grip[hidden]{display:none!important}
main.v4-inline-resizable-panels .v4-inline-panel-grip-track{
 display:flex;align-items:center;justify-content:center;
 flex-direction:column;gap:5px;width:12px;height:83px;
 border:1px solid rgba(160,214,255,.4);border-radius:12px;
 background:linear-gradient(165deg,rgba(86,149,212,.42),rgba(15,48,88,.89));
 box-shadow:inset 0 1px 0 rgba(255,255,255,.24),0 5px 20px rgba(0,12,35,.37);
 opacity:.78;transition:opacity .16s,border-color .16s,box-shadow .16s;
 pointer-events:none;
}
main.v4-inline-resizable-panels .v4-inline-panel-grip-track span{
 display:block;width:3px;height:16px;border-radius:9px;
 background:rgba(189,236,255,.86);box-shadow:0 1px 3px rgba(6,35,67,.3);
}
main.v4-inline-resizable-panels .v4-inline-panel-grip:hover .v4-inline-panel-grip-track,
main.v4-inline-resizable-panels .v4-inline-panel-grip:focus-visible .v4-inline-panel-grip-track,
body.v4-inline-resizing main.v4-inline-resizable-panels .v4-inline-grip-active .v4-inline-panel-grip-track{
 opacity:1;border-color:rgba(212,248,255,.82);
 background:linear-gradient(170deg,rgba(89,187,251,.55),rgba(22,81,142,.89));
 box-shadow:inset 0 1px 0 rgba(255,255,255,.4),0 0 0 3px rgba(86,191,243,.13),0 5px 21px rgba(0,23,52,.4);
}
body.v4-inline-resizing{cursor:col-resize!important;user-select:none!important;-webkit-user-select:none!important}
body.v4-inline-resizing *{cursor:col-resize!important}
@media(max-width:760px){
 main.v4-inline-resizable-panels .v4-inline-panel-grip{display:none!important}
}
body.v4-focus-active main.v4-inline-resizable-panels .v4-inline-panel-grip{display:none!important}
@media(prefers-reduced-motion:reduce){
 main.v4-inline-resizable-panels .v4-inline-panel-grip-track{transition:none}
}

/* Native item-type cards (Pets/Morphs/Untradeables/Customisable). Each icon
 * comes from the corresponding V2 screenshot sprite, NOT the wearable slots. */
.v4-events-grid .v4-item-type-choice{
 min-height:50px;gap:5px;padding:3px 8px;
}
.v4-events-grid .v4-item-type-choice .v4-event-option-name{
 font:700 11px/1.18 Inter,system-ui,sans-serif;
}
.v4-events-type-warning{
 display:block;padding:8px;margin-top:8px;
 color:#ffe3b3;background:rgba(148,94,29,.13);
 border:1px solid rgba(245,173,93,.35);
 border-radius:10px;font:650 11px/1.3 Inter,system-ui,sans-serif;
}
.v4-library-pane #v4-v2-filters.v4-v2-filters-button{
 display:inline-flex;justify-content:center;align-items:center;gap:5px;
}
.v4-library-pane #v4-v2-filters .v4-filters-icon{
 display:block;flex:0 0 16px;width:16px;height:16px;
 stroke:#e8faff;shape-rendering:geometricPrecision;
}

.v4-events-open .v4-events-trigger-label{flex:1 1 auto;text-align:left;white-space:nowrap}
.v4-events-open .v4-events-selection{flex:0 1 auto;min-width:0;
 color:#abdcf7;font:600 10px/1.2 Inter,system-ui,sans-serif;
 white-space:nowrap;overflow:hidden;text-overflow:ellipsis}

/* V4 requested parity: clothing slots always visible, Filters opens an
 * inline anchored event/type dropdown, never a modal or slot disclosure. */
#v4-library{position:relative!important}
#v4-library .catalog-controls #tabs{display:flex!important;max-height:none!important;overflow:visible!important;flex-wrap:wrap!important}
#v4-library #tabs button.tab{display:inline-flex!important}
#v4-library .v4-viewbar{display:flex!important}
#v4-library .v4-event-filter{display:none!important}
#v4-library .v4-events-open{display:none!important}
#v4-library .v4-v2-filters-button{gap:4px}
#v4-library .v4-filters-selected{
 font-size:9px;color:#aedcf4;max-width:88px;white-space:nowrap;
 overflow:hidden;text-overflow:ellipsis;min-width:0;
}
#v4-library .v4-events-dialog{
 position:absolute;z-index:200;left:8px!important;
 width:calc(100% - 16px);max-width:none;
 top:68px;bottom:auto;
 padding:0;border:1px solid rgba(148,200,240,.55);
 border-radius:14px;
 background:linear-gradient(145deg,#225072,#102b48);
 box-shadow:0 20px 45px rgba(0,9,25,.67);
 max-height:min(68dvh,650px);overflow:hidden;
}
#v4-library .v4-events-dialog[hidden]{display:none!important}
#v4-library .v4-events-header{padding:11px 10px 7px}
#v4-library .v4-events-tabs{margin:0 8px 8px}
#v4-library .v4-events-content{
 padding:0 8px 2px;max-height:min(47dvh,420px);
 overflow:auto;
}
#v4-library .v4-events-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:5px}
#v4-library .v4-event-option{padding:5px;gap:5px;font-size:10px}
#v4-library .v4-event-icon-native{
 display:block;flex:0 0 32px;width:32px;height:32px;
 background-color:transparent;image-rendering:pixelated;
 border:0;box-shadow:none;
}
#v4-library .v4-event-icon-placeholder{
 display:grid;place-items:center;flex:0 0 32px;
 width:32px;height:32px;border-radius:7px;
 background:rgba(255,255,255,.12);color:#e2f0fc;
 font-size:18px;font-weight:700;
}
#v4-library .v4-events-footer{margin:7px 8px 9px}
@media(max-width:760px){
 #v4-library .v4-events-dialog{max-height:60dvh}
 #v4-library .v4-events-content{max-height:38dvh}
}

/* Override the older high-specificity disclosure selectors too. Slot
 * categories are permanent; Filters only controls event/type dropdown. */
#v4-library:not(.v4-v2-filters-open) .v4-viewbar{display:flex!important}
#v4-library:not(.v4-v2-filters-open) #tabs button.tab:not(.v4-v2-favorites-tab){display:inline-flex!important}
#v4-library:not(.v4-v2-filters-open) #tabs{max-height:none!important;overflow:visible!important}

/* V4 compact wardrobe pass (2026-11-02): supplied GT icons + moderate spacing. */
.v4-library-pane #v4-v2-filters.v4-v2-filters-button > .v4-filters-icon{display:none!important}
.v4-library-pane #v4-v2-filters.v4-v2-filters-button::before{
 content:"";display:block;flex:0 0 19px;width:19px;height:19px;
 background:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACoAAAApCAYAAABDV7v1AAABmUlEQVR4AeyYQU7DMBBF3WzgMHAtdhFsOAUbUHZcCw4DG4pepB+5lmPPoAQnUSt9ubH/zLz+plm0C5lX3/dn9PjxdW6hDFK4AAUOdQ8vAb3e3YQWUjgx8AQKIAcxINctpHAA1vwRNIXUYesVYMGOoK2BLPO7raYpeKW6n0RFvvX1mIk+fX4Hq3Lf0FxtzpvumRNlSFpcuk796XVcWzqTzwyqglbr8UB5nnnS9PprvV2JMtyq2mDvuQvU23xJ/xV0yTTp5UqU551VNF9SZlAAPYO9/lpvM2it0drnxwPl+elJzeuv9XYlynCraoO951ZQb9/F/auD8utHNXI8aM63OujcYO++C5RPXFJuOPd0bj+3V/KaQQHMNY/35jwlANXXPGZQNfzrWgIpnWnev4EyMAeU28Obygxqaej1WPwCNoNSQOOS8FikHhavPC5QFbVY9wM6DMOJhH7en8d/QXi/JfHIe7u/Pe0nUdLbaqpKE8Yp0RQWE4YWYjbiK9f8CZQNYBH3K8LcQsyOIWG7AGUDActKQQtpPgzSLwAAAP///2zPRwAAAAZJREFUAwDK/eDcw5XonAAAAABJRU5ErkJggg==") center/contain no-repeat;
 image-rendering:pixelated;
}
.v4-library-pane .catalog-controls .tabs .v4-v2-favorites-tab[data-v2-icon]::before,
#v4-library .catalog-controls .tabs .v4-v2-favorites-tab[data-v2-icon]::before{
 background-image:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAMAAAADACAYAAABS3GwHAAALcUlEQVR4AeydUY4btxJFKSP+edlA8n5tINmGsxV7WfZW4m0kC4idDdj5GAMTFuBMlPG9GpVEimT3EVSwpppdVTw1F8EUqM6zwusiAveDXhcVy02WAAKwaLiwBwIIYA9dZo+WAAKwaLiwBwIIYA9dZo+WwI4FYJlwYUcEEMCtmv3boRRlt8pPHkkAAUgsOPdCAAHspdPsUxJAABILzr0QQAB76fTxPvn8QAABPKDgwx4JIIAnuu6O/Njbfq/THmX/r3coU2vDV5erd7oeFQTfAwEE8ICCD3skgAD22HX2/EAAATyg4MMeCDzeIwJ4TISfd0UAAeyq3Wz2MQEE8JjItT/f1wDK/ve2FGVqbfhqGN79CSCA/ozJMDEBBDBxcyitP4EdCaA/TDKsRwABrNczKm5IAAE0hEmo9QgggK89S5+xUd/uCp867xO+r3m++efH6lEWsZTV5eqdrl8F2aEPAeyw6Wz5XwII4F8W2/3EziwBBGDRcGEPBBDAHrrMHi0BBGDRcGEPBBBA6y7HOR5lLs/370pR5tbjb0oAATTFSbDZCDxVDwJ4ihDXN00AAWy6vWzuKQII4ClCXN80AQSw6fayuacI7E4A6TMz8YweZXG+R9mhIldW3fJ9X0dGylTs8KnzQeGTwUtJ79fE2ap7wwLYasvYV0sCCKAlTWItRwABLNcyCm5JAAG0pEms5QgggOVaRsEtCSCAp2jWIU1R9tR9j69/elOKMjUxCp96hlD4HsdVP+M7mwACOBsVC7dIAAFssavs6WwCCOBsVCzcIgEEsMWusqezCSCAs1GxcAUC2RrTAnBnS1bxZwGVmMgoU5OhUz6bWAUPn72hyYVV+pWtMwsnLYBsAtZDYGYCCGDm7lBbdwIIoDtiEsxMAAHM3B1q605gQwLozooEGyTwrPdf2cswU9/6Ct8PdQfKqrvJ+/PrUpS54OpJ0uGLb4Upc3E26ne/z267/BfAkcG/CwIIYBdtZpOOAAJwZPDvggAC2EKb2cPFBBDAxei4cQsE0gL48v5QlN39eijK1NpTvqImGeGLiUzG4h5lLoY7xxPHcpS57qu14XPrXV717bHwuTjxzCBlisEpn+Nz6p4W11xe53cckv60AJLxWQ6BqQkggKnbQ3G9CSCA3oSJ35XAtcERwLUEuX9pAghg6fZR/LUE0gJQDzIOnyskrilz6798LEWZfDaPm6CE3yXI+j/UG5TFZEdZ5Fam1p7y1bTy7e5ROcMX54SUvXxbirIX70pR9rL6lb2ocTKmcoZPnbcKn4TQzpkWQLvURILAeAIIYHwPqGAggYUFMJAaqTdDAAFsppVs5BICCOASatyzGQLPDubldvj8l/ui7FCnExlTk6FTPvt8Hleo88dkRFmt3+ZQ11z8rF/VEj4XJ64pc+tV7eGLc0XKXBNs/BpMNd6t//ymFGV/1huU/VQ3q6wuV++Deam14eO/AEEB2y0BBLBi66m5GQEE0AwlgVYkgABW7Bo1NyOAAJqhJNCKBKwAzB/T9U9+vc3vXt0XZXaoEJGU6fDl7o8iLTW5iXwmvj1r5Nar80Hhc+vrMEPmcOtb+V3eYKFMTWjCl63nrzrtUfaxBlKmJj3hq8vVO/v7qWKEzwogLmIQmI1A63oQQGuixFuKAAJYql0U25oAAmhNlHhLEUAAS7WLYlsTSAsg+9e3OjcUPreRQ51MKLPTHhfITT/c+ppX5sjGcfFb+V2d2fit9vXpdSnKYiKmLCY7ykz9B/Myy9PutADSGZrdQCAItCeAANozJeJCBBDAQs2i1PYEEEB7pkRciAACWKhZlNqeQDMBmD/WY2Yhq37+6r4os2eHZBR9PijODcmJjq3GBD/ljljK1DmX8J2K9dS14+vZ6Y2q8ZTvONfxZzXpCZ/6Flf4fq6FKjuOefQ5+/tzdOtVH5sJ4KoquBkCgwgggEHgSTsHAQQwRx+oYhABBDAIPGnnIIAA5ugDVRgCvd3dBZD96z7OCSlzgwsLqA4hUt/AcutdYrfeFeTiuPWz+WOyo0yd6wmfqT/7+2DCNHN3F0CzSgkEgQ4EEEAHqIRchwACWKdXVNqBAALoAJWQ6xCYWADrQKTSdQkME0B2GqCeORQ+d+bn7kMpytx628LstMcFahXHxXd+l9f549ySspjsKDN5s/01Ybq7hwmg+85IAIEzCCCAMyCxZLsEEMB2e8vOziCAAM6AdPMlJLwZAQRwM9QkmpHAdALITg/Ut8rC1wy2O8OT9avJSvhcnGYbMIEitzL1La7wmTDZfpkww9zTCWAYCRLvkgAC2GXb2fQ/BBDAPyT4dwoCty4CAdyaOPmmIoAApmoHxdyawO4EEM8MUmbPCLkzM6065eK3mg61itNqv5PF2Z0AJuNPOYMJIIDBDSD9WAITCWAsCLLvkwAC2Gff2fVXAgjgKwj+2SeB6QRwb16uPXe/Hooyt/5QpyLK5DOEYkLjAsU1ZW6986tn7YTPrXf+ui85yVI1hu/HGkjZbzWQsrpcvU27IoNaPp1vOgFMR4iCNk0AAczQXmoYRgABDENP4hkIIIAZukANwwgggGHoSTwDgeUFoCY6p3zu/0H25WMpymyT6rAkNXXJrreJzYWYuygzy8v3b4s0t36j/uUFsNG+7GZbozeKAEZ3gPxDCSCAofhJPpoAAhjdAfIPJYAAhuIn+WgCwwSQPUPy5f2hKHNTHTUQCZ+c3MSEJtuJCKYsYilTa8Pn8n6oF5Sp2Jf4HIiX70pRps4Hha+Wqd7Z/qoYt/ANE0Apt9geOSBwmgACOM2HqxsngAA23mC2d5oAAjjNh6sbJ4AANt5gtneawDICiIGJMre97GBExQ6fOh8UPjdEOeubZa7oY7/bgJoMhe/43uPPsQlltlC1uPpcPce5Fvy8jAAWZEvJCxBAAAs0iRL7EUAA/dgSeQECCGCBJlFiPwIIoB9bIgsCs7m6CyB7JkQ94yd82SGEOyOUbYCNUwcjcpCSTeDWZ+Nn1396U4oyN9568bYUZXEeSJnZV/b3wYRp5u4ugGaVEggCHQgggA5QCbkOAQSwTq+otAMBBNABKiHXIXBDAawDhUr3Q2A6Abhn+tghhxsPGb+d6iR7fvehFGXl51ppC3P1mH2Vj/UGZW59Xd7k3Tt+kyJ9kOkE4EvlCgTaE0AA7ZkScSECCGChZlFqewIIoD3TbyPimZYAApi2NRR2CwLNBJA946Ge8RO+9JSmDl3kmRznd1TN+ue/3JeMufBpv5sk/VQLVeYSqMlQ+Nz05vPrUpTVtJLzDzWxst9rAmV1uXpnf39UjEt8zQRwSXLugcBoAghgdAfIP5QAAhiKf/vJZ98hApi9Q9TXlQAC6IqX4LMTGCaA9LTHkHRnh8zy1EQnpj8ujvMfGr1cfOvPTo0+1EgZ++tNKcpqmJXfwwSwMjRq3w4BBLCdXrKTCwh0FMAF1XALBG5MAAHcGDjp5iKAAObqB9XcmEBaANkzG3fvD0XZ4VBKykop9ZZv7LtX90VZTHCUleTrkHwlw9vlybSBxsaSF9zUyPndxCjOFSlzZ4fUM4TCJ4ssJfv7ZsJYd1oANhIXILAgAQTQo2nEXIYAAlimVRTagwAC6EGVmMsQQADLtIpCexDoLoAYTyhzZ4HUROeULwul+3QlW1Cj9d335aZDzt9oX73DdBdA7w0Qfy4Cq1WDAFbrGPU2JYAAmuIk2GoEEMBqHaPepgQQQFOcBFuNQHcBuAmOOqcTvizA7tOPbEGLrO/OzU2HnH8Qt4YCGLQD0kLgCgII4Ap43Lo+AQSwfg/ZwRUEEMAV8Lh1fQIIYP0esoMrCKQF4KYHV9Twn1tdfOf/z82jfthBXsff+Vsh6R0/LYBWGyMOBGYggABm6AI1DCOAAIahJ/EMBBDADF2ghmEEEMAw9NtIvPou/gYAAP//wjKJrQAAAAZJREFUAwDxUj1407ZRwgAAAABJRU5ErkJggg==");
 background-size:contain;background-position:center;
 background-repeat:no-repeat;image-rendering:pixelated;
}
#v4-library[data-v4-layout="tiles"] #results{
 grid-template-columns:repeat(auto-fill,minmax(64px,1fr));
 grid-auto-rows:80px;gap:6px;padding:9px 9px 12px;
}
#v4-library[data-v4-layout="tiles"] #results>.item{
 max-width:78px;border-radius:20px;
}
#v4-v2-favorites-grid{
 grid-template-columns:repeat(auto-fill,minmax(64px,1fr));
 grid-auto-rows:80px;gap:6px;padding:9px 9px 12px;
}
#v4-v2-favorites-grid .item{max-width:78px;justify-self:center;border-radius:20px}
#v4-library[data-v4-layout=list] #v4-v2-favorites-grid .item{max-width:none;justify-self:stretch;border-radius:12px}
@media(max-width:760px){
 #v4-library[data-v4-layout="tiles"] #results,
 #v4-v2-favorites-grid{
  grid-template-columns:repeat(auto-fill,minmax(59px,1fr));
  grid-auto-rows:74px;gap:6px;padding:9px 9px 12px;
 }
 #v4-library[data-v4-layout="tiles"] #results>.item,
 #v4-v2-favorites-grid .item{max-width:70px}
 #v4-library[data-v4-layout=list] #v4-v2-favorites-grid .item{max-width:none}
}
@media(max-width:365px){
 #v4-library[data-v4-layout="tiles"] #results,
 #v4-v2-favorites-grid{
  grid-template-columns:repeat(auto-fill,minmax(58px,1fr));
  grid-auto-rows:72px;gap:5px;
 }
}

/* Reduce the horizontal EMPTY BAND between bubble rows (not the gaps
   between columns). Track heights now follow square item dimensions instead
   of reserving 80/74/72px for smaller tiles. */
#v4-library[data-v4-layout="tiles"] #results,
#v4-v2-favorites-grid{
  grid-auto-rows:max-content;
  row-gap:8px;
}
@media(max-width:365px){
  #v4-library[data-v4-layout="tiles"] #results,
  #v4-v2-favorites-grid{row-gap:7px}
}

/* V4 item bubbles: use the same float/lift/icon-response as the Roles Calculator. */
#v4-library .v4-viewbar{justify-content:flex-start}
#v4-library .v4-viewtoggle{display:none!important}
#v4-library[data-v4-layout="tiles"] #results>.item,
#v4-library #v4-v2-favorites-grid>.item{
  transform-origin:center;
  transition:transform .26s cubic-bezier(.2,.7,.2,1),box-shadow .26s ease,
             border-color .26s ease,background .26s ease;
}
#v4-library[data-v4-layout="tiles"] #results>.item img,
#v4-library[data-v4-layout="tiles"] #results>.item canvas.v4-icon-fit,
#v4-library #v4-v2-favorites-grid>.item img,
#v4-library #v4-v2-favorites-grid>.item canvas.v4-icon-fit{
  transition:transform .26s ease,filter .26s ease;
}
#v4-library[data-v4-layout="tiles"] #results>.item:is(:hover,:focus-visible,:focus-within),
#v4-library #v4-v2-favorites-grid>.item:is(:hover,:focus-visible,:focus-within){
  z-index:2;transform:translateY(-5px) scale(1.06);
  border-color:rgba(235,246,255,.87);
  box-shadow:inset 0 2px 1px rgba(255,255,255,.38),
             0 15px 25px rgba(5,24,61,.35),0 0 20px rgba(109,186,255,.14);
}
#v4-library[data-v4-layout="tiles"] #results>.item:is(:hover,:focus-visible,:focus-within) :is(img,canvas.v4-icon-fit),
#v4-library #v4-v2-favorites-grid>.item:is(:hover,:focus-visible,:focus-within) :is(img,canvas.v4-icon-fit){
  transform:scale(1.10);filter:drop-shadow(0 7px 7px rgba(0,13,37,.35));
}
#v4-library[data-v4-layout="tiles"] #results>.item:active,
#v4-library #v4-v2-favorites-grid>.item:active{transform:translateY(-1px) scale(.98)}
/* No idle floating: bubbles and sprites remain still until interacted with.
   Keep the Roles-style lift, highlight, scale, and smooth hover transitions. */
#v4-library[data-v4-layout="tiles"] #results>.item,
#v4-library #v4-v2-favorites-grid>.item,
#v4-library[data-v4-layout="tiles"] #results>.item :is(img,canvas.v4-icon-fit),
#v4-library #v4-v2-favorites-grid>.item :is(img,canvas.v4-icon-fit){
  animation:none!important;
}
@media(prefers-reduced-motion:reduce){
  #v4-library[data-v4-layout="tiles"] #results>.item,
  #v4-library #v4-v2-favorites-grid>.item,
  #v4-library[data-v4-layout="tiles"] #results>.item :is(img,canvas.v4-icon-fit),
  #v4-library #v4-v2-favorites-grid>.item :is(img,canvas.v4-icon-fit){
    animation:none!important;transition:none!important;
  }
}
