/* <side-panel>'s rules (components/side-panel.js): the page links this file, so its first paint has them; the component adds it
   to any other root it's drawn in (light-styles.js). */
side-panel { display:block; }
/* The side panel's tabs: the one data-tab names shown (gear, scene); Toon (toon) over the Look in its place. */
#left .tab { display:none; }
#left[data-tab="gear"] .tab[data-tab="gear"] { display:block; }
#jewelRows, #lookSlots { display:none; } /* (the Doctor's: neck, rings and trinkets; the page shows them) */
#levelRows, #lookRows, #placeRows, #companyRows, #doctorFolds { display:none; } /* (the Doctor's alone: its level, look, place and company, in its folding sections) */
/* Toon, in the side panel in place of the Look: its title and a way back. */
#left.toon > .outfitsw, #left.toon > #rail { display:none; }
#left.toon > .tab[data-tab="appearance"] { animation:toonin .26s cubic-bezier(.3, .7, .2, 1); } /* it slides in over the Look */
@keyframes toonin { from { transform:translateX(-100%); } }
/* And out again: closed, it stays drawn over the Look until it has slid away (see setLeftTab). */
#left.toonout > .tab[data-tab="appearance"] { display:block; position:absolute; top:0; left:0; right:0; min-height:100%; z-index:3; background:var(--panel); pointer-events:none; animation:toonout .26s cubic-bezier(.3, .7, .2, 1) forwards; }
@keyframes toonout { to { transform:translateX(-100%); } }
@keyframes toonrise { from { opacity:0; transform:translateY(12px) scale(.98); } }
@keyframes toonsink { to { opacity:0; transform:translateY(12px) scale(.98); } }
@media (prefers-reduced-motion: reduce) { #left.toon > .tab[data-tab="appearance"] { animation:none; } #left.toonout > .tab[data-tab="appearance"] { display:none; } }
/* Panel */
#left { width:auto; }
/* The title and tab bar stay put at the top while the rows below scroll. */
#left > .outfitsw { position:sticky; top:0; z-index:3; background:var(--panel); } /* the Look switcher stays at the top as the panel scrolls (over the tabs, so its menu opens over them) */
#left > #rail { position:sticky; top:calc(var(--top-float) + var(--h-float) + 8px); padding-top:3px; z-index:2; box-shadow:0 0 0 8px var(--panel), -24px 0 0 8px var(--panel), 48px 0 0 8px var(--panel); } /* and the Gear and Scene tabs under it, in a band of the panel's colour all round, so the rows pass under them */
/* Fades over the panel's rows: under the stuck tabs once rows run beneath them, and at the foot while there are more below.
Drawn by the panel's frame (#sidebody), which doesn't scroll; --fade-top is where the tabs end (see the panel's scroll). */
#sidebody::before, #sidebody::after { content:''; position:absolute; left:0; right:0; height:36px; z-index:2; pointer-events:none; opacity:0; transition:opacity .2s; }
#sidebody::before { top:var(--fade-top, 0px); background:linear-gradient(var(--panel), transparent); } #sidebody.up::before { opacity:1; }
#sidebody::after { bottom:0; background:linear-gradient(transparent, var(--panel)); } #sidebody.down::after { opacity:1; }
#left[data-tab="scene"] .tab[data-tab="scene"], #left.toon > .tab[data-tab="appearance"] { display:block; }
#left.toon > .tab:not([data-tab="appearance"]) { display:none; } /* Toon over the Look's tab, which stays set beneath it */
/* Outfit switcher */
.outfitsw { position:relative; padding:var(--top-float) 16px 0; } /* (the switcher at --top-float, 16px in, as the floating buttons) */
/* Keyboard focus: an accent ring on whatever the keys are on. */
:where(#left) button:focus-visible { outline:2px solid var(--gold); outline-offset:-2px; } /* (under a component's own ring: side-rail.js) */
#left.nowlook #rail { --lookit:var(--bronze); --lookit-wash:var(--bronze-wash); --lookit-grad:var(--bronze-grad); } /* a Chronicle level on the model, not a Look's */
@media (min-width: 721px) and (min-height: 521px) {
  /* Toon, a panel floating over the Look, its shadow on the Look dimmed beneath it: what's being edited is the
     character (the page dims its other parts too, the model left bright). A click on the Look closes Toon. */
  #left.toon > .outfitsw { display:block; } #left.toon > #rail { display:flex; }
  #left.toon[data-tab="gear"] > .tab[data-tab="gear"], #left.toon[data-tab="scene"] > .tab[data-tab="scene"] { display:block; }
  #left.toon > .tab[data-tab="appearance"], #left.toonout > .tab[data-tab="appearance"] { position:absolute; top:0; left:0; right:auto; width:calc(100% - 28px); min-height:100%; z-index:5; background:var(--panel); border-right:1px solid var(--line); box-shadow:8px 0 20px #0009; } /* (the Council's try-on scene: a sheet in its panel) */
  :is(#left.toon, #left.toonout):not(.tryon *) > .tab[data-tab="appearance"] { top:10px; left:10px; right:10px; width:auto; min-height:calc(100% - 20px); border:1px solid var(--line-control); border-radius:var(--r-xl); box-shadow:0 0 0 1px #0006, 0 18px 48px 6px #000b; }
  #left.toon:not(.tryon *) > .tab[data-tab="appearance"] { animation-name:toonrise; } #left.toonout:not(.tryon *) > .tab[data-tab="appearance"] { animation-name:toonsink; } /* (rising into place and sinking away, not sliding in) */
  #left > :not(.tab[data-tab="appearance"]) { transition:filter .25s ease; } #left.toon > :not(.tab[data-tab="appearance"]) { filter:brightness(.4); }
  #rail, #left { min-width:0; overflow-x:hidden; } #rail { overflow-x:clip; } /* (clipped, not hidden, for the tabs: hidden made them scroll up and down, by the shade hung under them) */
}
@media (max-width: 720px), (max-height: 520px) {
  #msideX { position:absolute; top:calc(var(--top-float) + (var(--h-float) - 24px) / 2); right:10px; z-index:4; } /* (over the switcher's band, beside it) */ #left > #rail { margin-right:40px; } /* (centred on the Look switcher beside it; the Gear and Scene tabs end where the switcher does, so stuck to the top as the panel scrolls they stay clear of it) */
  #left .outfitsw { padding-right:40px; } /* room for × */
}
