/* GrowtopiaTools / Set Planner V4 — independent experimental UI
   Layout + presentation only. No sprite scaling, canvas pixel dimensions,
   item selection semantics, input listeners, or rendering behavior is changed.
   File served through /lab/ by the V4-only preview server. */
:root{
  --v4-bg:#080f1a;
  --v4-panel:#102039;
  --v4-edge:rgba(173,220,252,.19);
  --v4-edge-strong:rgba(173,227,255,.42);
  --v4-line:rgba(165,215,250,.13);
  --v4-accent:#8ee7ff;
  --v4-accent-strong:#aef2ff;
  --v4-text:#f0f8ff;
  --v4-sub:#a3bdd0;
  --v4-radius:20px;
  --v4-glass:linear-gradient(147deg,rgba(42,70,106,.78),rgba(15,34,60,.94) 38%,rgba(11,26,47,.95));
}
html{background:var(--v4-bg);scroll-behavior:smooth}
body{
  color:var(--v4-text);
  background:
    radial-gradient(ellipse 42% 48% at 9% 0%,rgba(35,141,204,.17),transparent 74%),
    radial-gradient(ellipse 38% 42% at 98% 76%,rgba(20,91,161,.14),transparent 74%),
    linear-gradient(148deg,#080f1b,#0b1424 57%,#080d17);
}
button,input,select{font-family:inherit}
button,a,input,select,summary{-webkit-tap-highlight-color:transparent}
:where(button,a,input,select,summary,canvas):focus-visible{
  outline:2px solid var(--v4-accent)!important;
  outline-offset:2px;
}
button{transition:background-color .16s ease,border-color .16s ease,box-shadow .16s ease,color .16s ease}
button:disabled{opacity:.38;cursor:not-allowed}
.top,main,footer{max-width:1820px}
.top{
  padding:19px 24px 14px;
  align-items:center;
  gap:16px;
  border-bottom:1px solid rgba(155,212,247,.11);
}
.logo{
  display:inline-flex;
  gap:8px;
  align-items:center;
  font-size:11px;
  color:#a9dff4;
  letter-spacing:.14em;
  font-weight:800;
}
.logo::before{
  content:"";display:inline-block;flex:none;width:10px;height:10px;
  border-radius:3px;transform:rotate(-14deg);
  border:1px solid #b5eeff;
  background:linear-gradient(145deg,#a2ecff,#3299db);
  box-shadow:0 0 14px rgba(71,190,249,.28);
}
.top h1{
  margin:5px 0 3px;
  font-size:clamp(21px,2vw,28px);
  font-weight:790;
  color:#f3faff;
  letter-spacing:-.035em;
}
.top p{font-size:12px;color:#a7c1d2;line-height:1.45;max-width:770px}
.top nav{gap:7px;flex-wrap:wrap;justify-content:flex-end}
.top .link{
  min-height:37px;
  padding:9px 12px;
  color:#d1e9f8;
  font-size:11px;
  font-weight:650;
  border:1px solid rgba(169,220,251,.25);
  border-radius:11px;
  background:linear-gradient(150deg,rgba(119,171,222,.13),rgba(28,56,99,.19));
  box-shadow:inset 0 1px rgba(255,255,255,.09);
}
.top .link:hover{text-decoration:none;border-color:rgba(175,232,255,.7);background:rgba(80,173,225,.22)}
.top .link[href*="v4paint=1"]{border-color:rgba(143,226,254,.42);color:#d9f7ff}
main{
  width:100%;
  grid-template-columns:minmax(256px,305px) minmax(475px,1fr) minmax(290px,345px);
  align-items:start;
  gap:13px;
  padding:16px 18px 30px;
}
.panel{
  min-width:0;
  background:var(--v4-glass);
  border:1px solid var(--v4-edge);
  border-radius:var(--v4-radius);
  box-shadow:inset 0 1px 0 rgba(236,249,255,.10),0 12px 35px rgba(0,5,19,.26);
  backdrop-filter:none;
  -webkit-backdrop-filter:none;
  overflow:hidden;
}
.panelheader{
  position:relative;
  min-height:61px;
  padding:14px 16px 12px;
  background:linear-gradient(180deg,rgba(161,220,255,.065),rgba(161,220,255,.005));
  border-bottom:1px solid var(--v4-line);
}
.panelheader:after,.scenetop:after{
  content:"";position:absolute;bottom:-1px;left:16px;width:52px;height:2px;
  pointer-events:none;background:linear-gradient(90deg,rgba(118,227,255,.96),transparent);
}
.panel h2{font-size:15px;font-weight:760;letter-spacing:-.018em;color:#edf8ff}
.small{color:#a9c2d4}
.panelheader .small{font-size:10px;text-align:right}
.catalog{
  display:flex;flex-direction:column;min-height:540px;
  overflow:hidden;
}
.catalog .panelheader #count{font-variant-numeric:tabular-nums}
.coverage{
  background:rgba(26,74,98,.29);
  border-color:rgba(147,219,248,.24);
  border-radius:11px;
  margin:11px 13px 10px;
  padding:9px 11px;
  font-size:10.5px;
  color:#b5d6e6;
  line-height:1.52;
}
.catalog-controls{
  padding:0 13px 12px;
  gap:10px;
  border-bottom:1px solid var(--v4-line);
}
.catalog-controls input[type=search]{
  min-height:45px;
  padding:11px 12px 11px 37px;
  background-color:rgba(3,17,34,.58);
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' fill='none' stroke='%2393bfd8' stroke-width='1.9' viewBox='0 0 24 24'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m16 16 5 5'/%3E%3C/svg%3E");
  background-repeat:no-repeat;background-position:12px center;
  border-radius:11px;
  border:1px solid rgba(160,214,252,.30);
  font-size:12px;color:#edf9ff;
  box-shadow:inset 0 1px 2px rgba(0,0,0,.2);
}
.catalog-controls input::placeholder{color:#8cacc3}
.catalog-controls input[type=search]:focus{
  border-color:#a0eaff;
  box-shadow:0 0 0 3px rgba(86,192,250,.12);
}
.tabs{gap:6px;align-items:center}
.tab{
  padding:7px 10px;
  border:1px solid rgba(170,220,250,.20);
  background:linear-gradient(145deg,rgba(110,162,216,.12),rgba(23,50,88,.21));
  color:#bdd7ea;
  border-radius:10px;
  font-size:11px;line-height:1.3;font-weight:630;
  min-height:33px;
}
.tab:hover{border-color:rgba(170,230,255,.52);background:rgba(95,169,219,.22)}
.tab.active{
  color:#f0faff;
  background:linear-gradient(145deg,rgba(79,191,244,.34),rgba(35,104,176,.32));
  border-color:rgba(161,232,255,.76);
  box-shadow:inset 0 1px rgba(255,255,255,.17),0 4px 12px rgba(12,74,123,.20);
}
.items{
  min-height:290px;
  max-height:calc(100dvh - 315px);
  padding:11px 11px 15px;
  scrollbar-width:thin;
  scrollbar-color:rgba(139,203,245,.35) transparent;
}
.item{
  position:relative;
  min-height:55px;
  padding:7px 8px;
  gap:11px;
  margin-bottom:5px;
  border-radius:13px;
  border:1px solid rgba(157,212,247,.13);
  color:#e9f5fc;
  background:linear-gradient(145deg,rgba(93,145,204,.12),rgba(32,67,107,.08));
}
.item:hover{
  background:linear-gradient(145deg,rgba(100,181,225,.22),rgba(32,79,127,.18));
  border-color:rgba(166,224,253,.38);
}
.item.selected{
  background:linear-gradient(145deg,rgba(60,174,222,.27),rgba(28,104,159,.19));
  border-color:rgba(137,230,255,.82);
  box-shadow:inset 0 0 0 1px rgba(145,224,250,.07),0 0 16px rgba(37,148,215,.11);
}
.item.selected:after{
  content:"✓";display:grid;place-items:center;flex:none;
  width:19px;height:19px;border-radius:50%;
  color:#0a3245;background:#a8ecff;font-size:11px;font-weight:900;
}
.item img,.item canvas{
  background:radial-gradient(circle at 34% 14%,rgba(197,229,255,.22),rgba(56,111,166,.24));
  border:1px solid rgba(159,216,255,.26);
  border-radius:10px;
  box-shadow:inset 0 1px rgba(255,255,255,.11);
}
.item strong{font-size:12px;color:#e9f6ff;line-height:1.3}
.item small{color:#9fbfd4;font-size:10px}
.item.unmapped{border-left:2px solid #bc8e74}
.pagination{
  margin-top:auto;
  padding:10px 13px 13px;
  border-top:1px solid var(--v4-line);
  background:rgba(4,17,33,.16);
}
.pagination .small{color:#b7d7e9;font-variant-numeric:tabular-nums}
.pagination .control{min-height:35px}
.scene{gap:11px;padding:12px}
.scenetop{
  position:relative;
  min-height:45px;
  padding:5px 5px 12px;
  border-bottom:1px solid var(--v4-line);
}
.scenetop:after{left:5px}
.scene .compare-actions{gap:6px;justify-content:flex-end}
.scene #compare-toggle,.scene #difference-toggle{
  font-size:11px;min-height:35px;padding:7px 10px;
}
.flag{
  display:inline-flex;align-items:center;gap:7px;
  min-height:30px;
  border-color:rgba(153,229,255,.47);
  border-radius:10px;
  background:rgba(41,121,172,.25);
  font-size:10px;font-weight:700;
  color:#c7f2ff;
}
.flag:before{
  content:"";width:6px;height:6px;background:#72deff;border-radius:50%;
  box-shadow:0 0 0 3px rgba(95,199,242,.14);
}
.canvaswrap{
  isolation:isolate;
  min-height:410px;
  border-radius:16px;
  border:1px solid rgba(154,220,252,.3);
  background:
    linear-gradient(180deg,rgba(123,198,244,.11),transparent 26%),
    radial-gradient(circle at 50% 46%,rgba(46,118,163,.42),rgba(8,33,61,.47) 59%,rgba(5,20,39,.82) 100%);
  box-shadow:inset 0 1px rgba(238,248,255,.12),0 10px 28px rgba(0,13,28,.21);
}
.canvaswrap::before{background:linear-gradient(90deg,transparent,rgba(183,230,255,.35),transparent)}
.canvaswrap canvas{
  max-width:100%;
  image-rendering:pixelated;
  /* Camera and zoom transforms belong to the renderer. */
}
.canvas-hint{
  color:#c0daed;
  background:rgba(5,24,44,.68);
  border:1px solid rgba(166,217,249,.13);
  border-radius:9px;
  padding:7px 10px;
  left:50%;right:auto;bottom:10px;
  transform:translateX(-50%);
  width:max-content;max-width:calc(100% - 24px);
  font-size:10px;line-height:1.5;
}
.reference-preview{
  background:linear-gradient(155deg,rgba(11,35,59,.95),rgba(18,54,81,.80));
  border-color:rgba(159,223,255,.25);
}
.reference-title strong{font-size:12px;color:#ecf7ff}
.progress{
  gap:12px;
  padding:7px 9px;
  border:1px solid rgba(150,214,247,.12);
  background:rgba(6,27,49,.26);
  border-radius:9px;
}
.progress strong{
  font-size:11px;
  color:#c0effe;
  overflow-wrap:anywhere;
}
.progress #fps{white-space:nowrap;font-variant-numeric:tabular-nums}
.v4-toolbar-block{
  display:flex;flex-direction:column;
  gap:8px;padding:10px;
  border:1px solid rgba(166,213,246,.17);
  border-radius:14px;
  background:linear-gradient(155deg,rgba(6,23,43,.55),rgba(6,22,44,.25));
}
.v4-toolbar-label{display:flex;align-items:center;justify-content:space-between;gap:8px;padding:0 2px}
.v4-toolbar-label strong{font-size:10px;letter-spacing:.09em;text-transform:uppercase;color:#a7d4ed}
.v4-toolbar-label .small{font-size:10px;text-align:right}
.v4-toolbar-block .bar{justify-content:flex-start;gap:7px}
.control{
  min-height:37px;
  border-radius:10px;
  background:linear-gradient(150deg,rgba(102,165,216,.19),rgba(26,62,109,.18));
  border:1px solid rgba(164,220,251,.26);
  box-shadow:inset 0 1px rgba(255,255,255,.10);
  padding:8px 11px;
  font-size:11px;font-weight:650;color:#d7eafa;
}
.control:hover{
  border-color:rgba(194,238,255,.67);
  background:rgba(72,163,222,.23);
}
.control.active{
  color:#e8fcff;
  border-color:rgba(171,237,255,.83);
  background:linear-gradient(145deg,rgba(81,189,235,.4),rgba(33,108,174,.3));
  box-shadow:inset 0 1px rgba(255,255,255,.17),0 0 0 1px rgba(69,188,248,.07);
}
.scene #clear{border-color:rgba(228,162,169,.32)}
.scene #clear:hover{background:rgba(183,72,91,.2);border-color:rgba(248,165,178,.63)}
.scene #download-png{border-color:rgba(155,230,251,.55)}
.aimbar{justify-content:flex-start;gap:6px}
.aimbar .small{font-size:11px;font-weight:690;color:#a8d6ea}
.v4-toolbar-block .aimbar .control{min-width:41px;min-height:36px}
.v4-character-options{
  display:flex;align-items:center;flex-wrap:wrap;gap:9px;
}
.v4-character-options label{font-size:11px;color:#bed6e8;font-weight:650}
.v4-character-options #skin{
  min-width:136px;width:auto;flex:1 1 145px;max-width:270px;
  min-height:39px;padding:8px 10px;
  background:rgba(3,18,37,.65);border-color:rgba(155,215,250,.35);
}
.v4-character-options .v4-effects-label{display:inline-flex;gap:8px;align-items:center}
.v4-character-options #effects{width:17px;height:17px;margin:0;accent-color:#67d7f4}
.scene #message{
  font-size:11px;line-height:1.5;
  padding:11px 13px;
}
.side{gap:12px}
.side>.panel{min-width:0}
.slots{gap:8px;padding:12px 13px 15px}
.slot{
  border-color:rgba(156,212,249,.25);
  border-radius:12px;
  background:linear-gradient(150deg,rgba(92,147,207,.15),rgba(17,43,75,.24));
  min-height:75px;padding:10px;
}
.slot:hover{border-color:rgba(170,234,255,.56);background:rgba(80,168,211,.20)}
.slot.filled{
  border-color:rgba(152,231,255,.58);
  background:linear-gradient(145deg,rgba(46,145,189,.30),rgba(24,83,145,.23));
}
.slot span{color:#a9ccdf;font-size:10px;letter-spacing:.01em}
.slot strong{font-size:12px;color:#e9f9ff}
.reviewpanel{padding:11px 14px 15px}
.reviewpanel p{color:#a9c8d9;font-size:11px;line-height:1.6}
.reviewpanel label.small{display:block;margin-bottom:8px}
.reviewpanel :is(input,select){border-color:rgba(160,217,249,.27);background:rgba(4,20,37,.62)}
.reviewpanel input[type=file]{
  color:#b7d9ec;font-size:10px;line-height:1.5;padding:9px;
}
.reviewpanel input[type=file]::file-selector-button{
  margin-right:9px;padding:7px 8px;
  color:#e9f9ff;cursor:pointer;
  border:1px solid rgba(163,221,251,.39);
  border-radius:8px;background:rgba(62,139,200,.26);
}
.item-options{border-color:var(--v4-line)}
.item-options label{gap:12px}
.item-options :is(select,input[type=number]){min-width:0}
.audit{padding:10px 14px 14px}
.audit summary{color:#bdd9e9!important;font-size:11px}
.audit pre{background:rgba(4,17,34,.68);border:1px solid rgba(166,216,251,.14);color:#c8ddec}
.v4-build-badge{
  border:1px solid rgba(155,220,252,.36);
  border-radius:9px;
  background:rgba(6,20,39,.94);
  color:#b9dfef;
  box-shadow:0 5px 16px rgba(0,5,17,.34);
}
footer{padding:10px 24px 44px;color:#829fb5;line-height:1.45;font-size:11px}
.v4-mobile-jump{display:none}
@media(max-width:1400px) and (min-width:1131px){
  main{grid-template-columns:minmax(245px,280px) minmax(385px,1fr) minmax(268px,310px);gap:11px;padding:12px}
  .scene .compare-actions{gap:5px}
  .scene #compare-toggle,.scene #difference-toggle{padding:6px 8px;font-size:10px}
  .panelheader{padding:12px}
  .slots{grid-template-columns:repeat(2,minmax(0,1fr))}
}
@media(max-width:1130px){
  main{grid-template-columns:minmax(238px,310px) minmax(0,1fr)}
  .side{grid-column:1/-1;display:grid;grid-template-columns:repeat(2,minmax(0,1fr));align-items:start}
  .catalog{min-height:500px}
  .items{max-height:650px}
}
@media(max-width:760px){
  .top{padding:15px 14px 12px}
  .top h1{font-size:21px}
  .top p{font-size:11px}
  .top nav{justify-content:flex-start;gap:6px}
  .top .link{min-height:35px;padding:7px 9px;font-size:10px}
  main{display:flex;flex-direction:column;padding:9px 9px 26px;gap:10px}
  main>.scene{order:0;width:100%}
  main>.catalog{order:1;width:100%}
  main>.side{order:2;width:100%;display:flex}
  .catalog{min-height:0}
  .items{max-height:400px;min-height:140px}
  .canvaswrap{min-height:270px}
  .scene{padding:9px}
  .scenetop{flex-wrap:wrap;align-items:flex-start;gap:7px}
  .scenetop h2{margin:3px 0}
  .scene .compare-actions{justify-content:flex-start}
  .canvas-hint{font-size:9px;line-height:1.4;width:calc(100% - 16px);max-width:none}
  .v4-toolbar-block{padding:9px}
  .v4-toolbar-block .bar{gap:6px}
  .v4-toolbar-block .control{min-height:42px;flex:1 1 auto}
  .v4-character-options #skin{min-width:120px;max-width:none}
  .slots{grid-template-columns:repeat(2,minmax(0,1fr))}
  .v4-mobile-jump{
    position:sticky;z-index:18;top:0;display:grid;grid-template-columns:repeat(3,minmax(0,1fr));
    gap:5px;margin:0 9px 2px;padding:5px;
    border:1px solid rgba(172,225,253,.34);border-radius:13px;
    background:rgba(12,34,61,.98);
    box-shadow:0 8px 24px rgba(0,9,26,.45);
  }
  .v4-mobile-jump a{
    display:flex;justify-content:center;align-items:center;
    min-height:38px;border-radius:9px;
    color:#d0e8f8;font-size:11px;font-weight:710;text-decoration:none;
    border:1px solid transparent;
  }
  .v4-mobile-jump a:hover,.v4-mobile-jump a:focus-visible{
    border-color:rgba(153,227,255,.45);
    background:rgba(69,154,215,.28);
  }
  #v4-character,#v4-library,#v4-equipped{scroll-margin-top:65px}
  footer{padding:10px 17px 48px}
}
@media(max-width:400px){
  .top{padding:13px 10px}
  .top h1{font-size:19px}
  main{padding:7px 6px 25px}
  .panel{border-radius:16px}
  .panelheader{padding:12px;min-height:52px}
  .panel h2{font-size:14px}
  .scene .compare-actions{flex-wrap:wrap}
  .scene #compare-toggle,.scene #difference-toggle{min-height:36px}
  .v4-toolbar-block .bar .control{padding:8px;font-size:10px}
  .aimbar .control{min-width:36px!important}
  .slots{padding:10px;gap:7px}
  .slot{min-height:70px;padding:8px}
  .v4-mobile-jump{margin:0 6px}
}
@media(prefers-reduced-motion:reduce){
  html{scroll-behavior:auto}
  *,*::before,*::after{transition:none!important;animation:none!important}
}

/* Switchable native inventory-icon grid. Only layout changes; the same item
   buttons are still owned, populated and selected by compatibility/app.mjs. */
.v4-viewbar{
  display:flex;justify-content:space-between;align-items:center;
  flex-wrap:wrap;gap:8px;padding:0 1px;
}
.v4-viewbar .small{font-size:10px;color:#a7c4d9;font-weight:630}
.v4-viewtoggle{
  display:flex;align-items:center;gap:3px;padding:3px;
  background:rgba(3,18,36,.52);
  border:1px solid rgba(151,215,249,.21);
  border-radius:10px;
}
.v4-viewtoggle button{
  display:inline-flex;align-items:center;justify-content:center;
  min-width:54px;min-height:29px;
  padding:5px 9px;border:1px solid transparent;border-radius:8px;
  background:transparent;color:#9fbdd2;font-size:10px;font-weight:710;
}
.v4-viewtoggle button:hover{color:#e1f8ff;background:rgba(105,189,236,.13)}
.v4-viewtoggle button.active,.v4-viewtoggle button[aria-pressed=true]{
  color:#f0fbff;
  border-color:rgba(160,228,255,.47);
  background:linear-gradient(145deg,rgba(92,194,244,.33),rgba(34,98,172,.28));
  box-shadow:inset 0 1px rgba(255,255,255,.13);
}
#v4-library[data-v4-layout=tiles] .items{
  display:grid;
  grid-template-columns:repeat(auto-fill,minmax(78px,1fr));
  gap:8px;
  align-content:start;
  justify-items:stretch;
  padding:12px;
}
#v4-library[data-v4-layout=tiles] .item{
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:flex-start;
  position:relative;
  gap:6px;margin:0;
  width:100%;min-width:0;
  min-height:107px;
  padding:10px 5px 7px;
  text-align:center;
  border:1px solid rgba(166,223,253,.33);
  border-radius:15px;
  background:radial-gradient(circle at 27% 0%,rgba(238,251,255,.16),transparent 55%),linear-gradient(145deg,rgba(102,169,229,.23),rgba(27,66,126,.24));
  box-shadow:inset 0 1px rgba(255,255,255,.17),0 5px 14px rgba(0,11,30,.22);
}
#v4-library[data-v4-layout=tiles] .item:hover{
  border-color:rgba(208,244,255,.78);
  background:linear-gradient(145deg,rgba(121,209,250,.31),rgba(50,115,184,.25));
  box-shadow:inset 0 1px rgba(255,255,255,.22),0 7px 19px rgba(0,17,47,.3);
}
#v4-library[data-v4-layout=tiles] .item.selected{
  border-color:#a5efff;
  background:linear-gradient(145deg,rgba(102,220,255,.34),rgba(38,126,189,.34));
  box-shadow:0 0 0 2px rgba(122,233,255,.34),inset 0 1px rgba(255,255,255,.22);
}
#v4-library[data-v4-layout=tiles] .item.selected:after{
  position:absolute;top:5px;right:5px;
  width:18px;height:18px;
  box-shadow:0 2px 5px rgba(0,19,47,.44);
}
#v4-library[data-v4-layout=tiles] .item img,
#v4-library[data-v4-layout=tiles] .item canvas{
  width:44px;height:44px;min-width:44px;max-width:44px;flex:0 0 44px;
  border:0;background:none;box-shadow:none;
}
#v4-library[data-v4-layout=tiles] .item .text{
  flex:0 0 auto;width:100%;min-width:0;
  overflow:hidden;
}
#v4-library[data-v4-layout=tiles] .item strong{
  display:-webkit-box;
  -webkit-line-clamp:2;
  -webkit-box-orient:vertical;
  line-clamp:2;
  overflow:hidden;
  font-size:10px;
  line-height:1.3;
  color:#ecfaff;
  white-space:normal;
  overflow-wrap:anywhere;
}
#v4-library[data-v4-layout=tiles] .item small{
  font-size:9px;line-height:1.2;color:#afcfe3;margin-top:4px;
  overflow:hidden;text-overflow:ellipsis;white-space:nowrap;
}
#v4-library[data-v4-layout=tiles] .item.unmapped{
  border-left-color:rgba(188,141,111,.85);
}
@media(max-width:1130px){
  #v4-library[data-v4-layout=tiles] .items{grid-template-columns:repeat(auto-fill,minmax(77px,1fr))}
}
@media(max-width:760px){
  .v4-viewtoggle button{min-width:63px;min-height:34px}
  #v4-library[data-v4-layout=tiles] .items{grid-template-columns:repeat(auto-fill,minmax(79px,1fr));gap:9px}
  #v4-library[data-v4-layout=tiles] .item{min-height:110px}
}


/* Iteration 3: source-native equipped item cards and secondary developer tools. */
.top .v4-heading-suffix{
  display:inline-flex;align-items:center;vertical-align:middle;
  margin-left:5px;padding:4px 8px;
  border-radius:8px;
  border:1px solid rgba(144,223,253,.38);
  background:rgba(51,138,186,.18);
  color:#b2ebfc;
  font-size:11px;line-height:1.1;font-weight:730;letter-spacing:.025em;
}
.top .link.v4-mode-active{
  border-color:rgba(156,229,253,.79);
  color:#edfbff;
  background:linear-gradient(150deg,rgba(93,197,245,.32),rgba(35,94,166,.31));
  box-shadow:inset 0 1px rgba(255,255,255,.17),0 0 0 1px rgba(82,192,247,.1);
}
.v4-hint-touch{display:none}
#v4-equipped .slots{
  grid-template-columns:repeat(2,minmax(0,1fr));
}
#v4-equipped .slots>.small{
  grid-column:1/-1;
  padding:11px;margin:0;
  border:1px dashed rgba(162,213,246,.23);
  border-radius:11px;
  background:rgba(6,23,42,.27);
  text-align:center;
  color:#a8c8dd;
}
#v4-equipped .slot-item.v4-equipped-item{
  display:flex;align-items:center;justify-content:flex-start;
  min-height:68px;min-width:0;
  gap:8px;padding:9px;
  margin:0;width:100%;
  background:radial-gradient(circle at 15% 0%,rgba(174,230,255,.14),transparent 54%),linear-gradient(145deg,rgba(75,152,210,.23),rgba(23,60,110,.32));
  border:1px solid rgba(162,225,255,.45);
  border-radius:12px;
  box-shadow:inset 0 1px 0 rgba(255,255,255,.13),0 5px 12px rgba(0,10,26,.13);
  color:#edfaff;
  text-align:left;
}
#v4-equipped .slot-item.v4-equipped-item:hover{
  border-color:#a5efff;
  background:linear-gradient(145deg,rgba(86,186,242,.29),rgba(34,100,167,.28));
}
#v4-equipped .v4-equipped-icon{
  display:block;flex:0 0 36px;
  width:36px;height:36px;
  object-fit:contain;
  image-rendering:pixelated;
  border:1px solid rgba(174,225,255,.24);
  border-radius:10px;
  background:radial-gradient(circle at 36% 15%,rgba(217,241,255,.19),rgba(32,78,125,.19));
}
#v4-equipped .v4-equipped-icon.v4-icon-unavailable{visibility:hidden}
#v4-equipped .v4-equipped-copy{
  display:flex;flex:1 1 0;min-width:0;
  flex-direction:column;gap:3px;
}
#v4-equipped .v4-equipped-slot{
  color:#a7cde3;
  font-size:9px;line-height:1.2;
  white-space:nowrap;overflow:hidden;text-overflow:ellipsis;
}
#v4-equipped .v4-equipped-name{
  font-size:11px;font-weight:720;line-height:1.3;
  color:#effaff;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;
}
#v4-equipped .v4-equipped-remove{
  display:grid;flex:0 0 17px;place-items:center;
  width:17px;height:17px;
  border-radius:5px;
  background:rgba(5,21,42,.45);
  color:#b5d7ed;
  font-size:15px;line-height:1;
  opacity:.72;
}
#v4-equipped .slot-item.v4-equipped-item:hover .v4-equipped-remove{
  background:rgba(180,65,86,.23);
  color:#ffd1d8;
  opacity:1;
}
.v4-advanced-tools{
  min-width:0;
  border-radius:15px;
  border:1px solid rgba(151,204,239,.2);
  background:rgba(9,31,56,.38);
}
.v4-advanced-tools>summary{
  display:flex;align-items:center;justify-content:space-between;
  gap:12px;padding:13px 15px;
  cursor:pointer;
  list-style:none;
  user-select:none;
  color:#cbdfec;
}
.v4-advanced-tools>summary::-webkit-details-marker{display:none}
.v4-advanced-tools>summary>span:first-child{display:flex;flex-direction:column;gap:3px}
.v4-advanced-tools>summary strong{
  font-size:12px;font-weight:720;color:#c9e6f5;
}
.v4-advanced-tools>summary small{
  font-size:10px;color:#91b3c9;
}
.v4-advanced-tools .v4-advanced-arrow{
  font-size:20px;line-height:1.1;color:#a3dff6;
  transition:transform .18s ease;
}
.v4-advanced-tools[open] .v4-advanced-arrow{transform:rotate(180deg)}
.v4-advanced-tools>summary:hover{background:rgba(82,164,208,.10)}
.v4-advanced-tools[open]{padding-bottom:8px}
.v4-advanced-tools[open]>summary{border-bottom:1px solid var(--v4-line);margin-bottom:8px}
.v4-advanced-tools>.panel{margin:8px;border-radius:12px}
.v4-advanced-tools>.panel .panelheader{min-height:49px}
.v4-advanced-tools>.panel .panelheader h2{font-size:12px}
.v4-advanced-tools>.panel .reviewpanel{padding:10px}
.v4-advanced-tools>.panel .reviewpanel p{font-size:10.5px}
@media(max-width:1130px){
  .side>.v4-advanced-tools{grid-column:1/-1}
  .v4-advanced-tools[open]{
    display:grid;
    grid-template-columns:repeat(2,minmax(0,1fr));
    gap:0 8px;
    padding:0 8px 8px;
  }
  .v4-advanced-tools[open]>summary{grid-column:1/-1;margin:0 -8px 8px;padding:13px 16px}
  .v4-advanced-tools[open]>.panel{margin:0}
}
@media(max-width:760px){
  .v4-hint-desktop{display:none}
  .v4-hint-touch{display:inline}
  .v4-heading-suffix{font-size:10px!important;margin-left:3px!important}
  .v4-advanced-tools[open]{display:block;padding:0 7px 7px}
  .v4-advanced-tools[open]>summary{margin:0 -7px 8px}
  .v4-advanced-tools[open]>.panel{margin:8px 0}
}
@media(max-width:400px){
  #v4-equipped .slots{grid-template-columns:repeat(2,minmax(0,1fr))}
  #v4-equipped .slot-item.v4-equipped-item{min-height:62px;padding:7px;gap:5px}
  #v4-equipped .v4-equipped-icon{width:31px;height:31px;flex-basis:31px}
  #v4-equipped .v4-equipped-name{font-size:10px}
  #v4-equipped .v4-equipped-remove{width:14px;flex-basis:14px;font-size:13px}
}


