/* ==========================================================================
   cfworx.tech: the desktop. Hand-written, no framework, no build tools.

   The whole site is one late-90s desktop: wallpaper and icons, windows,
   a taskbar and a Start menu. Measurements follow the classic
   "Windows Standard" scheme: silver #c0c0c0 faces, two-pixel bevels made
   of white / light grey / dark grey / black, an 18px navy title bar, a
   28px taskbar. On phones the same parts are simply bigger (see the
   "small screens" section at the end).

   This file is the desktop's chrome. The reading styles for notes are in
   content.css; both are joined into one stylesheet by partials/head.html.

   The site's Content-Security-Policy allows no inline styles and no
   data: images, so every little arrow and glyph is a real file in
   /icons/ (drawn by scripts/win98/make_icons.py).
   ========================================================================== */

:root {
  --face:      #c0c0c0;   /* button / window face */
  --hilight:   #ffffff;
  --light:     #dfdfdf;
  --shadow:    #808080;
  --dkshadow:  #0a0a0a;
  --desk:      #008689;   /* the wallpaper's own teal */
  --navy:      #000080;   /* title bars, selection */
  --navy2:     #1084d0;   /* right end of the title-bar gradient */
  --tip:       #ffffe1;
  --window:    #ffffff;
  --gray-text: #808080;

  --ui-font: "MS Sans Serif", "Microsoft Sans Serif", Tahoma, "Segoe UI", Arial, "Liberation Sans", sans-serif;
  --ui:      12px;        /* chrome text */
  --row:     20px;        /* menu row */
  --title-h: 18px;
  --btn-h:   23px;
  --task-h:  28px;
  --px:      1;           /* icon zoom (2 on phones) */
  --full-h:  100vh;       /* the screen's height; 100dvh where supported (below) */
  --zoom:    1;           /* whole-desktop magnification, see "desktop size" below */

  /* bevels: outer then inner, bottom-right then top-left */
  --raised: inset -1px -1px var(--dkshadow), inset 1px 1px var(--hilight), inset -2px -2px var(--shadow), inset 2px 2px var(--light);
  --window-frame: inset -1px -1px var(--dkshadow), inset 1px 1px var(--light), inset -2px -2px var(--shadow), inset 2px 2px var(--hilight);
  --pressed: inset -1px -1px var(--hilight), inset 1px 1px var(--dkshadow), inset -2px -2px var(--light), inset 2px 2px var(--shadow);
  --sunken: inset -1px -1px var(--hilight), inset 1px 1px var(--shadow), inset -2px -2px var(--light), inset 2px 2px var(--dkshadow);
  --status: inset -1px -1px var(--hilight), inset 1px 1px var(--shadow);
}

@supports (height: 100dvh) { :root { --full-h: 100dvh; } }

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html { height: 100%; -webkit-text-size-adjust: 100%; background: var(--desk); }

body {
  margin: 0;
  height: 100%;
  zoom: var(--zoom);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--desk);
  color: #000;
  font: var(--ui)/1.25 var(--ui-font);
  -webkit-tap-highlight-color: transparent;
}

img { image-rendering: pixelated; }

/* ---- desktop size -----------------------------------------------------------
   Everything above is in 1998 pixels: 12px text, 32px icons. On a big
   modern monitor that is tiny, so the whole desktop is magnified: 125%
   from a 1080p-wide window, 150% from 1440p, 200% from 4K. Visitors can
   override it in Start > Settings > Display; display.js puts their
   choice on <html> as a class before the page is drawn. Browsers that
   don't know `zoom` simply show the original size. Phones are never
   magnified (see the end of this file). */
@supports (zoom: 1) {
  @media (pointer: coarse) { :root { --zoom: 1.25; } }   /* touch screens too wide for the phone layout: a size up, for fingers */
  @media (min-width: 1800px) and (min-height: 860px)  { :root { --zoom: 1.25; } }
  @media (min-width: 2300px) and (min-height: 1100px) { :root { --zoom: 1.5; } }
  @media (min-width: 3400px) and (min-height: 1700px) { :root { --zoom: 2; } }
  :root.zoom-100 { --zoom: 1; }
  :root.zoom-125 { --zoom: 1.25; }
  :root.zoom-150 { --zoom: 1.5; }
  :root.zoom-175 { --zoom: 1.75; }
  :root.zoom-200 { --zoom: 2; }
}

.small-only { display: none !important; }   /* text for phones (shown in "Small screens" below); .desk-only is its opposite */

.visually-hidden {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; border: 0;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
}

.skip {
  position: absolute; left: -999rem; top: 4px; z-index: 1000;
  background: var(--tip); color: #000; border: 1px solid #000; padding: 4px 8px;
}
.skip:focus { left: 4px; }

u { text-decoration: underline; }

/* ---- desktop ------------------------------------------------------------ */

.desktop {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
  background: var(--desk) url('/images/wallpaper.png') center / 367px auto no-repeat;
}

.desktop-icons {
  position: absolute;
  inset: 0;
  z-index: 0;
  display: flex;
  flex-flow: column wrap;
  align-content: flex-start;
  gap: 6px 0;
  padding: 6px 2px;
}
/* A maximized window covers the icons: take them out of the tab order. */
.desktop:has(> .window.is-max:not(.is-min)) .desktop-icons { visibility: hidden; }

