/* Win98 hybrid chrome: real 98 geometry, the site's warm skins as colour schemes.
   Loaded after each page's inline styles so these rules win. */
@font-face{font-family:HzUI;src:url(fonts/ui.woff2) format("woff2"),url(fonts/ui.ttf) format("truetype");font-display:swap}
:root{
  /* 98's 4-tone bevel: outer-light, inner-light, inner-shadow, outer-dark.
     Derived from each skin's --lt/--dk so all 5 skins x 2 modes get it for free
     (data-theme/data-mode live on <html>, the same element as :root). */
  --lt2:color-mix(in srgb,var(--lt) 55%,var(--chrome));
  --dk2:color-mix(in srgb,var(--dk) 45%,#000);
  --ui-font:HzUI,"Pixelated MS Sans Serif",Tahoma,Verdana,sans-serif;
  --raised:inset -1px -1px var(--dk2),inset 1px 1px var(--lt),inset -2px -2px var(--dk),inset 2px 2px var(--lt2);
  --sunken:inset -1px -1px var(--lt),inset 1px 1px var(--dk2),inset -2px -2px var(--lt2),inset 2px 2px var(--dk);
}
[data-mode="dark"]{--dk2:color-mix(in srgb,var(--dk) 40%,#000)}

.win{border:0;padding:3px;box-shadow:var(--raised)}
.body{border:0;margin:2px 0 0;box-shadow:var(--sunken)}

/* titlebar SIZE stays the pages' own (bold 13px Verdana, padding 3px 5px, gap 6px, text-shadow);
   only the gradient direction and the caption buttons' bevels/glyphs are 98 */
.bar{background:linear-gradient(90deg,var(--title),var(--title2))}
.win:not(.hero) .bar{background:linear-gradient(90deg,var(--inact),var(--inact2))}
/* a lone window (404's dialog) is the focused one: keep it in active colours, as it was before the restyle */
main>.win:only-child .bar{background:linear-gradient(90deg,var(--title),var(--title2))}
/* no titlebar icon = no dot and no empty slot; the few windows that get an icon use .tico */
.bar .dot{display:none}
.bar .tico{width:16px;height:16px;flex:0 0 auto;align-self:center;display:block;image-rendering:pixelated}
.bar .ctrl{gap:3px}
.bar .ctrl b{width:17px;height:15px;border:0;font-size:0;background:var(--chrome);box-shadow:var(--raised);
  position:relative}
.bar .ctrl b:active{box-shadow:var(--sunken)}
/* 98 caption glyphs, drawn as pixel shapes in the ink colour */
.bar .ctrl b::before{content:"";position:absolute;inset:0;background:var(--ink);
  -webkit-mask:var(--g) 4px 4px/8px 7px no-repeat;mask:var(--g) 4px 4px/8px 7px no-repeat}
.bar .ctrl b.mn{--g:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 7' shape-rendering='crispEdges'%3E%3Crect x='1' y='5' width='6' height='2'/%3E%3C/svg%3E")}
.bar .ctrl b.mx{--g:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 9 9' shape-rendering='crispEdges'%3E%3Cpath d='M0 0h9v9H0zM1 2v6h7V2z' fill-rule='evenodd'/%3E%3C/svg%3E")}
/* the maximize glyph is drawn on a 9x9 grid: render it 1:1 or its 1px left edge drops out */
.bar .ctrl b.mx::before{-webkit-mask-size:9px 9px;mask-size:9px 9px;-webkit-mask-position:4px 3px;mask-position:4px 3px}
.bar .ctrl b.cl{--g:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 7' shape-rendering='crispEdges'%3E%3Cpath d='M0 0h2v1h1v1h2V1h1V0h2v1H7v1H6v1H5v1h1v1h1v1h1v1H6V6H5V5H3v1H2v1H0V6h1V5h1V4h1V3H2V2H1V1H0z'/%3E%3C/svg%3E")}

/* buttons share the 98 raised/pressed look */
.btn,.tb-skins .skins button,.tb-mode button,.start,.tasktab{border:0;box-shadow:var(--raised);font-family:var(--ui-font)}
.btn:active,.tb-skins .skins button:active,.tb-mode button:active,.start:active{box-shadow:var(--sunken)}
/* the active skin is marked with .on by the page script */
.tb-skins .skins button.on{box-shadow:var(--sunken)}
/* glitch-toy latched toggles (ghost) are marked .on; the inline rule drew them with border-color, which border:0 zeroes */
.gg-ctrls .btn.on{box-shadow:var(--sunken)}

/* taskbar */
.taskbar{border-top:0;box-shadow:inset 0 1px var(--lt2),inset 0 2px var(--lt)}
.start{background:var(--chrome);font:bold 13px var(--ui-font);padding:4px 8px 4px 5px}
.tasktab{box-shadow:var(--sunken);font:12px var(--ui-font)}
.tasktab .tb-ico{width:16px;height:16px;vertical-align:-3px;margin-right:4px;image-rendering:pixelated}
.tray{box-shadow:var(--sunken);border:0}
.clock{font-family:var(--ui-font)}

/* desktop icons: 32x32 sources at 2x, 98 labels (removes the old drop-shadow frame) */
.deskicons .ico{width:64px;height:64px;border:0;box-shadow:none;background:none}
.deskicons .lk{color:#fff;text-shadow:1px 1px 0 #000;font:12px var(--ui-font);padding:1px 2px}
.deskicons li:hover .lk,.deskicons li:focus-within .lk{background:var(--title);color:#fff;text-decoration:none;outline:1px dotted #fff}
.deskicons li:hover .ico,.deskicons li:focus-within .ico{filter:sepia(1) hue-rotate(-20deg) saturate(2) brightness(.8)}
@media(max-width:380px){.deskicons .ico{width:48px;height:48px}.deskicons .lk{font-size:11px}}

/* small phones: the glitch-toy button row already ran ~26px past its window body before this
   restyle (it never wraps); the 98 UI font stack is a touch wider, so tighten the row to keep
   it inside the window and off the page edge at 320px */
@media(max-width:380px){.gg-ctrls{gap:5px}.gg-ctrls .btn{padding:5px 7px}}