/* V4 desktop focus and responsive action grouping. No canvas / sprite changes. */
.v4-toolbar-grid{
  display:grid;
  grid-template-columns:minmax(0,1fr);
  gap:9px;
  align-items:start;
}
.v4-toolbar-grid .v4-toolbar-block{min-width:0}
.v4-toolbar-grid .v4-toolbar-block>.bar{min-width:0}
.scene .v4-focus-button{
  min-height:35px;
  padding:7px 11px;
  font-size:11px;
  color:#bcecfb;
  border-color:rgba(169,219,248,.32);
}
.scene .v4-focus-button[aria-pressed=true]{
  color:#ebfbff;
  border-color:#9ae9ff;
  background:linear-gradient(140deg,rgba(92,197,243,.36),rgba(34,104,179,.33));
}
@media(min-width:1500px){
  .v4-toolbar-grid{
    grid-template-columns:repeat(2,minmax(0,1fr));
    column-gap:9px;
    row-gap:9px;
  }
}
@media(min-width:761px){
  body.v4-focus-active main{
    grid-template-columns:minmax(0,1fr)!important;
    max-width:1430px;
  }
  body.v4-focus-active main>.catalog,
  body.v4-focus-active main>.side{display:none!important}
  body.v4-focus-active main>.scene{
    grid-column:1;
    width:100%;
    justify-self:stretch;
  }
  body.v4-focus-active .canvaswrap{
    min-height:450px;
    border-color:rgba(179,237,255,.42);
  }
  body.v4-focus-active .v4-toolbar-grid{
    grid-template-columns:repeat(2,minmax(0,1fr));
  }
}
@media(max-width:760px){
  .scene .v4-focus-button{display:none}
  .v4-toolbar-grid{gap:9px}
}
@media(prefers-reduced-motion:reduce){
  .v4-toolbar-grid .control{transition:none}
}

