  /* Dark native controls; scrollbars in the theme's line colour on a clear track. */
  html { color-scheme:dark; scrollbar-color:#383b40 transparent; }
  /* Design tokens and the floating buttons (.fbtn): purist.css, shared with the site's other pages. */
  * { box-sizing:border-box; }
  /* The app fills the viewport exactly; the columns scroll internally, the window never does. */
  html, :is(body, purist-app) { height:100%; overflow:hidden; }
  :is(body, purist-app) { margin:0; background:var(--bg); color:var(--text); font:var(--fs-base)/1.4 system-ui, sans-serif; display:flex; flex-direction:column; }
  /* (the controls' own look, select, button, input and button.primary: purist.css) */
  @keyframes pulse { 0%, 100% { box-shadow:0 0 0 0 color-mix(in srgb, var(--gold) 53%, transparent); } 50% { box-shadow:0 0 0 6px transparent; } }
  /* One explicit row so the columns (and the model area) get a definite height to fill. */
  /* overflow hidden: the closed drawer sits just outside the right edge and must not widen the
     page or let the browser scroll to it when it moves. */
  main { display:grid; grid-template-columns:260px 1fr; grid-template-rows:auto minmax(0, 1fr); flex:1; min-height:0; position:relative; overflow:hidden; }
  aside { background:var(--panel); overflow:auto; } /* no edge line: its own background, and the drawer's shadow, set the columns apart (lines met the bar's in T's) */
  .mobonly { display:none; } /* the phone layout's own controls (see the small-screen rules) */
  /* An iPhone only sends a click for a tap on something that looks clickable, so a tap beside an
     open menu never reached the page's close-on-click-elsewhere. With no cursor to see, everything is. */
  @media (hover: none) { :is(body, purist-app), :is(body, purist-app) * { cursor:pointer; } }
  /* The item column is a drawer that slides over the model area, so the viewer never changes
     size or position. Closed until a slot or appearance row asks for it. */
  aside.right { position:absolute; top:0; right:0; bottom:0; width:460px; z-index:5; box-shadow:-8px 0 24px #0008; transition:transform .28s ease; }
  main.drawer-closed aside.right { transform:translateX(100%); box-shadow:none; }
  #viewer { position:relative; min-height:0; overflow:hidden; }
  /* Small screens: the model alone. The gear and filter columns need a desktop to be useful,
     so phones and narrow windows get the viewer full-bleed with just the header. */
  @media (max-width: 720px), (max-height: 520px) {
    :root { --fs-xs:12px; --fs-sm:13px; --fs-md:14px; --fs-base:15px; } /* a tighter scale held at reading size: the fields are 16px here (smaller, and iOS zooms the page on them) */
    main { grid-template-columns:1fr; --side-w:min(66vw, 300px); } #subheader { grid-row:1; } #viewer { grid-row:2; } #chronCorner, #subheader #chron[empty] { display:none; } #subheader { flex-wrap:wrap; } #subheader #chron { order:3; flex:1 1 100%; margin-left:0; }
    /* Phones: the sidebar is a panel pulled out from the left over the model (Edit), and the item
       and option lists slide over it with Back; tapping the dimmed model puts it away. */
    #sidebody { position:absolute; top:0; bottom:0; left:0; width:var(--side-w); z-index:9; transform:translateX(-102%); transition:transform .28s ease, box-shadow .28s ease; box-shadow:8px 0 24px #000a; } :is(body, purist-app):not(.mside) #sidebody { box-shadow:none; } /* (put away, its shadow would still fall on the screen's left edge) */
    :is(body, purist-app).mside #sidebody { transform:none; }
    #sidebody > #left { height:100%; border-right:0; overflow-x:hidden; } /* (it scrolled sideways, cutting its rows' left edge) */
    /* A list is a sheet over the screen's lower part: the panel steps aside and the model fits in
       the room above, so what's tapped is seen on the character. */
    main aside.right { top:auto; bottom:0; left:0; right:0; width:auto; height:52vh; z-index:10; border-left:0; border-top:1px solid var(--line); border-radius:var(--r-xl) var(--r-xl) 0 0; box-shadow:0 -8px 24px #000a; transition:transform .28s ease; } /* (main: over the wider rule further down) */
    main.drawer-closed aside.right { transform:translateY(102%); }
    :is(body, purist-app).mside main:not(.drawer-closed) #sidebody { transform:translateX(-102%); box-shadow:none; }
    :is(body, purist-app).mside main:not(.drawer-closed) #mscrim { opacity:0; pointer-events:none; } /* (a tap on the model puts the sheet away, as anywhere outside it) */
    main:not(.drawer-closed) #viewer { align-self:start; height:calc(100% - 52vh); }
    main:not(.drawer-closed) #mlook { display:none; }
    main:not(.drawer-closed) #subheader { display:none; } /* the header and the character's bar give their room to the model while picking */
    /* An item list is a carousel: one row of cards to swipe through, each snapping into place
       (lists of choices with headings stay a column). The layout switch has nothing to switch. */
    .mobonly { display:revert; }
    :is(body, purist-app).mside #mscrim { opacity:1; pointer-events:auto; }
    :is(body, purist-app).mside main.drawer-closed #mscrim { background:none; } :is(body, purist-app).mside #mlook { visibility:hidden; } :is(body, purist-app).mside main.drawer-closed #viewer { margin-left:var(--side-w); } /* the model in the room beside the panel, to see the Look change (a tap there still puts the panel away) */
    :is(body, purist-app).mside #subheader { opacity:.45; } /* (beside the panel too, a tap only puts it away: see mside) */
    /* The filters stand beside the model while a list is open (see placeFilters): a column on the
       left above the sheet, always open, the model fitted in the rest. */
    main > .fbox { position:absolute; top:0; left:0; width:58vw; bottom:52vh; z-index:6; overflow:auto; overscroll-behavior:contain; border:0; border-right:1px solid var(--line); border-radius:0; background:var(--panel); box-shadow:none; } /* the sheet's own panel, carried up beside the model */
    main.fside aside.right { border-radius:0; }
    /* A list of the character's own (Toon's, or a picker's) has no filters: the list itself takes the left column,
       as rows (the picture, then its name), and the model stands beside it at full height. */
    main.fside:has(> aside.right.picking) > .fbox { display:none; }
    main.fside:has(> aside.right.picking) aside.right { top:0; bottom:0; right:auto; width:58vw; height:auto; border-top:0; border-right:1px solid var(--line); box-shadow:none; }
    main.fside:has(> aside.right.picking) #viewer { height:auto; align-self:stretch; }
    main.fside #viewer { margin-left:58vw; }
    main > .fbox { overflow-x:hidden; }
    /* The sheet's card row takes all the room under the search, each picture filling its card. */
    aside.right.cards { display:flex; flex-direction:column; overflow:hidden; }
    aside.right.cards > selection-panel { flex:1; min-height:0; }
    aside.right.cards #results { flex:1; min-height:0; } /* (the row's cards as tall as the room) */
    main.fside:has(> aside.right.picking) aside.right #results { overflow-y:auto; overscroll-behavior:contain; } /* a picker's rows scroll in the list itself, the sheet not scrolling */
  }
  /* While the views slide, the canvas keeps the size it had and rides centred in the moving
     column (it's transparent but for the character; the backdrop is the page's): resizing a
     WebGL canvas every frame was too slow. It takes the new size once the slide ends. */
  main.sliding #model canvas { position:relative; left:50%; width:var(--slide-w) !important; transform:translateX(-50%); }
  :is(body, purist-app).dropping::after { content:'Drop Purist_Chronicle.lua or your WTF folder to import your Chronicle'; position:fixed; inset:12px; z-index:60; display:flex; align-items:center; justify-content:center; border:2px dashed var(--gold); border-radius:var(--r-xl); background:color-mix(in srgb, var(--bg) 80%, transparent); color:var(--gold); font-size:var(--fs-lg); pointer-events:none; }
  .q0{color:var(--q0)} .q1{color:var(--q1)} .q2{color:var(--q2)} .q3{color:var(--q3)} .q4{color:var(--q4)} .q5{color:var(--q5)}
  #modelBar { position:absolute; left:50%; bottom:14px; transform:translateX(-50%); z-index:4; } /* (its pill: model-bar.js) */
  /* Startup: the panels are drawn piece by piece as the data files and the Battle.net check
     arrive, so they stay hidden until the first full render, then fade in together. */
  purist-header > *, #left, #modelBar { transition:opacity .3s ease; }
  :is(body, purist-app).booting purist-header > *, :is(body, purist-app).booting #left, :is(body, purist-app).booting #modelBar { opacity:0; }
  /* The council page's try-on scene (purist-scene.js): the viewer alone, from its first paint (tryloading: purist-scene.js). */
  :is(body, purist-app):is(.tryon, .tryloading) > purist-header, :is(body, purist-app):is(.tryon, .tryloading) :is(#chronCorner, #mouseHelp, #modelBar, #mlook, #tip, #welcome, #start) { display:none !important; }
  /* Its character block top left over the viewer, opening Toon as a sidebar, and Toon's lists beside it. */
  :is(body, purist-app).tryon #subheader { position:fixed; left:16px; top:16px; z-index:6; padding:10px 14px; border:0; border-radius:var(--r-lg); background:#0f1011d9; }
  :is(body, purist-app).tryon #subheader > :not(#ident) { display:none !important; }
  :is(body, purist-app).tryon #left { display:none; }
  :is(body, purist-app).tryon #sidebody { overflow:visible; }
  /* The scene's one side panel, over the scene's left: Toon (sliding in or out) or the tabard designer. */
  :is(body, purist-app).tryon #left:is(.toon, .toonout), :is(body, purist-app).tryon.designing #left { display:block; position:fixed !important; left:0; top:0; width:320px; height:100vh !important; max-height:none; z-index:5; overflow-y:auto; padding-top:104px; box-sizing:border-box; background:var(--panel); }
  :is(body, purist-app).tryon:not(.designing) #left:is(.toon, .toonout) > :not(.tab[data-tab="appearance"]), :is(body, purist-app).tryon.designing #left.toon > :not(.tab[data-tab="appearance"]) { display:none !important; } :is(body, purist-app).tryon:not(.designing) #left.toonout:not(.toon) { background:none; pointer-events:none; } /* (the scene's left is Toon alone, sliding in or out: never the Look's gear beneath) */ :is(body, purist-app).tryon #left > .tab[data-tab="appearance"] { position:relative; top:auto; left:auto; width:auto; right:auto; min-height:0; } /* (in the panel's flow, under the character's block, which the panel's padding clears) */
  :is(body, purist-app).tryon.guest #left #toon::part(name) { display:none; } /* (a guest's stand-in has no name of theirs) */
  :is(body, purist-app).tryon.designing #left:not(.toon) > :not(.tab[data-tab="gear"]) { display:none !important; } :is(body, purist-app).tryon.designing #left > .tab[data-tab="gear"] > :not(#tabardBox) { display:none; } /* (Toon opened over the designer has the panel until it closes) */
  /* The tabard designer hangs as a banner at the scene's right, over the Council's poll panel while a
     design is made (council.html): as tall as its rows, then cut to a point, a little of the scene showing
     on its right. It is dressed as the tabard being made (renderTabardRows: --cloth, --trim): its cloth the
     design's background, deepened so the rows read, with soft folds, its edge the border's colour all the
     way round, and its emblem under the rows. Its lists open beside it; the model and scenery stay put. */
  @media (min-width: 761px) {
    :is(body, purist-app).tryon.designing #sidebody > #left:not(.toon) { left:auto; right:16px; bottom:auto; width:300px; height:auto !important; max-height:calc(100vh - 12px); padding:21px 5px 184px; isolation:isolate; clip-path:polygon(0 0, 100% 0, 100% calc(100% - 44px), 50% 100%, 0 calc(100% - 44px));
      background:var(--trim, var(--line-control)); }
    :is(body, purist-app).tryon.designing #sidebody > #left:not(.toon)::before { content:''; position:absolute; inset:5px; z-index:-1; clip-path:polygon(0 0, 100% 0, 100% calc(100% - 41px), 50% 100%, 0 calc(100% - 41px));
      background:var(--emblem, none) center bottom 56px / 104px no-repeat, linear-gradient(90deg, #0000 0 10%, #ffffff07 17%, #0000 25%, #00000024 34%, #0000 44%, #ffffff06 55%, #0000 64%, #00000022 74%, #0000 85%, #ffffff07 93%, #0000), color-mix(in srgb, var(--cloth, var(--panel)) 55%, #0b0c0d); }
    :is(body, purist-app).tryon.designing:not(.closing):not(:has(#left.toon)) #viewer > :is(#skyline, #model) { translate:none; }
    :is(body, purist-app).tryon.designing:not(:has(#left.toon)) main:not(.drawer-closed) aside.right { left:auto; right:316px; }
    :is(body, purist-app).tryon.designing #sidebody > #left:not(.toon) { animation-name:bannerIn; } :is(body, purist-app).tryon.designing.closing #sidebody > #left:not(.toon) { animation-name:bannerOut; } /* (it comes down from the top, and goes back up) */
  }
  @keyframes bannerIn { from { transform:translateY(-100%); } } @keyframes bannerOut { to { transform:translateY(-100%); } }
  /* On a phone the scene's panel (Toon, the designer, their lists) is a sheet from the bottom, the character above it (the page gives the scene the whole screen meanwhile: council.html) */
  @media (max-width: 760px) {
    :is(body, purist-app).tryon #left:is(.toon, .toonout), :is(body, purist-app).tryon.designing #left { top:auto; bottom:0; width:100%; height:56vh !important; padding-top:8px; border-radius:var(--r-lg) var(--r-lg) 0 0; border-top:1px solid var(--line); }
    :is(body, purist-app).tryon main:not(.drawer-closed) aside.right { left:0 !important; top:auto !important; bottom:0; width:100% !important; height:56vh !important; z-index:6 !important; border-left:0; border-top:1px solid var(--line); border-radius:var(--r-lg) var(--r-lg) 0 0; }
    :is(body, purist-app).tryon.designing:not(.closing) #viewer > #model, :is(body, purist-app).tryon:has(#left.toon) #viewer > #model { translate:0 -24vh !important; } :is(body, purist-app).tryon.designing:not(.closing) #viewer > #skyline, :is(body, purist-app).tryon:has(#left.toon) #viewer > #skyline { translate:none !important; } /* (the floor, ground and skyline follow the model's canvas where it is: petPanes.toScreen) */
    :is(body, purist-app).tryon #sidebody { transform:none !important; box-shadow:none; width:0; z-index:auto; } :is(body, purist-app).tryon main #viewer { margin-left:0 !important; } :is(body, purist-app).tryon #mscrim, :is(body, purist-app).tryon #msideX { display:none !important; } :is(body, purist-app).tryon #subheader { opacity:1 !important; display:flex !important; } /* (not the site's phone panel: the sheet is the scene's own) */
    :is(body, purist-app).tryon.designing #left { animation-name:sheetIn; } :is(body, purist-app).tryon.designing.closing #left { animation-name:sheetOut; }
    :is(body, purist-app).tryon #left.toon #toon::part(head) { display:block; position:sticky; top:0; height:0; padding:0; z-index:2; } :is(body, purist-app).tryon #left.toon #toon::part(title) { display:none; } :is(body, purist-app).tryon #left.toon #toon::part(close) { display:block; position:absolute; right:12px; top:0; width:28px; height:28px; } /* (the sheet's own ×, in its corner as it scrolls) */
    :is(body, purist-app).tryon #left.toon > .tab[data-tab="appearance"] { animation-name:sheetIn; } :is(body, purist-app).tryon #left.toonout > .tab[data-tab="appearance"] { animation-name:sheetOut; }
    :is(body, purist-app).tryon #subheader { left:12px; top:12px; padding:6px; } :is(body, purist-app).tryon #ident { margin:0; padding:0; gap:0; } :is(body, purist-app).tryon #ident::part(who) { display:none; } /* (the character's portrait alone, the button that opens Toon, in the corner over the scene) */
  }
  /* Wider screens: Toon floats under the character's block, as the main page's does, a card the height of its rows (scrolling
     past the window's), its shadow over the scene; the scene's frame around it is clear. */
  @media (min-width: 761px) {
    :is(body, purist-app).tryon:not(.designing) #sidebody > #left:is(.toon, .toonout) { inset:100px auto auto 16px; width:320px; height:auto !important; padding:0; overflow:visible; background:none; } /* (#sidebody: over the side panel's own inset) */
    :is(body, purist-app).tryon:not(.designing) #left:is(.toon, .toonout) > .tab[data-tab="appearance"] { position:relative; top:0; left:0; width:auto; min-height:0; max-height:calc(100vh - 116px); overflow-y:auto; scrollbar-width:thin; scrollbar-color:#383b40 transparent;
      background:var(--panel); border:1px solid var(--line-control); border-radius:var(--r-xl); box-shadow:0 0 0 1px #0006, 0 18px 48px 6px #000b; animation-name:toonrise; }
    :is(body, purist-app).tryon:not(.designing) #left.toonout > .tab[data-tab="appearance"] { animation-name:toonsink; }
    :is(body, purist-app).tryon:not(.designing):has(#left.toon) main:not(.drawer-closed) aside.right { left:352px; top:100px; bottom:16px; height:auto; border:1px solid var(--line-control); border-radius:var(--r-xl); box-shadow:0 0 0 1px #0006, 0 18px 48px 6px #000b; scrollbar-width:thin; scrollbar-color:#383b40 transparent; } /* (its lists beside it, floating too) */
  }
  /* A phone's character sheet (toonsheet: index.js), on the main page and in the try-on scene: the character above, then
     Toon's name and its parts as one row of chips, then the part's choices, all of them at once (as specific as the
     try-on's sheet rules above, which it replaces while open). */
  @media (max-width: 720px), (max-height: 520px) {
    :is(body, purist-app).toonsheet { --ts-list:36vh; --ts-head:94px; }
    :is(body, purist-app).toonsheet:has(#sceneChars:not([hidden])) { --ts-head:140px; } #sceneChars[layout="header"] { padding:0 16px 6px; } /* (the try-on's Characters too) */
    :is(body, purist-app).toonsheet #subheader, :is(body, purist-app).toonsheet #sceneCharsHead, :is(body, purist-app).toonsheet #mscrim, :is(body, purist-app).toonsheet #rail, :is(body, purist-app).toonsheet main > .fbox, :is(body, purist-app).toonsheet bug-report { display:none !important; }
    :is(body, purist-app).toonsheet #sidebody { position:absolute; top:auto !important; bottom:var(--ts-list); left:0; right:0; width:auto !important; height:var(--ts-head) !important; transform:none !important; transition:none; box-shadow:none; z-index:11; }
    :is(body, purist-app).toonsheet #sidebody > #left { position:static !important; display:block; width:auto !important; height:100% !important; padding:0 !important; overflow:hidden !important; border:0; border-top:1px solid var(--line); border-radius:var(--r-xl) var(--r-xl) 0 0; background:var(--panel); animation:none !important; }
    :is(body, purist-app).toonsheet #sidebody > #left > .tab[data-tab="appearance"] { animation:none !important; }
    :is(body, purist-app).toonsheet main:not(.drawer-closed) aside.right { display:block; position:absolute; top:auto !important; bottom:0 !important; left:0 !important; right:0 !important; width:auto !important; height:var(--ts-list) !important; transform:none; z-index:10 !important; border:0; border-radius:0; box-shadow:none; background:var(--panel); overflow-y:auto; }
    :is(body, purist-app).toonsheet:not(.tryon) main #viewer { align-self:start; height:calc(100% - var(--ts-list) - var(--ts-head)) !important; margin-left:0 !important; }
    :is(body, purist-app).toonsheet.tryon #viewer > #model { translate:0 calc((var(--ts-list) + var(--ts-head)) / -2) !important; }
    :is(body, purist-app).toonsheet.tryon.lowvote { --ts-list:calc(var(--low) - var(--ts-head)); } :is(body, purist-app).toonsheet.tryon.lowvote:has(#left) #viewer > #model { translate:calc(var(--cover, 0px) / -2) calc(var(--low, 0px) / -2) !important; } /* (over a phone's vote: the sheet takes the vote's cards' place, the scene as it was) */
  }
  @keyframes sheetIn { from { transform:translateY(100%); } } @keyframes sheetOut { to { transform:translateY(100%); } }
  #sceneChars { padding:6px 16px 10px; } #sceneChars[hidden] { display:none; } :is(body, purist-app).tryon #left #toon::part(head) { display:none; } /* (the character's block above opens and closes it) */ /* (Toon's Characters in the scene: in line with its rows) */
  :is(body, purist-app).tryon.designing #left { animation:designIn .22s ease-out; } :is(body, purist-app).tryon.designing.closing #left { animation:designOut .18s ease-in forwards; }
  @keyframes designIn { from { transform:translateX(-100%); } } @keyframes designOut { to { transform:translateX(-100%); } }
  /* The scene moves over by half the sidebar, so the participant stays in the middle of what's left in view. */
  :is(body, purist-app).tryloading :is(#subheader, #model, #left) { visibility:hidden; } /* (until the try-on scene's character is the poll's: tryOn) */
  :is(body, purist-app).tryon #viewer > :is(#skyline, #model) { transition:translate .22s ease-out; }
  :is(body, purist-app).tryon #viewer > #model { translate:calc(var(--cover, 0px) / -2) calc(var(--low, 0px) / -2); } /* (centred in what the Council's panel leaves of the scene: its cover, and its vote on a phone: low) */
  :is(body, purist-app).tryon.designing:not(.closing) #viewer > :is(#skyline, #model), :is(body, purist-app).tryon:has(#left.toon) #viewer > :is(#skyline, #model) { translate:160px 0; } /* (and while Toon is open; the floor and the horizon follow the model's canvas: petPanes.toScreen) */
  body.tryon:has(#left.toon) #viewer > #model { translate:calc(160px - var(--cover, 0px) / 2) 0; }
  :is(body, purist-app).tryon.designing:not(.closing) main:not(.drawer-closed) #viewer > :is(#skyline, #model), :is(body, purist-app).tryon:has(#left.toon) main:not(.drawer-closed) #viewer > :is(#skyline, #model) { translate:360px 0; } /* (a list open beside the panel: half of both) */
  :is(body, purist-app).tryon aside.right { display:none; }
  :is(body, purist-app).tryon main { --dw:400px; } /* (the scene's list, as wide while it slides open as once open: main.sliding) */
  :is(body, purist-app).tryon main:not(.drawer-closed) aside.right { display:block; position:fixed; left:320px; top:0; bottom:0; width:var(--dw); height:100vh; z-index:5; background:var(--panel); border-left:1px solid var(--line); } /* (stacked, as the site's: its search over its list) */
  :is(body, purist-app).tryon main:not(.drawer-closed) aside.right { overflow-y:auto; overscroll-behavior:contain; } :is(body, purist-app).tryon #panel { --panel-head-bg:var(--panel); } /* (the panel scrolls, as the site's, its search staying; a list given the panel's height would squash its rows to nothing) */
  :is(body, purist-app).tryon main { display:block; } :is(body, purist-app).tryon #viewer { position:fixed; inset:0; }
  /* Offscreen renderer for thumbnails */
  /* The viewer writes an inline position:relative onto its container; the stage must stay
     out of the page flow or it steals height from the layout. */
  #thumbStage { position:fixed !important; left:-2000px; top:0; width:512px; height:512px; }
  #choiceStage { position:fixed !important; left:-3000px; top:0; width:480px; height:1100px; } /* tall: a whole character, with a head big enough to crop */
  #portraitStage { position:fixed !important; left:-2000px; top:600px; width:768px; height:768px; }

  /* ---------- Layout: header, subheader, then rail | panel | viewer (design handoff 4a) ---------- */
  /* No character yet, or one being made: the character's bar is shut (char-bar.js opens it with the side columns). */
  :is(body, purist-app).fresh #subheader, :is(body, purist-app).creating #subheader, :is(body, purist-app).subIn #subheader { overflow:hidden; }
  :is(body, purist-app).fresh #subheader, :is(body, purist-app).creating #subheader { max-height:0; padding-top:0; padding-bottom:0; border-bottom-width:0; }
  /* The Chronicle open: the whole bar turns bronze, the timeline's colour. */
  main[data-view="journal"] #subheader { background:var(--bronze-bg); border-bottom-color:var(--bronze-line); }
  main[data-view="journal"] #chronCorner, :is(body, purist-app).fresh #chronCorner, :is(body, purist-app).creating #chronCorner { display:none; }
  /* Transmog on, the Doctor's panel shows looks: its switch and the Gear and Scene tabs in Lookit's pink. */
  main.doctoring.tm-on[data-view="journal"] #rail { --lookit:var(--lookit-pink); --rail-on-bg:var(--lookit-pink-wash); } /* (side-rail.js's tab on: --lookit its colour, --rail-on-bg its ground) */
  /* Someone else's Chronicle, read-only: nothing to import, make, correct, share or remove. */
  :is(body, purist-app).visiting :is(#imp, #newChar, #charMenuBtn, #more) { display:none; }
  main.doctoring[data-view="journal"] :is(#jewelRows, #lookSlots) { display:block; } /* (the Doctor's: neck, rings and trinkets; the level's looks) */
  main.doctoring[data-view="journal"] :is(#levelRows, #lookRows, #placeRows, #companyRows, #doctorFolds) { display:block; }
  main.doctoring[data-view="journal"] :is(#sceneRows, #emotesHead, #emotes) { display:none; } /* (sceneRows' parts are in the sections; emotes correct nothing) */
  /* Desktop: columns journal | gear panel | model. The views open and close them: the Chronicle
     closes the panel and opens its column in the same place on the left, Lookit the other way round,
     and the model's column beside them widens and narrows. Closing
     columns keep their contents' width (clipped, not squashed) and are hidden once shut. */
  @media (min-width: 721px) and (min-height: 521px) {
    main { grid-template-rows:auto minmax(0, 1fr); grid-template-columns:0px var(--pw) 0px 1fr 0px; transition:grid-template-columns .36s cubic-bezier(.3, .7, .2, 1); }
    main { --pw:330px; --dw:clamp(360px, 30vw, 520px); } /* the side panel's width (camera.js's room reads it too), the selection drawer's */
    main:not(.drawer-closed) { grid-template-columns:0px var(--pw) var(--dw) 1fr 0px; } /* (the fifth column is the Doctor's panel, see below: every layout has five, so a change slides) */
    main[data-view="journal"] { grid-template-columns:0px 0px 0px 1fr 0px; } /* a Chronicle level shown: the panel slides away, the model and its paper doll take the room */ /* the drawer opens from the left, beside the panel, and the character glides over */
    @media (max-width: 1000px) { main:not(.drawer-closed):not([data-view="journal"]) { grid-template-columns:0px 0px var(--dw) 1fr 0px; } } /* a narrow window: an open list takes the panel's place, beside the model, closed with its × */
    #subheader { grid-column:1 / -1; grid-row:1; min-width:0; } #viewer { grid-column:4; grid-row:2; }
    #sidebody { display:block; grid-column:2; grid-row:2; position:relative; overflow:hidden; min-width:0; }
    #sidebody > #left { position:absolute; inset:0; border:0; transition:transform .3s cubic-bezier(.3, .7, .2, 1), visibility 0s; }
    #sidebody > #left { scrollbar-width:none; } #sidebody > #left::-webkit-scrollbar { display:none; } /* (no bar beside the rows: it doubled their 16px inset; the wheel and touch scroll without it, as on a phone) */
    main[data-view="journal"] #left { transform:translateX(-100%); visibility:hidden; transition:transform .3s cubic-bezier(.3, .7, .2, 1), visibility 0s .3s; }
    /* The Doctor on (journal.doctoring): the panel stays, in the fifth column on the model's right (the model keeps
       its column, so it glides rather than jumps), its Gear and Scene editing the level shown, in the Chronicle's
       white rather than Lookit's pink. It's shown as the column opens, not slid, and goes as the Doctor does. */
    main.doctoring[data-view="journal"] { grid-template-columns:0px 0px 0px 1fr var(--pw); } main.doctoring[data-view="journal"]:not(.drawer-closed) { grid-template-columns:0px 0px var(--dw) 1fr var(--pw); }
    main.doctoring[data-view="journal"] #sidebody { grid-column:5; }
    main.doctoring[data-view="journal"] #left { transform:none; visibility:visible; transition:none; }
    main.doctoring[data-view="journal"] :is(#sidebody, aside.right) { --lookit:var(--doctor); --lookit-wash:var(--doctor-wash); --lookit-grad:var(--doctor-grad); }
    /* and the panel itself white: a light ground, dark text and lines, the Doctor's marks in black there; the commonest
       item qualities darkened to read on it (white names, the bright green) */
    main.doctoring[data-view="journal"] #sidebody {
      --panel:#fff; --s-raised:color-mix(in srgb, #000 4%, #fff); --s-control:color-mix(in srgb, #000 8%, #fff); --s-hover:color-mix(in srgb, #000 11%, #fff);
      --s-sunk:color-mix(in srgb, #000 7%, #fff); --s-field:color-mix(in srgb, #000 5%, #fff);
      --line:color-mix(in srgb, #000 10%, #fff); --line-control:color-mix(in srgb, #000 16%, #fff); --line-strong:color-mix(in srgb, #000 24%, #fff); --line-hover:color-mix(in srgb, #000 34%, #fff);
      --text:color-mix(in srgb, #000 82%, #fff); --text-strong:#000; --muted:color-mix(in srgb, #000 52%, #fff); --faint:color-mix(in srgb, #000 32%, #fff);
      --doctor:#000; --doctor-wash:color-mix(in srgb, #000 6%, transparent); --doctor-grad:linear-gradient(180deg, color-mix(in srgb, #000 65%, #fff) 0%, #000 100%);
      --q1:color-mix(in srgb, #000 82%, #fff); --q2:color-mix(in srgb, #1eff00 55%, #000); color:var(--text); }
    main.doctoring[data-view="journal"] #sidebody > #left { background:var(--panel); }
    /* No tabs in the Doctor's panel: its Gear, then its Scene under it, in one list. */
    main.doctoring[data-view="journal"] #left > #rail { display:none; }
    main.doctoring[data-view="journal"] #left .tab { display:none; } main.doctoring[data-view="journal"] #left :is(.tab[data-tab="gear"], .tab[data-tab="scene"]) { display:block; }
    main.doctoring[data-view="journal"] #sidebody :is(.q1, .q1 a) { color:var(--q1) !important; } main.doctoring[data-view="journal"] #sidebody :is(.q2, .q2 a) { color:var(--q2) !important; } /* (over Wowhead's tooltip sheet, which sets quality colours !important on its links) */
    main aside.right { position:relative; grid-column:3; grid-row:2; width:auto; min-width:0; overflow:hidden auto; transform:none; box-shadow:none; border-left:0; border-right:0; transition:none; }
    #selMark { position:absolute; z-index:6; width:4px; border-radius:var(--r-pill); background:var(--gold); opacity:.85; pointer-events:none; } #selMark.lookit { background:var(--lookit); } #selMark[hidden] { display:none; } /* (the selected card's place on the drawer's scrollbar track) */
    aside.right { scrollbar-gutter:stable; } main.sliding aside.right > * { min-width:calc(var(--dw) - var(--sbw, 0px)); } /* (its contents keep the width they'll have, a scrollbar's room always kept, as it opens) */
    main.drawer-closed aside.right { transform:none; visibility:hidden; transition:visibility 0s .36s; } /* (the width rule further down is for small screens' overlay; this one is the column's) */ /* the character at the top of the side column, whichever view's */
    main.drawer-closed #filters { visibility:hidden; } /* (the filters' panel beside the list goes as it starts to close, not after its slide) */
    #subheader { gap:14px; position:relative; z-index:7; } /* (above the columns under it, so the More menu opens over them) */
    main.sliding #left > .tab, main.sliding #left > .outfitsw { min-width:var(--slide-left, calc(var(--pw) - 1px)); } main.sliding #left > #rail { min-width:calc(var(--slide-left, calc(var(--pw) - 1px)) - 32px); } /* (they keep the width they had as the panel slides, its scrollbar left out; the tabs don't wrap: side-rail.js) */
    /* No character yet (the start card) or one being made: the side columns are shut, and slide in
       once there's a character, the same way the views swap. */
    :is(body, purist-app).fresh main, :is(body, purist-app).creating main, :is(body, purist-app).fresh main[data-view="journal"], :is(body, purist-app).creating main[data-view="journal"] { grid-template-columns:0px 0px 0px 1fr 0px; }
    :is(body, purist-app).fresh #rail, :is(body, purist-app).fresh #left, :is(body, purist-app).creating #rail, :is(body, purist-app).creating #left { visibility:hidden; padding-left:0; padding-right:0; border:0; transition:visibility 0s .36s; }
  }
  @media (prefers-reduced-motion: reduce) { main, #rail, #left, #sidebody > * { transition:none !important; } }
  /* Rail */
  /* The Wardrobe's sections: a bar of tabs under its title. */
  #rail { margin:8px 16px; } /* inset as the floating buttons are, under the Look (side-rail.js draws the tabs) */
  :is(body, purist-app).fresh #mouseHelp, :is(body, purist-app).creating #mouseHelp { display:none; }
  /* Drawer */
  aside.right { width:clamp(360px, 30vw, 520px); } /* wider on a wide screen, where the model has room to spare */
  :is(body, purist-app).booting #subheader > *, :is(body, purist-app).booting #rail { opacity:0; }
  #subheader > *, #rail { transition:opacity .3s ease; }
  @media (max-width: 720px), (max-height: 520px) {
    main { grid-template-columns:1fr; }
    purist-header { padding:0 10px; gap:8px; flex-wrap:nowrap; }
    #subheader { padding:8px 10px; gap:10px; } #ident { flex:1 1 0; margin-left:-4px; padding-left:6px; } #toon::part(close) { display:none; } /* (Toon opens in the panel, which has its own ×) */ /* (sharing its row with the Purist mark; its hover inside the screen) */
    #more { display:none; }
    main[data-view="journal"] #mlook { display:none; } /* the Chronicle is a view, not for editing */
    #emotesHead, #emotes { display:none; } /* played with the panel over the model, they'd go unseen */
    #sidebody > #left, main aside.right { scrollbar-width:none; } #sidebody > #left::-webkit-scrollbar, main aside.right::-webkit-scrollbar { display:none; } /* (a bar over the panel's edge sat on its × and menus; touch and the wheel scroll without it) */
    input[type=text], input[type=search], input[type=number], input:not([type]), textarea, select { font-size:var(--fs-lg) !important; } /* iPhone zooms in on a field with smaller text */
    /* The characters are a menu (☰) instead of the strip: a list under the header, each portrait
       with its name, grouped by game, then New character. */
    purist-header { position:relative; }
    :is(body, purist-app) > purist-header { display:none; } /* its logo, characters and Battle.net are in the ☰ menu in the character's bar (see placeHeader) */
    #subheader { position:relative; }
    #imp { display:none; } /* addon files and strings come from a computer */
    :is(body, purist-app).charmenu #charMenu { visibility:visible; opacity:1; transition:opacity .25s ease; }
    :is(body, purist-app).charmenu #charMenuPanel { transform:none; }
    /* The tips describe the panel's tabs: while it's out, at the bottom of the screen over it and
       its lists (see phoneTip). */
    :is(body, purist-app) > #tip { position:fixed; left:12px; right:12px; bottom:12px; top:auto; width:auto; max-width:440px; z-index:30; }
    :is(body, purist-app):not(.mside) > #tip { display:none; }
    }
  /* The floating layer: the item list and its cards, dropdowns and menus, the rack flyout and
     toasts, a grey a step from the base. */
  aside.right { background:var(--bg); border-color:var(--line-control); }
  aside.right::after { content:''; display:block; position:sticky; bottom:0; height:36px; margin-top:-36px; background:linear-gradient(transparent, var(--bg)); opacity:0; transition:opacity .2s; pointer-events:none; } aside.right.more::after { opacity:1; } /* (and at the foot while there are more below, as the side panel's) */
  :is(body, purist-app).creating #left, :is(body, purist-app).creating #rail, :is(body, purist-app).creating #subheader, :is(body, purist-app).creating #tip, :is(body, purist-app).creating #welcome, :is(body, purist-app).creating aside.right { visibility:hidden; }
  :is(body, purist-app).fresh #model, :is(body, purist-app).fresh #modelBar, :is(body, purist-app).fresh #left, :is(body, purist-app).fresh #rail, :is(body, purist-app).fresh #subheader, :is(body, purist-app).fresh #tip, :is(body, purist-app).fresh #charStrip, :is(body, purist-app).fresh aside.right { visibility:hidden; }
  /* Toon open (wider screens): the page's other controls dim, so the character is what's being edited; the model stays bright. */
  @media (min-width: 721px) and (min-height: 521px) {
    :is(body, purist-app):not(.tryon) :is(purist-header, #subheader > :not(#ident), #chronCorner, #mouseHelp, #modelBar) { transition:filter .25s ease; }
    :is(body, purist-app):not(.tryon, .fresh, .creating):has(#left.toon) :is(purist-header, #subheader > :not(#ident), #chronCorner, #mouseHelp, #modelBar) { filter:brightness(.4); }
  }