.dicon {
  width: 82px;
  min-height: 66px;
  padding: 2px 1px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  border: 0;
  background: none;
  color: #fff;
  font: inherit;
  text-align: center;
  text-decoration: none;
  cursor: default;
}
.dicon img { width: calc(32px * var(--px)); height: calc(32px * var(--px)); flex: none; }
.dicon span {
  max-width: 100%;
  padding: 1px 2px 2px;
  background: var(--desk);          /* labels sit on a block of desktop colour */
  border: 1px dotted transparent;
  line-height: 1.15;
}
.dicon:hover span { text-decoration: underline; }   /* one click opens */
.dicon:focus { outline: 0; }
.dicon:focus-visible span, .dicon:active span { background: var(--navy); border-color: #ffff7f; }
.dicon:focus-visible img, .dicon:active img { filter: opacity(.6) drop-shadow(0 0 0 var(--navy)); }

/* dragging an icon (desktop.js), and the Recycle Bin lighting up under it */
.dicon { -webkit-user-drag: none; touch-action: manipulation; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
.dicon.is-dragging { position: relative; z-index: 5; opacity: .8; }
.dicon.is-drop span { background: var(--navy); border-color: #ffff7f; }
.dicon.is-drop img { filter: opacity(.6) drop-shadow(0 0 0 var(--navy)); }

/* ---- windows -------------------------------------------------------------- */

.window {
  position: absolute;
  z-index: 10;
  display: flex;
  flex-direction: column;
  min-width: 0;
  max-width: 100%;
  max-height: 100%;
  padding: 3px;
  background: var(--face);
  box-shadow: var(--window-frame);
}
.window.is-max { inset: 0; width: auto !important; height: auto !important; padding: 0; box-shadow: none; }
.window.is-min { display: none; }

.title-bar {
  flex: none;
  display: flex;
  align-items: center;
  gap: 3px;
  height: var(--title-h);
  padding: 0 2px 0 2px;
  background: linear-gradient(90deg, var(--navy), var(--navy2));
  color: #fff;
  font-weight: bold;
  -webkit-user-select: none;
  user-select: none;
  touch-action: none;
}
.window.is-inactive > .title-bar { background: linear-gradient(90deg, #808080, #b5b5b5); color: #c0c0c0; }
.title-icon { width: calc(16px * var(--px)); height: calc(16px * var(--px)); flex: none; }
.title-text { flex: 1 1 auto; min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.title-controls { flex: none; display: flex; align-items: center; }

.tb-btn {
  display: block;
  width: 16px;
  height: 14px;
  padding: 0;
  border: 0;
  background: var(--face) center / auto no-repeat;
  box-shadow: var(--raised);
  cursor: default;
}
.tb-btn:active { box-shadow: var(--pressed); background-position: calc(50% + 1px) calc(50% + 1px); }
.tb-min { background-image: url('/icons/ui-min.png'); }
.tb-max { background-image: url('/icons/ui-max.png'); }
.window.is-restored .tb-max, .window:not(.is-max) .tb-max.can-restore { background-image: url('/icons/ui-max.png'); }
.window.is-max .tb-max { background-image: url('/icons/ui-restore.png'); }
.tb-close { background-image: url('/icons/ui-close.png'); margin-left: 2px; }

.win-body { flex: 1 1 auto; min-height: 0; min-width: 0; }

/* ---- menus (window menu bars, the Start menu, search results) --------------- */

.menu-bar { flex: none; display: flex; flex-wrap: wrap; padding: 1px 0; }
.menu-wrap { position: relative; }
.menu-btn {
  height: 18px;
  padding: 0 6px;
  border: 0;
  background: none;
  color: #000;
  font: inherit;
  cursor: default;
}
.menu-btn:hover { box-shadow: inset -1px -1px var(--shadow), inset 1px 1px var(--hilight); }
.menu-btn[aria-expanded="true"] { box-shadow: inset -1px -1px var(--hilight), inset 1px 1px var(--shadow); }

.menu {
  position: absolute;
  z-index: 600;
  margin: 0;
  padding: 3px;
  list-style: none;
  background: var(--face);
  box-shadow: var(--window-frame);
  min-width: 140px;
}
.menu-wrap > .menu { left: 0; top: 100%; }
.menu li { margin: 0; }
.menu-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-height: var(--row);
  padding: 2px 24px 2px 22px;
  border: 0;
  background: none;
  color: #000;
  font: inherit;
  text-align: left;
  text-decoration: none;
  white-space: nowrap;
  cursor: default;
}
.menu-item img { flex: none; width: calc(16px * var(--px)); height: calc(16px * var(--px)); }
.menu-item:hover, .menu-item:focus, li.is-open > .menu-item { background: var(--navy); color: #fff; outline: 0; }
.menu-item:disabled { color: var(--gray-text); text-shadow: 1px 1px var(--hilight); background: none; }
.menu-item.is-checked { background-image: url('/icons/ui-check.png'); background-repeat: no-repeat; background-position: 7px 50%; }
.menu-item.is-checked:hover, .menu-item.is-checked:focus { background-image: url('/icons/ui-check-w.png'); }
.menu .sep { height: 0; margin: 3px 1px; border-top: 1px solid var(--shadow); border-bottom: 1px solid var(--hilight); }
.menu-item.is-default { font-weight: bold; }
/* right-click menus (desktop.js builds them inside the desktop) */
.ctx-menu { position: absolute; z-index: 900; min-width: 150px; }

.has-sub { position: relative; }
.has-sub > .menu-item::after {
  content: "";
  flex: none;
  margin-left: auto;
  margin-right: -16px;
  width: 4px; height: 7px;
  background: url('/icons/ui-right.png') no-repeat;
}
.has-sub > .menu-item:hover::after, .has-sub > .menu-item:focus::after, .has-sub.is-open > .menu-item::after { background-image: url('/icons/ui-right-w.png'); }
.submenu { left: calc(100% - 3px); top: -3px; }
.submenu.flip-up { top: auto; bottom: -3px; }
.submenu .menu-item, .search-pop .menu-item { padding-left: 4px; gap: 6px; }

/* ---- toolbar and address bar (Explorer windows) ------------------------------ */

.toolbar, .address-bar {
  flex: none;
  display: flex;
  align-items: center;
  padding: 2px 3px 2px 10px;
  border-top: 1px solid var(--hilight);
  box-shadow: 0 -1px var(--shadow);
  margin-top: 1px;
  position: relative;
}
/* the little "gripper" bar at the left of each band */
.toolbar::before, .address-bar::before {
  content: "";
  position: absolute;
  left: 3px; top: 3px; bottom: 3px;
  width: 3px;
  box-shadow: inset -1px -1px var(--shadow), inset 1px 1px var(--hilight);
}
.tool-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  min-width: 50px;
  padding: 3px 5px;
  border: 0;
  background: none;
  color: #000;
  font: inherit;
  text-decoration: none;
  cursor: default;
}
.tool-btn img { width: 24px; height: 24px; image-rendering: auto; filter: grayscale(1); }
.tool-btn:hover, .tool-btn:focus-visible { box-shadow: inset -1px -1px var(--shadow), inset 1px 1px var(--hilight); outline: 0; }
.tool-btn:hover img, .tool-btn:focus-visible img { filter: none; }
.tool-btn:active { box-shadow: inset -1px -1px var(--hilight), inset 1px 1px var(--shadow); }
.tool-sep { width: 0; align-self: stretch; margin: 2px 4px; border-left: 1px solid var(--shadow); border-right: 1px solid var(--hilight); }

.address-bar { gap: 6px; padding-top: 3px; padding-bottom: 3px; }
.address-label { flex: none; }
.address-field {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 4px;
  min-height: 22px;
  padding: 3px 20px 3px 4px;
  background: var(--window) url('/icons/ui-down.png') right 6px center no-repeat;
  box-shadow: var(--sunken);
}
.address-field img { flex: none; width: calc(16px * var(--px)); height: calc(16px * var(--px)); }
.address-path { min-width: 0; overflow-x: auto; white-space: nowrap; scrollbar-width: none; }   /* desktop.js scrolls a long path to its end */
.address-path::-webkit-scrollbar { display: none; }
.address-path a { color: #000; text-decoration: none; }
.address-path a:hover { color: #00f; text-decoration: underline; }

/* ---- status bar ----------------------------------------------------------------- */

.status-bar { flex: none; display: flex; gap: 2px; padding-top: 2px; }
.status-field {
  margin: 0;
  min-height: 19px;
  padding: 3px 5px 2px;
  box-shadow: var(--status);
  display: flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.status-grow { flex: 1 1 auto; min-width: 0; display: block; }
.status-zone { flex: none; min-width: 130px; }
.status-zone img { width: 16px; height: 16px; }

/* ---- buttons, fields, boxes -------------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 75px;
  min-height: var(--btn-h);
  --bp: 12px;                       /* side padding; change this, not `padding`, so a pressed button keeps its width */
  padding: 0 var(--bp);
  border: 0;
  background: var(--face);
  box-shadow: var(--raised);
  color: #000;
  font: inherit;
  text-decoration: none;
  cursor: default;
}
/* pressed: the label moves a pixel down and right, the button stays the same size */
.btn:active:not(:disabled) { box-shadow: var(--pressed); padding: 1px calc(var(--bp) - 1px) 0 calc(var(--bp) + 1px); }
.btn:focus-visible { outline: 1px dotted #000; outline-offset: -4px; }
.btn:disabled { color: var(--gray-text); text-shadow: 1px 1px var(--hilight); }
/* the default button carries an extra black frame */
.btn-default { box-shadow: inset -2px -2px var(--dkshadow), inset 1px 1px var(--dkshadow), inset 2px 2px var(--hilight), inset -3px -3px var(--shadow), inset 3px 3px var(--light); }

.field, .field-box {
  background: var(--window);
  box-shadow: var(--sunken);
  border: 0;
}
.field {
  min-height: 21px;
  padding: 3px 4px;
  color: #000;
  font: inherit;
  border-radius: 0;
  -webkit-appearance: none;
  appearance: none;
}
.field:focus { outline: 0; }
select.field { padding-right: 20px; background: var(--window) url('/icons/ui-down.png') right 6px center no-repeat; }
.field-box { padding: 2px; overflow: auto; }

.group-box {
  margin: 12px 0 10px;
  padding: 8px 10px 10px;
  border: 1px solid var(--shadow);
  box-shadow: 1px 1px var(--hilight), inset 1px 1px var(--hilight);   /* etched: dark line, light line beside it */
  min-width: 0;
}
.group-box legend { padding: 0 4px; margin-left: 2px; background: var(--face); }   /* the face colour hides the lines behind the caption */
fieldset.plain { margin: 0; padding: 0; border: 0; min-width: 0; }
fieldset.plain legend { padding: 0; margin-bottom: 8px; }

.radio { display: flex; align-items: center; gap: 6px; margin: 5px 0; }
.radio input {
  -webkit-appearance: none; appearance: none;
  flex: none; margin: 0;
  width: 12px; height: 12px;
  border-radius: 50%;
  background: var(--window);
  box-shadow: inset 1px 1px var(--shadow), inset -1px -1px var(--hilight), inset 2px 2px var(--dkshadow), inset -2px -2px var(--light);
}
.radio input:checked { background: radial-gradient(#000 0 2px, var(--window) 2.5px); }
.radio input:focus-visible + span { outline: 1px dotted #000; }

.tabs { margin: 0 0 -1px 2px; display: flex; position: relative; z-index: 1; }
.tab {
  padding: 3px 8px 4px;
  background: var(--face);
  box-shadow: inset 1px 1px var(--hilight), inset -1px 0 var(--dkshadow), inset -2px 0 var(--shadow), inset 2px 2px var(--light);
  border-top-left-radius: 2px;
  border-top-right-radius: 2px;
}
.tab-panel { padding: 12px 10px; box-shadow: var(--raised); }
/* tabs that switch (Display Properties): the chosen one stands taller and joins its page */
button.tab { position: relative; border: 0; color: #000; font: inherit; cursor: default; }
button.tab[aria-selected="true"] { z-index: 1; margin: 0 -1px 0 -2px; padding: 3px 10px 5px; }
button.tab[aria-selected="false"] { margin-top: 2px; padding: 2px 8px 3px; }
button.tab:first-child[aria-selected="true"] { margin-left: 0; }
button.tab:focus-visible { outline: 1px dotted #000; outline-offset: -4px; }

kbd {
  display: inline-block; min-width: 1.4em; padding: 0 4px; text-align: center;
  font: inherit; background: var(--face); box-shadow: var(--raised);
}

/* ---- Explorer: folder tree and file list ---------------------------------------------- */

.win-explorer > .win-body { margin-top: 2px; }
.folder-view { display: flex; gap: 3px; }

.tree-pane {
  flex: 0 0 210px;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
.pane-head { flex: none; margin: 0; padding: 3px 6px; box-shadow: var(--status); }
.tree { flex: 1 1 auto; min-height: 0; overflow: auto; margin: 2px 0 0; padding: 4px 2px 8px 4px; list-style: none; background: var(--window); box-shadow: var(--sunken); }
.tree ul { margin: 0 0 0 7px; padding: 0 0 0 8px; list-style: none; border-left: 1px dotted var(--shadow); }
.tree li { margin: 0; }
.tree a { display: inline-flex; align-items: center; gap: 3px; padding: 1px 3px 1px 1px; color: #000; text-decoration: none; white-space: nowrap; border: 1px dotted transparent; }
.tree a img { flex: none; width: 16px; height: 16px; }
.tree a:hover { text-decoration: underline; color: #00f; }
.tree a[aria-current] { background: var(--navy); color: #fff; border-color: #ffff7f; }
.tree .leaf > a { margin-left: 13px; }
.tree summary { display: flex; align-items: center; list-style: none; }
.tree summary::-webkit-details-marker { display: none; }
.tree summary::before { content: ""; flex: none; width: 9px; height: 9px; margin-right: 4px; background: url('/icons/ui-plus.png'); cursor: pointer; }
.tree details[open] > summary::before { background-image: url('/icons/ui-minus.png'); }

.file-pane, .doc-view {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 0;
  overflow: auto;
  background: var(--window);
  box-shadow: var(--sunken);
  padding: 2px;
  outline: 0;
}

.folder-info { display: flex; align-items: center; gap: 10px; padding: 10px 12px 8px; }
.folder-info img { flex: none; width: 32px; height: 32px; }
.folder-info h1 { margin: 0; font: bold 18px/1.2 var(--ui-font); }
.folder-info .blurb { margin: 2px 0 0; color: #404040; font-size: 13px; }
.folder-info + .files, .folder-readme + .files { border-top: 1px solid var(--light); }
.folder-readme { padding: 0 12px 6px; font-size: 13px; }
.empty-folder { margin: 16px 12px; color: var(--gray-text); }

.files { width: 100%; border-collapse: collapse; border-spacing: 0; }
.files th {
  position: sticky; top: -2px; z-index: 1;
  padding: 3px 8px 4px;
  background: var(--face);
  box-shadow: var(--raised);
  font-weight: normal;
  text-align: left;
  white-space: nowrap;
  cursor: default;
}
.files th[data-sort-key]:active { box-shadow: var(--pressed); }
.files th[aria-sort="ascending"]::after { content: ""; display: inline-block; margin-left: 6px; width: 7px; height: 4px; background: url('/icons/ui-up.png'); opacity: .55; }
.files th[aria-sort="descending"]::after { content: ""; display: inline-block; margin-left: 6px; width: 7px; height: 4px; background: url('/icons/ui-down.png'); opacity: .55; }
.files td { padding: 1px 8px 1px 4px; white-space: nowrap; vertical-align: middle; }
.files td.f-name { white-space: normal; }
.files .f-size { text-align: right; }
.files th.f-size { text-align: left; }
.f-name a { display: inline-flex; align-items: center; gap: 4px; color: #000; text-decoration: none; padding: 1px 0; }
.f-name a img { flex: none; }
.f-name a span { padding: 0 2px 1px; border: 1px dotted transparent; }
.f-name a:hover span { color: #00f; text-decoration: underline; }
.f-name a:focus { outline: 0; }
.f-name a:focus span, .f-name a:active span { background: var(--navy); color: #fff; border-color: #ffff7f; text-decoration: none; }
.f-name a:focus img, .f-name a:active img { filter: opacity(.6) drop-shadow(0 0 0 var(--navy)); }
.i16 { width: calc(16px * var(--px)); height: calc(16px * var(--px)); }
.i32 { display: none; width: calc(32px * var(--px)); height: calc(32px * var(--px)); }
.files .snip { display: block; padding-left: 22px; color: #404040; white-space: normal; }
.files mark { background: #ffff00; color: #000; }

/* Large Icons: the same table, drawn as a grid of big icons */
.view-large .files, .view-large .files tbody { display: block; }
.view-large .files thead { display: none; }
.view-large .files tbody { display: grid; grid-template-columns: repeat(auto-fill, minmax(88px, 1fr)); gap: 12px 2px; padding: 10px 6px; }
.view-large .files tr { display: block; min-width: 0; }
.view-large .files td { display: none; }
.view-large .files td.f-name { display: block; padding: 0; }
.view-large .f-name a { display: flex; flex-direction: column; text-align: center; gap: 4px; }
.view-large .f-name a span { overflow-wrap: anywhere; line-height: 1.15; }
.view-large .i16 { display: none; }
.view-large .i32 { display: block; }

/* List: small icons, names only, in newspaper columns */
.view-list .files, .view-list .files tbody { display: block; }
.view-list .files thead { display: none; }
.view-list .files tbody { columns: 230px auto; column-gap: 16px; padding: 6px; }
.view-list .files tr { display: block; break-inside: avoid; }
.view-list .files td { display: none; }
.view-list .files td.f-name { display: block; padding: 0; }

/* ---- taskbar ---------------------------------------------------------------------------- */

.taskbar {
  flex: none;
  position: relative;
  z-index: 700;
  display: flex;
  align-items: center;
  gap: 3px;
  height: var(--task-h);
  padding: 4px 2px 2px;
  padding-bottom: calc(2px + env(safe-area-inset-bottom, 0px));
  height: calc(var(--task-h) + env(safe-area-inset-bottom, 0px));
  background: var(--face);
  box-shadow: inset 0 1px var(--light), inset 0 2px var(--hilight);
}
.start-button {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  height: 22px;
  padding: 0 6px 0 4px;
  background: var(--face);
  box-shadow: var(--raised);
  color: #000;
  font: inherit;
  text-decoration: none;
  cursor: default;
  -webkit-user-select: none;
  user-select: none;
}
.start-button img { width: calc(16px * var(--px)); height: calc(16px * var(--px)); }
.start-button[aria-expanded="true"], .start-button:active { box-shadow: var(--pressed); padding: 1px 5px 0 5px; }
.start-button:focus-visible { outline: 1px dotted #000; outline-offset: -4px; }

.quick-launch { flex: none; display: flex; align-items: center; gap: 1px; margin-left: 2px; padding-left: 8px; position: relative; height: 22px; }
.quick-launch::before { content: ""; position: absolute; left: 1px; top: 1px; bottom: 1px; width: 3px; box-shadow: inset -1px -1px var(--shadow), inset 1px 1px var(--hilight); }
.ql-btn { display: grid; place-items: center; width: 22px; height: 22px; }
.ql-btn img { width: 16px; height: 16px; }
.ql-btn:hover { box-shadow: inset -1px -1px var(--shadow), inset 1px 1px var(--hilight); }
.ql-btn:active { box-shadow: inset -1px -1px var(--hilight), inset 1px 1px var(--shadow); }

.task-buttons { flex: 1 1 auto; min-width: 0; display: flex; gap: 3px; height: 22px; padding-left: 4px; }
.task-btn {
  flex: 0 1 160px;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 4px;
  height: 22px;
  padding: 0 5px;
  border: 0;
  background: var(--face);
  box-shadow: var(--raised);
  color: #000;
  font: inherit;
  text-align: left;
  cursor: default;
}
.task-btn img { flex: none; width: 16px; height: 16px; }
.task-btn span { min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.task-btn.is-active {
  font-weight: bold;
  box-shadow: var(--pressed);
  padding: 1px 4px 0 6px;
  background: var(--hilight) repeating-conic-gradient(var(--face) 0% 25%, var(--hilight) 0% 50%) 0 0 / 2px 2px;
}

.task-search {
  flex: 0 1 190px;
  min-width: 90px;
  display: flex;
  align-items: center;
  gap: 4px;
  height: 22px;
  padding: 0 4px;
  background: var(--window);
  box-shadow: var(--sunken);
}
.task-search img { flex: none; width: 16px; height: 16px; }
.task-search input {
  flex: 1 1 auto; min-width: 0; height: 18px; padding: 0; border: 0; outline: 0; background: none; color: #000; font: inherit;
  -webkit-appearance: none; appearance: none;
}
.task-search input::-webkit-search-cancel-button { -webkit-appearance: none; }
.task-search input::placeholder { color: var(--gray-text); opacity: 1; }

.tray { flex: none; display: flex; align-items: center; gap: 4px; height: 22px; padding: 0 9px; box-shadow: var(--status); }
.clock { white-space: nowrap; }
.tray:has(> .clock:empty:only-child) { display: none; }   /* no JavaScript, no clock: no empty box either */

/* ---- Start menu ------------------------------------------------------------------------- */

.start-menu {
  position: fixed;
  z-index: 650;
  left: 2px;
  bottom: calc(var(--task-h) + env(safe-area-inset-bottom, 0px) - 4px);
  display: flex;
  padding: 3px;
  min-width: 0;
}
.start-banner {
  flex: none;
  width: 21px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding-bottom: 5px;
  background: linear-gradient(0deg, var(--navy), #000);
  color: #fff;
}
.start-banner span { writing-mode: vertical-rl; transform: rotate(180deg); font: 16px/1 Arial, "Liberation Sans", sans-serif; letter-spacing: 0; white-space: nowrap; color: #c0c0c0; }
.start-banner b { color: #fff; font-weight: 900; }
.start-list { margin: 0; padding: 0; list-style: none; min-width: 152px; }
.start-list > li > .menu-item { min-height: 38px; padding: 3px 26px 3px 6px; gap: 10px; }
.start-list > li > .menu-item img { width: calc(32px * var(--px)); height: calc(32px * var(--px)); }
.start-list > .has-sub > .menu-item::after { margin-right: -18px; }

/* ---- search results popup (above the taskbar's Search box) --------------------------------- */

.search-pop {
  position: fixed;
  z-index: 660;
  right: 2px;
  bottom: calc(var(--task-h) + env(safe-area-inset-bottom, 0px) - 4px);
  width: min(420px, calc(100vw - 4px));
  max-height: min(70vh, 520px);
  overflow: auto;
}
.search-pop .pop-head { margin: 0; padding: 3px 6px 2px; color: var(--gray-text); }
.search-pop .menu-item { white-space: normal; align-items: flex-start; padding-top: 3px; padding-bottom: 3px; padding-right: 6px; }
.search-pop .menu-item img { margin-top: 1px; }
.search-pop .hit { min-width: 0; display: block; }
.search-pop .hit small { display: block; font-size: 11px; color: #404040; overflow-wrap: anywhere; }
.search-pop .menu-item:hover small, .search-pop .menu-item:focus small, .search-pop .menu-item.is-cursor small { color: #d8d8ff; }
.search-pop .menu-item.is-cursor { background: var(--navy); color: #fff; }
.search-pop mark { background: #ffff00; color: #000; }
.search-pop .pop-empty { margin: 0; padding: 8px 6px; }

/* ---- dialogs and the built-in windows ---------------------------------------------------------- */

.dialog-body { padding: 12px 12px 10px; }
.msg { display: flex; align-items: flex-start; gap: 14px; }
.msg > img { flex: none; width: 32px; height: 32px; }
.msg p, .msg h1 { margin: 0 0 8px; }
.msg h1 { font: inherit; font-weight: bold; }
.msg hr { border: 0; border-top: 1px solid var(--shadow); border-bottom: 1px solid var(--hilight); margin: 8px 0; }
.dialog-buttons { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; margin: 12px 0 0; }

.win-dialog { width: 360px; left: calc(50% - 180px); top: 22%; }
.win-dialog .tb-min, .win-dialog .tb-max { display: none; }   /* dialogs only close */
.win-run { width: 350px; }
.run-row { display: flex; align-items: center; gap: 8px; margin: 10px 0 0; }
.run-row .field { flex: 1 1 auto; min-width: 0; }
.win-about { width: 380px; }
.win-display { width: 356px; top: max(8px, 9%); }
.win-display .group-box { margin-bottom: 0; }
/* the picture of a monitor on the Screen Saver tab; its screen is a live canvas */
.monitor { position: relative; width: 184px; margin: 0 auto 24px; padding: 11px 14px 15px; background: var(--face); box-shadow: var(--raised); border-radius: 5px 5px 2px 2px; }
.monitor::before { content: ""; position: absolute; left: calc(50% - 20px); bottom: -8px; width: 40px; height: 8px; background: var(--face); box-shadow: inset 1px 0 var(--hilight), inset -1px 0 var(--dkshadow), inset -2px 0 var(--shadow); }
.monitor::after { content: ""; position: absolute; left: calc(50% - 48px); bottom: -15px; width: 96px; height: 8px; background: var(--face); box-shadow: var(--raised); border-radius: 2px 2px 0 0; }
.monitor-screen { display: block; width: 156px; height: 116px; border: 2px solid; border-color: var(--shadow) var(--hilight) var(--hilight) var(--shadow); background: var(--desk); image-rendering: pixelated; }
.saver-row { display: flex; align-items: center; gap: 8px; margin: 6px 0 0; }
.saver-row #saver-pick { flex: 1 1 auto; min-width: 0; }
.win-props { width: 330px; }
.props-head { display: flex; align-items: center; gap: 14px; margin-bottom: 10px; padding-bottom: 10px; border-bottom: 1px solid var(--shadow); box-shadow: 0 1px var(--hilight); }
.props-head img { flex: none; width: 32px; height: 32px; }
.props-name { flex: 1 1 auto; min-width: 0; margin: 0; }
.props-list { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; margin: 0; }
.props-list dd { margin: 0; overflow-wrap: anywhere; }
.wizard { width: 80px !important; height: 72px !important; }

.welcome-seen .win-welcome { display: none !important; }   /* shown once per visitor, see display.js */
.win-welcome { width: 470px; left: max(8px, min(max(280px, calc(50% - 235px)), calc(100% - 478px))); top: max(12px, 9%); }
.welcome-body { padding: 0 12px 10px; overflow: auto; }
.welcome-banner { display: flex; align-items: center; gap: 14px; margin: 3px -9px 0; padding: 10px 14px; background: linear-gradient(90deg, #000, var(--navy) 55%, var(--navy2)); color: #fff; }
.welcome-banner h1 { margin: 0; font: bold 26px/1.1 Arial, "Liberation Sans", sans-serif; letter-spacing: .01em; }
.welcome-tag { margin: 3px 0 0; color: #c0c0c0; }
.welcome-text p { margin: 10px 0; line-height: 1.4; }
.welcome-text a, .recent a, .help-body a, .tool a { color: #00f; }
.recent { margin: 0; padding: 0; list-style: none; }
.recent li { display: flex; align-items: center; gap: 5px; padding: 2px 0; }
.recent img { flex: none; width: 16px; height: 16px; }
.recent a { flex: 1 1 auto; min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.recent time { flex: none; color: #404040; }

.win-find { width: 560px; height: 430px; left: calc(50% - 280px); top: 8%; }
.find-body { display: flex; flex-direction: column; gap: 6px; padding: 6px 4px 0; }
.find-form { flex: none; display: flex; gap: 8px; }
.find-fields { flex: 1 1 auto; min-width: 0; }
.find-fields .tab-panel { display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 7px 8px; }
.find-fields .field { width: 100%; min-width: 0; }
.find-buttons { flex: none; display: flex; flex-direction: column; align-items: center; gap: 6px; padding-top: 22px; }
.find-glass { margin-top: 4px; }
.find-glass.is-busy { animation: glass 1.1s steps(8) infinite; }
@keyframes glass { 0% { transform: translate(0, 0); } 25% { transform: translate(6px, -4px); } 50% { transform: translate(0, -8px); } 75% { transform: translate(-6px, -4px); } }
.find-results { flex: 1 1 auto; min-height: 60px; outline: 0; }
.find-table { table-layout: fixed; min-width: 480px; }
.find-table th:nth-child(1) { width: 46%; }
.find-table th:nth-child(2) { width: 30%; }
.find-table th:nth-child(3) { width: 14%; }
.find-table th:nth-child(4) { width: 10%; min-width: 70px; }
.find-table td { vertical-align: top; overflow: hidden; text-overflow: ellipsis; }
.find-table td.f-name { white-space: normal; }
.find-table .f-folder { color: #000; }

.win-help { width: 470px; height: 440px; left: calc(50% - 235px); top: 6%; }
.help-body { margin: 2px; padding: 4px 14px 10px; overflow: auto; font-size: 13px; line-height: 1.45; }
.help-body h2 { display: flex; align-items: center; gap: 10px; margin: 8px 0; font-size: 18px; }
.help-body h2 img { width: 32px; height: 32px; }
.help-body h3 { margin: 14px 0 4px; font-size: 13px; color: var(--navy); }
.help-body ul { margin: 0; padding-left: 18px; }
.help-body li { margin: 4px 0; }
.help-buttons { flex: none; margin: 8px 6px 6px; }

.win-recycle { width: 380px; height: 250px; left: calc(50% - 190px); top: 18%; }
.recycle-body { margin-top: 2px; }
.bin-list { display: flex; flex-wrap: wrap; gap: 10px 4px; margin: 0; padding: 10px 6px; list-style: none; }
.bin-item { display: flex; flex-direction: column; align-items: center; gap: 4px; width: 84px; padding: 2px; border: 0; background: none; color: #000; font: inherit; text-align: center; cursor: default; }
.bin-item img { width: 32px; height: 32px; }
.bin-item:hover span { color: #00f; text-decoration: underline; }
.bin-item:focus-visible span { background: var(--navy); color: #fff; outline: 1px dotted #ffff7f; }

/* program windows that just show something */
.win-sysinfo { width: min(800px, 100% - 16px); }
.sysinfo .tabs { margin-top: 2px; }
.sysinfo .tab-panel { padding: 10px; }
.sysinfo .tab-panel a { display: block; background: #000; box-shadow: var(--sunken); padding: 2px; }
.sysinfo img { display: block; width: 100%; height: auto; image-rendering: auto; }

/* ---- the wizard (wizard.js) --------------------------------------------------------------------- */

.wizard-tip {
  position: fixed;
  z-index: 640;
  right: 16px;
  bottom: calc(var(--task-h) + env(safe-area-inset-bottom, 0px) + 8px);
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 12px;
  pointer-events: none;
}
.wizard-tip > * { pointer-events: auto; }
.wizard-balloon {
  position: relative;
  max-width: 250px;
  padding: 9px 11px 9px;
  background: var(--tip);
  border: 1px solid #000;
  border-radius: 9px;
  box-shadow: 2px 2px 0 rgba(0, 0, 0, .3);
  line-height: 1.35;
}
/* the balloon's tail, pointing down at him */
.wizard-balloon::after {
  content: "";
  position: absolute;
  right: 34px;
  bottom: -8px;
  width: 14px;
  height: 14px;
  background: var(--tip);
  border-right: 1px solid #000;
  border-bottom: 1px solid #000;
  transform: rotate(45deg);
}
.wizard-text { margin: 0 0 9px; }
.wizard-actions { display: flex; justify-content: flex-end; gap: 6px; }
.wizard-actions .btn { min-width: 0; min-height: 21px; --bp: 9px; }
.wizard-guy { padding: 0; border: 0; background: none; cursor: pointer; margin-right: 6px; }
.wizard-guy img { display: block; width: 80px; height: 72px; }
.wizard-guy:focus-visible { outline: 1px dotted #fff; outline-offset: 2px; }

/* program windows (the practice tools, the games) */
.win-app { width: min(620px, 100% - 16px); left: max(8px, calc(50% - 310px)); top: max(8px, 5%); max-height: calc(100% - 16px); }
.app-body { overflow: auto; background: var(--face); padding: 10px 14px 6px; outline: 0; }

/* ---- "It's now safe to turn off your computer." ---------------------------------------------- */

.shutdown-screen {
  position: fixed; inset: 0; z-index: 2000;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 40px;
  background: #000; color: #ff9000; text-align: center;
}
.shutdown-screen p { margin: 0; font: bold clamp(22px, 5vw, 38px)/1.3 Arial, "Liberation Sans", sans-serif; }
.shutdown-wake { border: 0; background: none; color: #555; font: 12px var(--ui-font); cursor: pointer; }
.shutdown-wake::before { content: ""; position: fixed; inset: 0; }

/* ---- screen saver and start-up screen (extras.js) ------------------------------------------------ */

.screensaver { position: fixed; inset: 0; z-index: 5000; background: #000; cursor: none; }
.screensaver canvas { display: block; width: 100%; height: 100%; image-rendering: pixelated; }

/* Only drawn while <html> has class "booting" (display.js). The
   animation is a safety net: if extras.js never runs, the screen takes
   itself away after nine seconds. */
.boot-screen { display: none; }
.booting .boot-screen {
  display: block;
  position: fixed; inset: 0; z-index: 6000;
  padding: 22px 24px;
  background: #000; color: #c0c0c0;
  font: 16px/1.35 "Courier New", "Liberation Mono", monospace;
  cursor: default;
  animation: boot-out 1ms linear 9s forwards;
}
.boot-text { margin: 0; padding: 0; border: 0; border-radius: 0; background: none; color: inherit; font: inherit; white-space: pre-wrap; overflow: visible; }
.boot-skip { position: absolute; left: 24px; bottom: 18px; margin: 0; color: #707070; }
@keyframes boot-out { to { visibility: hidden; } }

/* ---- classic scrollbars (mouse only; phones keep their own) -------------------------------------- */

@media (pointer: fine) {
  ::-webkit-scrollbar { width: 16px; height: 16px; }
  ::-webkit-scrollbar-track { background: var(--hilight) repeating-conic-gradient(var(--face) 0% 25%, var(--hilight) 0% 50%) 0 0 / 2px 2px; }
  ::-webkit-scrollbar-thumb { background: var(--face); box-shadow: var(--raised); }
  ::-webkit-scrollbar-corner { background: var(--face); }
  ::-webkit-scrollbar-button:single-button { display: block; width: 16px; height: 16px; background: var(--face) center no-repeat; box-shadow: var(--raised); }
  ::-webkit-scrollbar-button:single-button:active { box-shadow: var(--pressed); }
  ::-webkit-scrollbar-button:single-button:vertical:decrement { background-image: url('/icons/ui-up.png'); }
  ::-webkit-scrollbar-button:single-button:vertical:increment { background-image: url('/icons/ui-down.png'); }
  ::-webkit-scrollbar-button:single-button:horizontal:decrement { background-image: url('/icons/ui-left.png'); }
  ::-webkit-scrollbar-button:single-button:horizontal:increment { background-image: url('/icons/ui-right.png'); }
}

/* ---- page changes: no white flash between pages --------------------------------------------------- */

@view-transition { navigation: auto; }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: 90ms; }
.taskbar { view-transition-name: taskbar; }
::view-transition-group(taskbar) { animation: none; }

@media (prefers-reduced-motion: reduce) {
  ::view-transition-old(root), ::view-transition-new(root) { animation: none; }
  .find-glass.is-busy { animation: none; }
}

/* ==========================================================================
   Small screens: phones either way up, small tablets, and narrow browser
   windows. Same desktop, sized for thumbs:
   - every window fills the screen (dialogs stay small and centered);
   - icons sit in a grid and are drawn at double size;
   - the taskbar, title bars, menus and list rows are finger-height;
   - the Start menu is a full-width sheet whose submenus fold open in place;
   - the folder tree is hidden: the address bar and Up do that job.

   The same condition is written out in four places, so keep them in
   step: here, the Games section at the end of this file, content.css,
   and SMALL in assets/js/desktop.js.
   ========================================================================== */

@media (max-width: 700px), (pointer: coarse) and (max-width: 960px) {
  :root, :root[class] { --zoom: 1 !important; }

  /* The page itself never scrolls, but `overflow: hidden` on the page
     would switch off a phone's pull-down-to-refresh, so the page is
     left scrollable and the body does the clipping. The body always
     covers the page; if a browser ever leaves a strip uncovered at the
     bottom, the strip is taskbar grey rather than a hole. */
  html { overflow-y: auto; background: var(--face) linear-gradient(var(--desk) 0 50%, var(--face) 50%) no-repeat; }

  /* The body is pinned to the part of the screen you can actually see.
     desktop.js keeps --vvh (height) and --vvt (top) in step with the
     browser's visual viewport, so when the on-screen keyboard opens the
     taskbar sits on top of it instead of underneath or floating. */
  body {
    position: fixed;
    left: 0;
    right: 0;
    top: var(--vvt, 0px);
    height: var(--vvh, var(--full-h));
    padding: 0 env(safe-area-inset-right, 0px) 0 env(safe-area-inset-left, 0px);
  }
  .desk-only { display: none !important; }
  li.small-only { display: list-item !important; }
  span.small-only { display: inline !important; }
  p.small-only, div.small-only { display: block !important; }
  :root {
    --ui: 15px;
    --row: 44px;
    --title-h: 34px;
    --btn-h: 38px;
    --task-h: 46px;
  }

  .desktop { background-size: 240px auto; background-position: center bottom 18px; }

  .desktop-icons {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(84px, 1fr));
    align-content: start;
    gap: 14px 2px;
    padding: 14px 6px;
    overflow-y: auto;
  }
  .dicon { width: auto; min-height: 0; }
  .dicon img { width: 48px; height: 48px; image-rendering: auto; }
  .dicon span { font-size: 13px; }
  .dicon:hover span { text-decoration: none; }

  .window, .window.is-max { inset: 0; left: 0 !important; top: 0 !important; width: auto !important; height: auto !important; max-height: none; padding: 0; box-shadow: none; }
  .title-bar { padding: 0 4px 0 6px; gap: 6px; font-size: 16px; touch-action: manipulation; }   /* windows don't drag here, so a pull-down may start on the title */
  .title-icon { width: 16px; height: 16px; }
  .tb-min, .tb-max { display: none; }
  .tb-btn { width: 30px; height: 26px; background-size: 16px auto; }

  .menu-bar { display: none; }
  .toolbar { padding-left: 12px; overflow-x: auto; }
  .tool-btn { min-width: 58px; min-height: 44px; padding: 3px 6px; font-size: 12px; }
  .tool-btn img { filter: none; }
  .address-label { display: none; }
  .address-field { min-height: 34px; }
  .address-path a, .address-path span { padding: 6px 0; display: inline-block; }
  .status-bar { display: none; }

  .tree-pane { display: none; }
  .folder-info h1 { font-size: 20px; }
  .folder-info .blurb { font-size: 14px; }

  /* every view becomes a roomy list on a phone, except Large Icons */
  .files th { display: none; }
  .view-details .files, .view-details .files tbody, .view-list .files, .view-list .files tbody { display: block; }
  .view-details .files tbody, .view-list .files tbody { columns: auto; padding: 0; }
  .view-details .files tr, .view-list .files tr { display: flex; flex-wrap: wrap; align-items: center; column-gap: 10px; padding: 0 8px; border-bottom: 1px solid #ececec; }
  .view-details .files td, .view-list .files td { display: none; }
  .view-details .files td.f-name, .view-list .files td.f-name { display: block; flex: 1 1 100%; padding: 0; }
  .view-details .files td.f-date, .view-details .files td.f-size { display: block; padding: 0 0 8px 26px; margin-top: -6px; font-size: 12px; color: #505050; text-align: left; }
  .view-details .files td.f-size:empty, .view-details .files td.f-date:empty { display: none; }
  .view-details .f-name a, .view-list .f-name a { display: flex; gap: 8px; min-height: 44px; font-size: 16px; }
  .view-large .files tbody { grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 18px 2px; padding: 14px 6px; }
  .view-large .i32 { width: 48px; height: 48px; image-rendering: auto; }
  .view-large .f-name a { font-size: 14px; }
  .files .snip { padding-left: 26px; font-size: 13px; padding-bottom: 8px; }

  .taskbar { gap: 5px; padding: 6px 4px 4px; padding-bottom: calc(4px + env(safe-area-inset-bottom, 0px)); }
  .start-button { height: 36px; padding: 0 10px 0 7px; gap: 6px; font-size: 16px; }
  .start-button img { width: 20px; height: 20px; image-rendering: auto; }
  .quick-launch, .task-buttons { display: none; }
  .task-search { flex: 1 1 auto; height: 36px; padding: 0 8px; gap: 6px; }
  .task-search input { height: 36px; font-size: 16px; }   /* 16px stops iOS zooming in on focus */
  .tray { height: 36px; padding: 0 8px; font-size: 13px; }

  .start-menu, .search-pop, .wizard-tip { position: absolute; }   /* they ride on the body, which follows the keyboard */
  .start-menu { left: env(safe-area-inset-left, 0px); right: env(safe-area-inset-right, 0px); bottom: calc(var(--task-h) + env(safe-area-inset-bottom, 0px) - 4px); max-height: calc(var(--vvh, var(--full-h)) - var(--task-h) - 24px); }
  .start-banner { width: 26px; }
  .start-banner span { font-size: 20px; }
  .start-list { flex: 1 1 auto; min-width: 0; overflow-y: auto; overscroll-behavior: contain; }
  .start-list > li > .menu-item { min-height: 48px; gap: 12px; font-size: 16px; }
  .start-list > li > .menu-item img { width: 32px; height: 32px; }
  .start-list .menu-item { min-height: 44px; }
  /* submenus fold open in place instead of flying out */
  .start-menu .submenu { position: static; box-shadow: none; padding: 0 0 0 22px; min-width: 0; background: var(--face); }
  .start-menu .submenu .menu-item { white-space: normal; padding-left: 8px; gap: 10px; }
  .start-menu .has-sub > .menu-item::after { transform: rotate(90deg); margin-right: -8px; }
  .start-menu .has-sub.is-open > .menu-item { background: none; color: #000; font-weight: bold; }
  .start-menu .has-sub.is-open > .menu-item::after { transform: rotate(-90deg); background-image: url('/icons/ui-right.png'); }
  .start-menu .menu-item:hover { background: none; color: #000; }
  .start-menu .menu-item:active, .start-menu .menu-item:focus-visible { background: var(--navy); color: #fff; }

  .search-pop { left: env(safe-area-inset-left, 0px); right: env(safe-area-inset-right, 0px); width: auto; max-height: calc(var(--vvh, var(--full-h)) - var(--task-h) - 16px); }
  .search-pop .menu-item { min-height: 48px; font-size: 16px; gap: 10px; align-items: center; }
  .search-pop .hit small { font-size: 12px; }

  /* dialogs stay dialogs */
  .window.win-dialog, .window.win-recycle {
    inset: auto; left: max(10px, calc(50% - 220px)) !important; top: 14% !important; width: min(440px, calc(100% - 20px)) !important; height: auto !important;
    max-height: calc(86% - 8px); overflow: auto;
    padding: 3px; box-shadow: var(--window-frame);
  }
  .ctx-menu { min-width: 190px; }
  .ctx-menu .menu-item { font-size: 16px; }
  .booting .boot-screen { padding: 16px 14px; font-size: 13px; }
  .boot-skip { left: 14px; }
  .window.win-recycle { height: 240px !important; }
  .wizard-tip { right: calc(8px + env(safe-area-inset-right, 0px)); }
  .wizard-balloon { max-width: 230px; font-size: 14px; }
  .wizard-actions .btn { min-height: 34px; --bp: 12px; }
  .wizard-guy img { width: 60px; height: 54px; }
  .btn { min-width: 88px; --bp: 14px; }
  .field { min-height: 38px; font-size: 16px; padding: 6px 8px; }
  .radio { margin: 0; min-height: 40px; gap: 10px; }
  .radio input { width: 18px; height: 18px; }
  .radio input:checked { background: radial-gradient(#000 0 4px, var(--window) 4.5px); }

  .find-form { flex-direction: column; }
  .find-buttons { flex-direction: row; padding-top: 0; }
  .find-buttons .btn { flex: 1 1 0; min-width: 0; }
  .find-glass, .find-buttons .btn:disabled { display: none; }
  .find-fields .tab-panel { grid-template-columns: 1fr; gap: 4px; padding: 10px; }
  .find-fields label { margin-top: 4px; }
  .find-table { table-layout: auto; min-width: 0; }
  .find-table .f-folder, .find-table .f-type, .find-table .f-date { display: none; }
  .find-table tr { display: block; padding: 4px 6px; border-bottom: 1px solid #ececec; }
  .find-table td.f-name { display: block; padding: 0; }
  .find-table .f-name a { display: flex; gap: 8px; min-height: 44px; font-size: 16px; }
  .find-table .in-folder { display: block; padding-left: 26px; font-size: 12px; color: #505050; }

  .help-body { font-size: 15px; }
  .help-body h3 { font-size: 15px; }
  .app-body { padding: 12px 12px 8px; }

  /* the home page scrolls as one sheet: icons first, the Welcome window under them */
  .page-home .desktop { overflow-y: auto; display: flex; flex-direction: column; }
  .page-home .desktop-icons { position: static; flex: none; overflow: visible; }
  .page-home .window.win-welcome { position: static; flex: none; margin: 4px 8px 16px; padding: 3px; box-shadow: var(--window-frame); }
  .page-home .window.win-welcome.is-min { display: none; }
}

/* A phone on its side has very little height: the address bar steps
   aside (the title bar and Up say where you are) and the toolbar slims
   down to one line. */
@media (pointer: coarse) and (max-width: 960px) and (max-height: 480px) and (orientation: landscape) {
  .address-bar { display: none; }
  .tool-btn { flex-direction: row; gap: 5px; min-width: 0; min-height: 38px; padding: 2px 9px; }
  .tool-btn img { width: 20px; height: 20px; }
  .window.win-dialog, .window.win-recycle { top: 6px !important; max-height: calc(100% - 12px); }
}

/* On a narrow phone the picture in My Computer shows the half with the
   words (the full picture opens with a tap). */
@media (max-width: 560px) {
  .sysinfo img { aspect-ratio: 650 / 733; object-fit: cover; object-position: 82% 50%; }
}

/* ---- print: just the note ---------------------------------------------------------------------- */

@media print {
  html, body { position: static; height: auto; overflow: visible; background: #fff; display: block; }
  .desktop { overflow: visible; background: none; }
  .desktop-icons, .taskbar, .start-menu, .search-pop, .wizard-tip, .ctx-menu, .screensaver, .boot-screen, .title-bar, .menu-bar, .toolbar, .address-bar, .status-bar, .tree-pane, .skip, .post-nav, .term-copy { display: none !important; }
  .window, .window.is-max { position: static; display: block; padding: 0; box-shadow: none; background: none; max-height: none; }
  .window:not(#win-main) { display: none; }
  .file-pane, .doc-view, .app-body { overflow: visible; box-shadow: none; background: none; }
}

/* ==========================================================================
   Games
   ========================================================================== */

.accel { margin-left: auto; padding-left: 24px; }
.game-body { background: var(--face); outline: 0; overflow: auto; }
.game-note { margin: 10px; }
.game-touchbar { display: flex; gap: 6px; padding: 6px; }
.game-touchbar .field { flex: 1 1 auto; min-width: 0; }
.btn[aria-pressed="true"] { box-shadow: var(--pressed); background: var(--hilight) repeating-conic-gradient(var(--face) 0% 25%, var(--hilight) 0% 50%) 0 0 / 2px 2px; }

/* Minesweeper: the window hugs the board */
.win-mines { width: auto; left: max(280px, 34%); top: max(8px, 8%); }
.mines-canvas { display: block; image-rendering: pixelated; touch-action: manipulation; outline: 0; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }

/* Ski Run */
.win-ski { width: min(680px, 100% - 16px); height: min(560px, 100% - 16px); left: max(8px, calc(50% - 300px)); top: max(8px, 4%); }
.ski-body { position: relative; overflow: hidden; background: #fff; box-shadow: var(--sunken); padding: 2px; margin-top: 1px; }
.ski-canvas { display: block; width: 100%; height: 100%; image-rendering: pixelated; touch-action: none; outline: 0; cursor: crosshair; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }

.ski-hud { position: absolute; top: 8px; right: 8px; padding: 4px 8px; background: #fff; border: 1px solid #000; white-space: pre; line-height: 1.35; pointer-events: none; }
.ski-banner { position: absolute; left: 50%; top: 46%; transform: translate(-50%, -50%); margin: 0; padding: 6px 14px; background: var(--navy); color: #fff; font-weight: bold; font-size: 16px; white-space: nowrap; pointer-events: none; }

/* DOS games (the shareware shelf) */
.win-dos { width: min(668px, 100% - 16px); left: max(8px, calc(50% - 334px)); top: max(4px, 2%); }
.win-dos.is-max .dos-body { display: flex; flex-direction: column; }
.dos-body { overflow: auto; background: var(--face); padding: 0; outline: 0; }
.win-dos.is-max .dos-stage { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; }
/* The screen is a black box; the picture in it is always 4:3 and as
   large as fits (the cq units are the box's own size), so the game is
   never stretched, whatever shape the window is. */
.dos-screen {
  position: relative;
  display: flex; align-items: center; justify-content: center;
  width: 100%; aspect-ratio: 4 / 3; max-height: var(--dos-max, calc(var(--full-h) - 190px));
  margin: 1px auto 0; padding: 2px;
  background: #000; box-shadow: var(--sunken);
  container-type: size;
}
.win-dos.is-max .dos-screen { flex: 1 1 auto; max-height: none; aspect-ratio: auto; min-height: 0; }
.dos-screen canvas { display: block; width: 100%; height: 100%; object-fit: fill; image-rendering: pixelated; outline: 0; touch-action: none; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
@supports (width: 1cqw) {
  .dos-screen canvas { width: min(100cqw, 100cqh * 4 / 3); height: min(100cqh, 100cqw * 3 / 4); }
}
.dos-stage:fullscreen { display: flex; flex-direction: column; background: #000; }
.dos-stage:fullscreen .dos-screen { flex: 1 1 auto; min-height: 0; max-height: none; aspect-ratio: auto; margin: 0; padding: 0; box-shadow: none; }
.dos-stage:-webkit-full-screen { display: flex; flex-direction: column; background: #000; }
.dos-stage:-webkit-full-screen .dos-screen { flex: 1 1 auto; min-height: 0; max-height: none; aspect-ratio: auto; margin: 0; padding: 0; box-shadow: none; }
.dos-cover {
  position: absolute; inset: 2px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px;
  padding: 12px;
  background: #000; color: #c0c0c0; text-align: center;
  font: 16px/1.4 "Courier New", "Liberation Mono", monospace;
}
.dos-cover p { margin: 0; }
.dos-cover .dos-prompt { color: #fff; }
.dos-cover .dos-prompt::after { content: "_"; animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.dos-progress { width: min(260px, 80%); height: 16px; background: #000; box-shadow: var(--sunken); padding: 3px; }
.dos-progress span { display: block; height: 100%; width: 0; background: repeating-linear-gradient(90deg, var(--navy) 0 8px, transparent 8px 10px); }
.dos-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 6px 6px 4px; }
.dos-bar .dos-spacer { flex: 1 1 auto; }
.dos-info { padding: 2px 10px 8px; font-size: 13px; line-height: 1.45; }
.dos-info h1 { margin: 6px 0 2px; font: bold 16px/1.2 var(--ui-font); }
.dos-info p { margin: 4px 0; }
.dos-info a { color: #00f; }
.dos-info dl { display: grid; grid-template-columns: auto 1fr; gap: 2px 12px; margin: 6px 0; }
.dos-info dt { color: #404040; }
.dos-info dd { margin: 0; }
.touch-only { display: none; }
@media (pointer: coarse) { dt.touch-only, dd.touch-only { display: block; } }

/* The on-screen pad for touch screens (dosplayer.js shows it): small
   keys in a row, a direction pad on the left, action buttons on the
   right. Under the picture when the phone is upright; either side of
   it when the phone is on its side (further down). */
.dos-pad {
  display: grid;
  grid-template-columns: auto 1fr auto;
  grid-template-areas: "keys keys keys" "left . right";
  align-items: center;
  gap: 10px 6px;
  padding: 8px 10px 10px;
  background: var(--face);
  -webkit-user-select: none; user-select: none; -webkit-touch-callout: none;
}
.pad-keys { grid-area: keys; display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; }
.pad-left { grid-area: left; display: flex; }
.pad-right { grid-area: right; display: grid; grid-template-columns: repeat(2, minmax(0, 78px)); gap: 8px; }
.pad-right.pad-one { display: flex; }
.pad-key, .pad-btn, .pad-dpad { touch-action: none; }
.btn.pad-key { min-width: 50px; min-height: 36px; --bp: 9px; }
.btn.pad-btn { min-width: 0; min-height: 62px; --bp: 4px; font-weight: bold; }
.btn.pad-wide { width: 150px; min-height: 100px; }
.pad-key.is-on, .pad-btn.is-on { box-shadow: var(--pressed); }
.pad-dpad { display: grid; grid-template: repeat(3, 1fr) / repeat(3, 1fr); width: 162px; max-width: 100%; aspect-ratio: 1; }
.pad-dpad span { background: var(--face) center no-repeat; box-shadow: var(--raised); image-rendering: pixelated; pointer-events: none; }
.pad-dpad .d-up { grid-area: 1 / 2; background-image: url('/icons/ui-up.png'); background-size: 21px 12px; }
.pad-dpad .d-left { grid-area: 2 / 1; background-image: url('/icons/ui-left.png'); background-size: 12px 21px; }
.pad-dpad .d-mid { grid-area: 2 / 2; box-shadow: none; }
.pad-dpad .d-right { grid-area: 2 / 3; background-image: url('/icons/ui-right.png'); background-size: 12px 21px; }
.pad-dpad .d-down { grid-area: 3 / 2; background-image: url('/icons/ui-down.png'); background-size: 21px 12px; }
.pad-dpad .is-on { box-shadow: var(--pressed); background-position: calc(50% + 1px) calc(50% + 1px); }
.dos-stage:fullscreen .dos-pad { background: #000; }
.dos-stage:-webkit-full-screen .dos-pad { background: #000; }

/* the speaker in the taskbar tray (game pages) */
.tray-btn { display: grid; place-items: center; width: 18px; height: 18px; padding: 0; border: 0; background: none; cursor: default; }
.tray-btn img { width: 16px; height: 16px; }

@media (prefers-reduced-motion: reduce) { .dos-cover .dos-prompt::after { animation: none; } }

@media (max-width: 700px), (pointer: coarse) and (max-width: 960px) {
  .game-touchbar .field, .game-touchbar .btn { min-height: 40px; }
  .mines-canvas { margin: 8px auto 0; }
  .dos-screen { max-height: calc(var(--vvh, var(--full-h)) * 0.56); margin-top: 0; }
  .dos-info { font-size: 15px; }
  .btn.pad-key { min-height: 40px; }
  .tray-btn { width: 30px; height: 30px; }
  .tray-btn img { width: 20px; height: 20px; image-rendering: auto; }
}

/* A phone on its side: the picture fills the height and the pad sits
   either side of it, small keys above the direction pad. */
@media (pointer: coarse) and (max-width: 960px) and (orientation: landscape) {
  .dos-stage.has-pad {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    grid-template-rows: auto minmax(0, 1fr);
    grid-template-areas: "keys screen right" "left screen right";
    height: 100%;
    background: var(--face);
  }
  .has-pad .dos-pad { display: contents; }
  .has-pad .dos-screen { grid-area: screen; width: auto; height: 100%; max-height: none; aspect-ratio: 4 / 3; margin: 0; }
  .has-pad .pad-keys { grid-area: keys; align-self: start; padding: 5px 4px 0; gap: 4px; }
  .has-pad .pad-left { grid-area: left; align-self: end; justify-content: center; padding: 6px 6px 8px; }
  .has-pad .pad-right { grid-area: right; align-self: end; justify-content: center; padding: 6px 6px 8px; }
  .has-pad .pad-dpad { width: min(162px, 100%); }
  .has-pad .btn.pad-wide { width: min(150px, 100%); min-height: clamp(84px, 30vh, 120px); }
  .has-pad .btn.pad-key { min-width: 34px; min-height: 32px; --bp: 6px; font-size: 12px; }
  .has-pad .btn.pad-btn { --bp: 2px; font-size: 13px; }
  .dos-stage.has-pad:fullscreen { background: #000; }
  .dos-stage.has-pad:fullscreen .dos-screen { flex: none; aspect-ratio: 4 / 3; }
  .dos-stage.has-pad:-webkit-full-screen { background: #000; }
  .dos-stage.has-pad:-webkit-full-screen .dos-screen { flex: none; aspect-ratio: 4 / 3; }
}
/* ==========================================================================
   cfworx.tech: reading styles. Everything inside a window's white page:
   notes and lab write-ups (.doc), the practice tools (.tool), code
   blocks, tables, the image lightbox.

   - Helvetica/Arial for reading, real monospace for terminal output.
   - Links are the classic blue and "you've read this" purple.
   - The short blue cable under each heading is a patch cord ending in
     an RJ45 plug (static/images/rj45-plug.svg).
   - All colour pairs meet WCAG 2.1 AA contrast.
   ========================================================================== */

:root {
  --ink:          #000000;
  --muted:        #555555;   /* secondary text, 7.5:1 on white */
  --link:         #0000ee;
  --link-hover:   #0000aa;
  --link-visited: #551a8b;
  --rule:         #c0c0c0;   /* hairlines */
  --box:          #f0f0f0;   /* code / quote background */
  --box-border:   #c0c0c0;
  --enet:         #0057b8;   /* patch-cable blue */
  --ok:           #006400;   /* quiz "correct" */
  --bad:          #a80000;   /* quiz "wrong" */
  --mark:         #ffff00;
  --mark-ink:     #000000;

  --sans: Arial, Helvetica, "Liberation Sans", sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas,
          'Liberation Mono', 'Courier New', monospace;
}

/* ---- the page inside a document window ---------------------------------- */

.doc-view { scroll-padding-top: 1rem; }

/* Reading text grows more gently than the desktop around it: at 150%
   desktop size the note is about 20px, not 25px. The column is sized in
   ems so the line length stays comfortable at any size. */
.doc {
  max-width: 46em;
  margin: 0 auto;
  padding: 0.4rem 1.6rem 3rem;
  color: var(--ink);
  font: calc(17px * (1 + (var(--zoom, 1) - 1) * 0.35) / var(--zoom, 1))/1.6 var(--sans);
}

.doc h1, .doc h2, .doc h3, .doc h4, .doc h5, .doc h6 {
  font-family: var(--sans);
  line-height: 1.3;
  overflow-wrap: break-word;
  margin-top: 1.3em;
}
.doc h1 { font-size: 1.9rem; }
.doc h2 { font-size: 1.55rem; font-weight: normal; }
.doc h3, .doc h4, .doc h5, .doc h6 { font-size: 1.3rem; font-weight: normal; }
.doc p { line-height: 1.5; margin-block: 1em; }
.doc figcaption p { font-style: italic; }

.doc a { color: var(--link); text-decoration: underline; text-underline-offset: 2px; }
.doc a:visited { color: var(--link-visited); }
.doc a:hover { color: var(--link-hover); }
.doc :focus-visible { outline: 1px dotted #000; outline-offset: 2px; }
.doc ::selection, .tool ::selection { background: #000080; color: #fff; }
.doc :target { scroll-margin-top: 1rem; }

.doc img { max-width: 100%; height: auto; border: 1px solid var(--rule); image-rendering: auto; }

.doc ul, .doc ol { padding-left: 1.4em; }
.doc li { margin: 0.45em 0; }
.doc hr { border: 0; border-top: 1px solid #808080; border-bottom: 1px solid #fff; margin: 2rem 0; }

.post-header h1 { font-size: 1.9rem; margin: 1.1rem 0 0.35rem; }
.post-meta { font: 0.8rem var(--sans); color: var(--muted); margin: 0 0 1.4rem; }
.doc .post-meta a, .doc .post-meta a:visited { color: var(--muted); }
.doc .post-meta a:hover { color: var(--link-hover); }

.doc h2 { margin: 1.3em 0 0.5rem; }
.doc h3 { margin: 1.3em 0 0.4rem; }

/* A short blue patch cable under each post heading, ending in an RJ45
   plug (a real SVG: clear body, gold pins, latch tab, and the blue
   cable showing through the plastic). Standard patch-cable blue
   (#0057b8) in both themes, because cables don't change color in the
   dark. */
.doc h2,
.doc h3 {
  width: fit-content;   /* so the cable below runs the length of the text */
}

.doc h2::after,
.doc h3::after {
  content: "";
  display: block;
  width: 100%;
  min-width: 4.5rem;    /* room for the plug even under a short heading */
  height: 14px;
  margin-top: 0.35rem;
  background-image:
    url('/images/rj45-plug.svg'),
    linear-gradient(#0057b8, #0057b8);
  background-repeat: no-repeat;
  background-size: 28px 14px, calc(100% - 20px) 4px;
  background-position: right center, left center;
}

.doc h3::after {
  height: 12px;
  background-size: 24px 12px, calc(100% - 17px) 3px;
}

@media print {
  .doc h2::after, .doc h3::after { display: none; }
}

/* ---- table of contents (lab posts) ----------------------------------------
   Native <details>, open by default, built by Hugo from the ## and ###
   headings (see [markup.tableOfContents] in hugo.toml). Same triangle
   marker as the home-page post groups. */

.toc {
  width: fit-content;
  max-width: 100%;
  margin: 0 0 1.7rem;
  padding: 0.5rem 1rem 0.6rem;
  border: 1px solid var(--rule);
  border-radius: 4px;
  font: 0.85rem var(--sans);
}

.toc summary {
  display: flex;
  align-items: baseline;
  gap: 0.55em;
  cursor: pointer;
  font-weight: 700;
  list-style: none;
  -webkit-user-select: none;
  user-select: none;
}
.toc summary::-webkit-details-marker { display: none; } /* Safari */
.toc summary::before {
  content: "\25B8";               /* right-pointing triangle */
  color: var(--enet);
  font-size: 0.8em;
  line-height: 1;
  flex: none;
}
.toc[open] summary::before { content: "\25BE"; }
.toc summary:hover { color: var(--enet); }

/* Reset the hanging-marker list style that article lists use. */
.toc ul {
  list-style: none;
  margin: 0.45rem 0 0;
  padding-left: 1.15em;
}
.toc ul ul { margin-top: 0.1rem; padding-left: 1.1em; }
.toc li { margin: 0.28em 0; }
.toc a { text-decoration: none; }
.toc a:hover {
  text-decoration: underline;
  text-underline-offset: 2px;
}

@media print { .toc { display: none; } }

blockquote {
  margin: 1.1em 0;
  padding-left: 1em;
  border-left: 4px solid #ccc;
  font-style: italic;
}
blockquote p { margin: 0.5em 0; }

/* code blocks */

pre {
  background: var(--box);
  border: 1px solid var(--box-border);
  border-radius: 3px;
  padding: 0.8rem 1rem;
  overflow-x: auto;
  font: 0.9rem/1.55 var(--mono);
  margin: 1.1em 0;
}
code {
  font-family: var(--mono);
  font-size: 0.9rem;
  background: var(--box);
  border: 1px solid var(--box-border);
  border-radius: 2px;
  padding: 0.06em 0.3em;
}
pre code {
  font-size: 1em;
  background: none;
  border: 0;
  padding: 0;
}
.highlight { margin: 1.1em 0; }
.highlight pre { margin: 0; }

/* ---- console windows (render-codeblock hook) ---------------------------
   Fenced code blocks render inside a window frame whose look follows
   the language. The console interiors stay dark in BOTH site themes
   (a terminal is dark either way); only the frame adapts. */

.term {
  margin: 1.1em 0;
  border: 1px solid var(--box-border);
  border-radius: 7px;
  overflow: hidden;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.14);
}
.term .highlight { margin: 0; }
.term pre {
  margin: 0;
  border: 0;
  border-radius: 0;
  white-space: pre-wrap;      /* long lines wrap instead of clipping */
  overflow-wrap: anywhere;    /* even unbroken UNC paths and URLs */
}

.term-bar {
  display: flex;
  align-items: center;
  gap: 0.6em;
  padding: 0.45em 0.85em;
  font: 700 0.72rem var(--sans);
  -webkit-user-select: none;
  user-select: none;
}
.term-title { letter-spacing: 0.04em; }

/* macOS-style traffic lights for shell / generic consoles */
.term-dots {
  flex: none;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #ff5f57;
  box-shadow: 17px 0 0 #febc2e, 34px 0 0 #28c840;
  margin-right: 38px;   /* the shadows extend 34px past the span */
}

/* Text selection inside the dark consoles: translucent white, so the
   token colors stay readable while selected. */
.term pre ::selection,
.term pre::selection { background: rgba(255, 255, 255, 0.25); }

.term-copy {
  margin-left: auto;
  font: 700 0.68rem var(--sans);
  letter-spacing: 0.05em;
  color: inherit;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 3px;
  padding: 0.15em 0.6em;
  cursor: pointer;
  opacity: 0.85;
}
.term-copy:hover { opacity: 1; background: rgba(255, 255, 255, 0.16); }
.term-copy:disabled { cursor: default; }
.term-powershell .term-copy { margin-right: 0.9em; }

/* bash / shells: dark terminal */
.term-bash .term-bar { background: #2e2e2e; color: #c9c9c9; }
.term-bash pre { background: #1b1b1b; color: #e6e6e6; }

/* generic console (plain text output, registry dumps, error text) */
.term-generic .term-bar { background: #34333c; color: #c9c9c9; }
.term-generic pre { background: #211f26; color: #e2e0e7; }

/* World of Warcraft: gold-trimmed console, system-message gold text */
.term-wow {
  border: 2px solid #a17d2a;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2), inset 0 0 0 1px #5c4415;
}
.term-wow .term-bar {
  background: linear-gradient(#4a3413, #241a08);
  color: #ffd100;
}
.term-wow pre { background: #120d08; color: #ffd100; }

/* PowerShell: the classic blue console */
.term-powershell .term-bar { background: #0a3069; color: #ffffff; }
.term-powershell .term-winbtns {
  margin-left: auto;
  font-weight: 400;
  opacity: 0.85;
}
.term-powershell pre { background: #012456; color: #eeedf0; }

/* tiny inline animated GIFs, the 90s way (see the render-image hook) */
.gif-icon {
  display: inline-block;
  height: 1.15em;
  width: auto;
  border: 0;
  vertical-align: -0.18em;
  image-rendering: pixelated;
}

/* ---- image lightbox (lightbox.js) -------------------------------------- */

.doc a:has(> img) { cursor: zoom-in; }


.lightbox {
  position: fixed;
  inset: 0;
  z-index: 3000;      /* above the taskbar and any window */
  display: flex;
  overflow: auto;
  padding: 2rem;
  background: rgba(0, 0, 0, 0.93);
  cursor: zoom-out;
  -webkit-overflow-scrolling: touch;
}

.lightbox-img {
  max-width: 96%;
  max-height: 92%;
  width: auto;
  height: auto;
  border: none;
  margin: auto;
  cursor: zoom-in;
}

/* Second tap/click: actual pixels, pan by scrolling the overlay. */
.lightbox-img.zoomed {
  max-width: none;
  max-height: none;
  cursor: zoom-out;
}

@media (max-width: 40rem) {
  .lightbox { padding: 0.75rem; }
}

.lightbox-close {
  position: fixed;
  top: 0.5rem;
  right: 0.9rem;
  border: 0;
  background: none;
  color: #fff;
  font-size: 2.6rem;
  line-height: 1;
  padding: 0.2rem 0.5rem;
  cursor: pointer;
}

.lightbox-close:hover { color: #bbb; }

body.lightbox-open { overflow: hidden; }

/* tables */

.doc table { border-collapse: collapse; font-size: 0.92em; margin: 1.1em 0; display: block; max-width: 100%; overflow-x: auto; }
.doc th { font: 700 0.85em var(--sans); text-align: left; border-bottom: 2px solid var(--ink); padding: 0.3em 1em 0.3em 0; }
.doc td { border-bottom: 1px solid var(--rule); padding: 0.35em 1em 0.35em 0; vertical-align: top; }

/* prev / next */

.post-nav {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
  margin-top: 2.6rem;
  padding-top: 0.9rem;
  border-top: 1px solid var(--rule);
  font: 0.85rem var(--sans);
}
.post-nav .older { margin-left: auto; text-align: right; }

/* ---- practice tools (/tools/*) ------------------------------------------------
   A program window: the question sits in a group box, the answer goes
   in a sunken field, and Submit is the default button. The quiz ships
   hidden in the HTML; quiz-engine.js reveals it. */

.tool { font-size: 13px; line-height: 1.45; }
.tool-header { display: flex; align-items: center; gap: 12px; margin-bottom: 4px; }
.tool-header img { flex: none; width: 32px; height: 32px; }
.tool-header h1 { margin: 0; font: bold 18px/1.2 var(--ui-font); }
.tool-header .post-meta { margin: 2px 0 0; font: inherit; color: #404040; }
.tool code {
  font-family: var(--mono);
  font-size: 13px;
  background: #fff;
  box-shadow: inset -1px -1px #fff, inset 1px 1px #808080;
  padding: 1px 5px;
}

.quiz { margin: 10px 0 0; }
.quiz-progress { margin: 0 0 4px; color: #404040; }
.quiz .group-box { margin: 6px 0 0; padding: 8px 12px 12px; }
.quiz-question { margin: 4px 0 12px; font-size: 15px; line-height: 1.6; }
.quiz-question code { white-space: nowrap; font-size: 15px; }
/* very long chips (full IPv6 addresses, dotted-binary quads) may wrap
   on narrow screens instead of overflowing the page */
.quiz code.q-long { white-space: normal; word-break: break-all; }
.quiz input[type="text"] { width: 100%; max-width: 26rem; font: 15px var(--mono); min-height: 26px; }
.quiz-buttons { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.quiz-feedback { margin: 10px 2px 0; min-height: 3.2em; font-size: 14px; }   /* reserve the lines so the window doesn't jump */
.quiz-feedback.ok { color: var(--ok); }
.quiz-feedback.no { color: var(--bad); }
.quiz-feedback code { white-space: nowrap; font-size: 14px; }

@media (max-width: 700px), (pointer: coarse) and (max-width: 960px) {
  .doc { padding: 0.2rem 0.9rem 2.5rem; font-size: 16px; }
  .post-header h1 { font-size: 1.6rem; }
  .doc h2 { font-size: 1.35rem; }
  .doc h3, .doc h4 { font-size: 1.18rem; }
  .tool { font-size: 15px; }
  .quiz-question, .quiz-question code { font-size: 17px; }
  .quiz input[type="text"] { font-size: 17px; max-width: none; }
  .quiz-buttons .btn { flex: 1 1 auto; }
}

@media print {
  .doc h2::after, .doc h3::after { display: none; }
  .doc { max-width: none; padding: 0; color: #000; }
  .doc a, .doc a:visited { color: #000; }
}
/* Chroma syntax-highlighting palette (Hugo's built-in highlighter),
   base: 'tango', with greens/oranges darkened to meet WCAG AA contrast
   on this site's code-block background. Regenerate with:
   hugo gen chromastyles --style=tango   (then re-apply the tweaks) */
/* chroma: PreWrapper */ .chroma { background: transparent; }
/* chroma: Other */ .chroma .x { color: #000000 }
/* chroma: Error */ .chroma .err { color: #a40000 }
/* chroma: CodeLine */ .chroma .cl {  }
/* chroma: LineLink */ .chroma .lnlinks { outline: none; text-decoration: none; color: inherit }
/* chroma: LineTableTD */ .chroma .lntd { vertical-align: top; padding: 0; margin: 0; border: 0; }
/* chroma: LineTable */ .chroma .lntable { border-spacing: 0; padding: 0; margin: 0; border: 0; }
/* chroma: LineHighlight */ .chroma .hl { background-color: #dfdfdf }
/* chroma: LineNumbersTable */ .chroma .lnt { white-space: pre; -webkit-user-select: none; user-select: none; margin-right: 0.4em; padding: 0 0.4em 0 0.4em;color: #7f7f7f }
/* chroma: LineNumbers */ .chroma .ln { white-space: pre; -webkit-user-select: none; user-select: none; margin-right: 0.4em; padding: 0 0.4em 0 0.4em;color: #7f7f7f }
/* chroma: Line */ .chroma .line { display: flex; }
/* chroma: Keyword */ .chroma .k { color: #204a87; font-weight: bold }
/* chroma: KeywordConstant */ .chroma .kc { color: #204a87; font-weight: bold }
/* chroma: KeywordDeclaration */ .chroma .kd { color: #204a87; font-weight: bold }
/* chroma: KeywordNamespace */ .chroma .kn { color: #204a87; font-weight: bold }
/* chroma: KeywordPseudo */ .chroma .kp { color: #204a87; font-weight: bold }
/* chroma: KeywordReserved */ .chroma .kr { color: #204a87; font-weight: bold }
/* chroma: KeywordType */ .chroma .kt { color: #204a87; font-weight: bold }
/* chroma: Name */ .chroma .n { color: #000000 }
/* chroma: NameAttribute */ .chroma .na { color: #c4a000 }
/* chroma: NameBuiltin */ .chroma .nb { color: #204a87 }
/* chroma: NameBuiltinPseudo */ .chroma .bp { color: #3465a4 }
/* chroma: NameClass */ .chroma .nc { color: #000000 }
/* chroma: NameConstant */ .chroma .no { color: #000000 }
/* chroma: NameDecorator */ .chroma .nd { color: #5c35cc; font-weight: bold }
/* chroma: NameEntity */ .chroma .ni { color: #a34a00 }
/* chroma: NameException */ .chroma .ne { color: #cc0000; font-weight: bold }
/* chroma: NameFunction */ .chroma .nf { color: #000000 }
/* chroma: NameFunctionMagic */ .chroma .fm { color: #000000 }
/* chroma: NameLabel */ .chroma .nl { color: #f57900 }
/* chroma: NameNamespace */ .chroma .nn { color: #000000 }
/* chroma: NameOther */ .chroma .nx { color: #000000 }
/* chroma: NameProperty */ .chroma .py { color: #000000 }
/* chroma: NameTag */ .chroma .nt { color: #204a87; font-weight: bold }
/* chroma: NameVariable */ .chroma .nv { color: #000000 }
/* chroma: NameVariableClass */ .chroma .vc { color: #000000 }
/* chroma: NameVariableGlobal */ .chroma .vg { color: #000000 }
/* chroma: NameVariableInstance */ .chroma .vi { color: #000000 }
/* chroma: NameVariableMagic */ .chroma .vm { color: #000000 }
/* chroma: Literal */ .chroma .l { color: #000000 }
/* chroma: LiteralDate */ .chroma .ld { color: #000000 }
/* chroma: LiteralString */ .chroma .s { color: #3a7404 }
/* chroma: LiteralStringAffix */ .chroma .sa { color: #3a7404 }
/* chroma: LiteralStringBacktick */ .chroma .sb { color: #3a7404 }
/* chroma: LiteralStringChar */ .chroma .sc { color: #3a7404 }
/* chroma: LiteralStringDelimiter */ .chroma .dl { color: #3a7404 }
/* chroma: LiteralStringDoc */ .chroma .sd { color: #8f5902; font-style: italic }
/* chroma: LiteralStringDouble */ .chroma .s2 { color: #3a7404 }
/* chroma: LiteralStringEscape */ .chroma .se { color: #3a7404 }
/* chroma: LiteralStringHeredoc */ .chroma .sh { color: #3a7404 }
/* chroma: LiteralStringInterpol */ .chroma .si { color: #3a7404 }
/* chroma: LiteralStringOther */ .chroma .sx { color: #3a7404 }
/* chroma: LiteralStringRegex */ .chroma .sr { color: #3a7404 }
/* chroma: LiteralStringSingle */ .chroma .s1 { color: #3a7404 }
/* chroma: LiteralStringSymbol */ .chroma .ss { color: #3a7404 }
/* chroma: LiteralNumber */ .chroma .m { color: #0000cf; font-weight: bold }
/* chroma: LiteralNumberBin */ .chroma .mb { color: #0000cf; font-weight: bold }
/* chroma: LiteralNumberFloat */ .chroma .mf { color: #0000cf; font-weight: bold }
/* chroma: LiteralNumberHex */ .chroma .mh { color: #0000cf; font-weight: bold }
/* chroma: LiteralNumberInteger */ .chroma .mi { color: #0000cf; font-weight: bold }
/* chroma: LiteralNumberIntegerLong */ .chroma .il { color: #0000cf; font-weight: bold }
/* chroma: LiteralNumberOct */ .chroma .mo { color: #0000cf; font-weight: bold }
/* chroma: Operator */ .chroma .o { color: #a34a00; font-weight: bold }
/* chroma: OperatorWord */ .chroma .ow { color: #204a87; font-weight: bold }
/* chroma: Punctuation */ .chroma .p { color: #000000; font-weight: bold }
/* chroma: Comment */ .chroma .c { color: #8f5902; font-style: italic }
/* chroma: CommentHashbang */ .chroma .ch { color: #8f5902; font-style: italic }
/* chroma: CommentMultiline */ .chroma .cm { color: #8f5902; font-style: italic }
/* chroma: CommentSingle */ .chroma .c1 { color: #8f5902; font-style: italic }
/* chroma: CommentSpecial */ .chroma .cs { color: #8f5902; font-style: italic }
/* chroma: CommentPreproc */ .chroma .cp { color: #8f5902; font-style: italic }
/* chroma: CommentPreprocFile */ .chroma .cpf { color: #8f5902; font-style: italic }
/* chroma: Generic */ .chroma .g { color: #000000 }
/* chroma: GenericDeleted */ .chroma .gd { color: #a40000 }
/* chroma: GenericEmph */ .chroma .ge { color: #000000; font-style: italic }
/* chroma: GenericError */ .chroma .gr { color: #ef2929 }
/* chroma: GenericHeading */ .chroma .gh { color: #000080; font-weight: bold }
/* chroma: GenericInserted */ .chroma .gi { color: #00a000 }
/* chroma: GenericOutput */ .chroma .go { color: #000000; font-style: italic }
/* chroma: GenericPrompt */ .chroma .gp { color: #8f5902 }
/* chroma: GenericStrong */ .chroma .gs { color: #000000; font-weight: bold }
/* chroma: GenericSubheading */ .chroma .gu { color: #800080; font-weight: bold }
/* chroma: GenericTraceback */ .chroma .gt { color: #a40000; font-weight: bold }
/* chroma: GenericUnderline */ .chroma .gl { color: #000000; text-decoration: underline }
/* chroma: TextWhitespace */ .chroma .w { color: #f8f8f8; text-decoration: underline }


/* ---- dark theme: Monokai --------------------------------------------------
   Classic Monokai token colors on the dark --box background. Applies
   only when the visitor has toggled dark mode. */

:root[data-theme="dark"] .chroma .x, :root[data-theme="dark"] .chroma .n, :root[data-theme="dark"] .chroma .nc, :root[data-theme="dark"] .chroma .no, :root[data-theme="dark"] .chroma .nv, :root[data-theme="dark"] .chroma .vc, :root[data-theme="dark"] .chroma .vg, :root[data-theme="dark"] .chroma .vi { color: #f8f8f2 }
:root[data-theme="dark"] .chroma .k, :root[data-theme="dark"] .chroma .kc, :root[data-theme="dark"] .chroma .kd, :root[data-theme="dark"] .chroma .kn, :root[data-theme="dark"] .chroma .kp, :root[data-theme="dark"] .chroma .kr, :root[data-theme="dark"] .chroma .o, :root[data-theme="dark"] .chroma .nt { color: #f92672 }
:root[data-theme="dark"] .chroma .kt, :root[data-theme="dark"] .chroma .nb, :root[data-theme="dark"] .chroma .bp { color: #66d9ef }
:root[data-theme="dark"] .chroma .s, :root[data-theme="dark"] .chroma .sa, :root[data-theme="dark"] .chroma .sb, :root[data-theme="dark"] .chroma .sc, :root[data-theme="dark"] .chroma .dl, :root[data-theme="dark"] .chroma .sd, :root[data-theme="dark"] .chroma .s2, :root[data-theme="dark"] .chroma .sh, :root[data-theme="dark"] .chroma .s1, :root[data-theme="dark"] .chroma .sx, :root[data-theme="dark"] .chroma .sr { color: #e6db74 }
:root[data-theme="dark"] .chroma .m, :root[data-theme="dark"] .chroma .mb, :root[data-theme="dark"] .chroma .mf, :root[data-theme="dark"] .chroma .mh, :root[data-theme="dark"] .chroma .mi, :root[data-theme="dark"] .chroma .il, :root[data-theme="dark"] .chroma .mo, :root[data-theme="dark"] .chroma .se, :root[data-theme="dark"] .chroma .si { color: #ae81ff }
:root[data-theme="dark"] .chroma .c, :root[data-theme="dark"] .chroma .ch, :root[data-theme="dark"] .chroma .cm, :root[data-theme="dark"] .chroma .c1, :root[data-theme="dark"] .chroma .cs, :root[data-theme="dark"] .chroma .cp, :root[data-theme="dark"] .chroma .cpf { color: #75715e }
:root[data-theme="dark"] .chroma .na, :root[data-theme="dark"] .chroma .nf, :root[data-theme="dark"] .chroma .nd, :root[data-theme="dark"] .chroma .ni, :root[data-theme="dark"] .chroma .ne, :root[data-theme="dark"] .chroma .gi { color: #a6e22e }
:root[data-theme="dark"] .chroma .err, :root[data-theme="dark"] .chroma .gd { color: #f92672 }
:root[data-theme="dark"] .chroma .hl { background-color: #3e3d32 }
:root[data-theme="dark"] .chroma .lnt,
:root[data-theme="dark"] .chroma .ln { color: #75715e }

/* ---- console windows: token colors ----------------------------------------
   Blocks wrapped by the render-codeblock hook keep these colors in BOTH
   themes (the console interior is always dark). The :root prefix plus
   the figure element outweigh the dark-mode Monokai rules above. */

/* bash / shells: Dracula-ish terminal */
:root figure.term-bash .chroma { color: #e6e6e6 }
:root figure.term-bash .chroma .k, :root figure.term-bash .chroma .kr,
:root figure.term-bash .chroma .nb, :root figure.term-bash .chroma .nf,
:root figure.term-bash .chroma .nt { color: #50fa7b }
:root figure.term-bash .chroma .s, :root figure.term-bash .chroma .s1,
:root figure.term-bash .chroma .s2, :root figure.term-bash .chroma .sb,
:root figure.term-bash .chroma .dl { color: #f1fa8c }
:root figure.term-bash .chroma .nv, :root figure.term-bash .chroma .si { color: #8be9fd }
:root figure.term-bash .chroma .m, :root figure.term-bash .chroma .mi,
:root figure.term-bash .chroma .mf { color: #bd93f9 }
:root figure.term-bash .chroma .c, :root figure.term-bash .chroma .c1,
:root figure.term-bash .chroma .cm { color: #8a8a8a }
:root figure.term-bash .chroma .gp { color: #50fa7b }

/* generic console: plain light-on-dark */
:root figure.term-generic .chroma { color: #e2e0e7 }
:root figure.term-generic .chroma .err { color: #e2e0e7 }

/* PowerShell: PSReadLine-flavored colors on the blue console */
:root figure.term-powershell .chroma { color: #eeedf0 }
:root figure.term-powershell .chroma .nb, :root figure.term-powershell .chroma .nf,
:root figure.term-powershell .chroma .k, :root figure.term-powershell .chroma .kr { color: #ffe100 }
:root figure.term-powershell .chroma .nv, :root figure.term-powershell .chroma .vg { color: #6fdb6f }
:root figure.term-powershell .chroma .s, :root figure.term-powershell .chroma .s1,
:root figure.term-powershell .chroma .s2, :root figure.term-powershell .chroma .sb,
:root figure.term-powershell .chroma .dl { color: #59d3e6 }
:root figure.term-powershell .chroma .n, :root figure.term-powershell .chroma .na,
:root figure.term-powershell .chroma .py,
:root figure.term-powershell .chroma .o, :root figure.term-powershell .chroma .p { color: #c8c8c8 }
:root figure.term-powershell .chroma .m, :root figure.term-powershell .chroma .mi,
:root figure.term-powershell .chroma .mf { color: #b5cea8 }
:root figure.term-powershell .chroma .c, :root figure.term-powershell .chroma .c1,
:root figure.term-powershell .chroma .cm { color: #4fa34f }
:root figure.term-powershell .chroma .err { color: #eeedf0 }

/* WoW console: everything is system-message gold */
:root figure.term-wow .chroma, :root figure.term-wow .chroma .err,
:root figure.term-wow .chroma .k, :root figure.term-wow .chroma .n,
:root figure.term-wow .chroma .m, :root figure.term-wow .chroma .mi,
:root figure.term-wow .chroma .mf { color: #ffd100 }