/* Ten-slot wardrobe composition: each empty category is a real browse action. */
#v4-equipped .slots{
  align-content:start;
  gap:8px;
}
#v4-equipped .v4-empty-slot{
  display:flex;flex-direction:column;justify-content:center;
  gap:4px;text-align:left;position:relative;
  min-width:0;min-height:68px;padding:10px 11px;
  border-radius:12px;
  border:1px dashed rgba(157,207,240,.30);
  background:linear-gradient(145deg,rgba(79,136,195,.075),rgba(15,43,81,.14));
  color:#a1c3d8;
  box-shadow:inset 0 1px rgba(255,255,255,.025);
}
#v4-equipped .v4-empty-slot:hover{
  border-color:rgba(162,233,255,.68);
  background:linear-gradient(145deg,rgba(77,168,226,.21),rgba(22,77,135,.16));
  color:#e0f8ff;
}
#v4-equipped .v4-empty-slot-name{
  display:block;min-width:0;
  font-size:10px;line-height:1.3;
  font-weight:630;color:#91aec3;
  white-space:nowrap;overflow:hidden;text-overflow:ellipsis;
}
#v4-equipped .v4-empty-slot strong{
  font-size:11px;line-height:1.3;
  font-weight:690;color:#a9d2e8;
}
#v4-equipped .v4-empty-slot:hover strong{color:#d5f5ff}
@media(max-width:400px){
  #v4-equipped .v4-empty-slot{min-height:62px;padding:8px}
  #v4-equipped .v4-empty-slot-name{font-size:9px}
  #v4-equipped .v4-empty-slot strong{font-size:10px}
}

/* Keyboard-accessible wardrobe search */
.v4-searchbox{position:relative;min-width:0}
.v4-searchbox input[type=search]{
  width:100%;
  padding-right:48px;
  appearance:none;
}
.v4-searchbox input[type=search]::-webkit-search-cancel-button{
  -webkit-appearance:searchfield-cancel-button;
  cursor:pointer;
}
.v4-search-shortcut{
  position:absolute;
  right:12px;top:50%;transform:translateY(-50%);
  display:grid;place-items:center;
  pointer-events:none;
  width:23px;height:23px;
  border:1px solid rgba(148,219,255,.3);
  border-radius:6px;
  background:rgba(93,146,183,.13);
  color:#bddbeb;
  font:600 11px/1 ui-monospace,SFMono-Regular,Consolas,monospace;
}
.v4-searchbox:focus-within .v4-search-shortcut{border-color:rgba(156,239,255,.64)}
@media(max-width:760px){.v4-search-shortcut{display:none}}

/* Single-row category carousel: keeps wardrobe filter compact on all screens. */
.catalog-controls .tabs{
  display:flex;
  flex-wrap:nowrap;
  align-items:stretch;
  gap:6px;
  min-width:0;
  overflow-x:auto;
  overflow-y:hidden;
  padding:2px 2px 7px;
  overscroll-behavior-inline:contain;
  scroll-snap-type:x proximity;
  scrollbar-width:thin;
  scrollbar-color:rgba(140,207,249,.32) transparent;
}
.catalog-controls .tabs .tab{
  flex:0 0 auto;
  white-space:nowrap;
  scroll-snap-align:start;
  min-height:35px;
}
.catalog-controls .tabs::-webkit-scrollbar{height:4px}
.catalog-controls .tabs::-webkit-scrollbar-thumb{
  background:rgba(140,207,249,.32);
  border-radius:6px;
}
@media(max-width:760px){
  .catalog-controls .tabs{
    margin-right:-5px;
    -webkit-overflow-scrolling:touch;
  }
  .catalog-controls .tabs .tab{min-height:40px;padding:9px 12px}
}

/* Finishing touches: set sharing and truthful empty variant settings. */
#v4-copy-link{
  border-color:rgba(147,225,246,.54);
  color:#dcf6ff;
}
#v4-copy-link:hover{
  border-color:rgba(180,246,255,.85);
  background:rgba(55,157,187,.26);
}
#v4-copy-link.v4-copied{
  border-color:rgba(120,232,189,.66);
  background:rgba(43,132,115,.24);
  color:#d6ffef;
}
.v4-copy-status{
  display:inline-flex;align-items:center;
  min-height:30px;
  font-size:10px;
  color:#bde5f0;
  line-height:1.3;
}
#item-options:empty{
  min-height:75px;
  display:flex;align-items:center;
}
#item-options:empty::before{
  content:"Equip a wearable with adjustable effects or colors to see its settings here.";
  display:block;
  color:#a8c3d5;
  font-size:11px;
  line-height:1.65;
  padding:2px 0;
}
@media(max-width:760px){
  .v4-copy-status{flex:1 1 100%;justify-content:center;text-align:center}
}


/* Stage comparison: reference is beside V4 on wide displays, but stacked on
   smaller screens. The engine still owns the two 960x640 canvas surfaces. */
@media(min-width:1450px){
  #v4-character.scene:has(> #reference-preview:not([hidden])){
    display:grid;
    grid-template-columns:repeat(2,minmax(0,1fr));
    align-content:start;
    gap:12px;
  }
  #v4-character.scene:has(> #reference-preview:not([hidden])) > .scenetop,
  #v4-character.scene:has(> #reference-preview:not([hidden])) > .progress,
  #v4-character.scene:has(> #reference-preview:not([hidden])) > .v4-toolbar-grid,
  #v4-character.scene:has(> #reference-preview:not([hidden])) > #message{
    grid-column:1/-1;
  }
  #v4-character.scene:has(> #reference-preview:not([hidden])) > .canvaswrap,
  #v4-character.scene:has(> #reference-preview:not([hidden])) > #reference-preview{
    min-width:0;
    margin:0;
    height:auto;
    min-height:340px;
  }
  #v4-character.scene:has(> #reference-preview:not([hidden])) > #reference-preview{
    justify-content:center;
    padding:10px;
  }
  #v4-character.scene:has(> #reference-preview:not([hidden])) > #reference-preview canvas{
    width:100%;
    max-width:100%;
    height:auto;
  }
  /* Heatmaps need their own full-width row to stay legible. */
  #v4-character.scene:has(> #reference-preview #difference-preview:not([hidden])){
    grid-template-columns:minmax(0,1fr);
  }
  #v4-character.scene:has(> #reference-preview #difference-preview:not([hidden])) > *{
    grid-column:1;
  }
}
#v4-character #compare-status{
  max-width:100%;
  line-height:1.5;
  color:#bad6e7;
}
#v4-character #difference-preview{
  border-top:1px solid rgba(159,218,251,.15);
  padding-top:12px;
}
#v4-character #difference-preview canvas{
  max-width:100%;
  height:auto;
  image-rendering:pixelated;
}
#v4-character .reference-title strong{
  letter-spacing:.01em;
  color:#e6faff;
}


/* Browser screenshot review, 2026-11-02: at phone widths the tablet rule
   'align-items:start' shrank the right-side panels to their contents.
   Explicitly stretch every child in the flex-column mobile workstation. */
#v4-copy-status:empty{display:none}
@media(max-width:760px){
  main>.side{
    width:100%;
    align-items:stretch;
  }
  main>.side>.panel,
  main>.side>.v4-advanced-tools{
    width:100%;
    max-width:100%;
    align-self:stretch;
  }
  .v4-aim-controls .aimbar>.small{display:none}
  /* The build badge must not cover the canvas or touch controls. */
  body>.v4-build-badge{
    position:static;
    display:inline-flex;
    margin:0 12px 14px;
    vertical-align:top;
    max-width:calc(100% - 24px);
  }
}
