/* vietnamese */
@font-face {
  font-family: 'VT323';
  font-style: normal;
  font-weight: 400;
  font-display: block;
  src: url("/msp/assets/vt323-vi.woff2") format('woff2');
  unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;
}
/* latin-ext */
@font-face {
  font-family: 'VT323';
  font-style: normal;
  font-weight: 400;
  font-display: block;
  src: url("/msp/assets/vt323-latin-ext.woff2") format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* latin */
@font-face {
  font-family: 'VT323';
  font-style: normal;
  font-weight: 400;
  font-display: block;
  src: url("/msp/assets/vt323-latin.woff2") format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ============================================================
   AI MSP Index — Windows 3.1 pixel-faithful theme
   ============================================================ */

@font-face {
  font-family: "W31";
  src: local("MS Sans Serif"), local("Microsoft Sans Serif");
}

:root {
  /* Win 3.1 16-color palette */
  --c-black: #000000;
  --c-white: #ffffff;
  --c-grey: #c0c0c0;
  --c-grey-dark: #808080;
  /* Accessible muted text — 7:1 on white, 4.6:1 on --c-grey. Use for body
     text colored a "softer" grey; keep --c-grey-dark for chrome/borders. */
  --c-grey-text: #595959;
  --c-grey-light: #dfdfdf;
  --c-teal: #008080;
  --c-navy: #000080;
  --c-red: #ff0000;
  --c-yellow: #ffff00;
  --c-green: #008000;
  --c-maroon: #800000;
  --c-purple: #800080;

  --title-active: var(--c-navy);
  --title-inactive: var(--c-grey-dark);
  --desktop: var(--c-teal);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-font-smoothing: none;
  -moz-osx-font-smoothing: unset;
  font-smooth: never;
}

html, body {
  height: 100%;
  width: 100%;
  overflow: hidden;
  font-family: "Pixelated MS Sans Serif", "W31", "Microsoft Sans Serif", "Tahoma", sans-serif;
  font-size: 11px;
  color: var(--c-black);
  user-select: none;
  cursor: default;
  image-rendering: pixelated;
}

button { font-family: inherit; font-size: inherit; }

/* ===== Desktop ===== */
.desktop {
  position: fixed;
  inset: 0;
  background: var(--desktop);
  /* subtle dither pattern via SVG (alternate color is hidden/optional) */
  overflow: hidden;
}

/* Desktop icons (Program-Manager-like, on the desktop edges) */
.desktop-icons {
  position: absolute;
  top: 12px;
  left: 12px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.desktop-icon {
  width: 76px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  padding: 2px;
}
.desktop-icon:focus { outline: 1px dotted var(--c-white); }
.desktop-icon .icon { width: 32px; height: 32px; image-rendering: pixelated; }
.desktop-icon .label {
  color: var(--c-white);
  font-size: 11px;
  text-align: center;
  background: transparent;
  padding: 1px 3px;
  line-height: 1.1;
  text-shadow: 1px 1px 0 #000;
}
.desktop-icon.selected .label {
  background: var(--c-navy);
  color: var(--c-white);
  text-shadow: none;
}

/* ===== Bevels (the heart of Win 3.1) ===== */
.bevel-out {
  border-top: 1px solid var(--c-white);
  border-left: 1px solid var(--c-white);
  border-right: 1px solid var(--c-grey-dark);
  border-bottom: 1px solid var(--c-grey-dark);
  box-shadow: inset -1px -1px 0 var(--c-black), inset 1px 1px 0 var(--c-grey-light);
}
.bevel-in {
  border-top: 1px solid var(--c-grey-dark);
  border-left: 1px solid var(--c-grey-dark);
  border-right: 1px solid var(--c-white);
  border-bottom: 1px solid var(--c-white);
  box-shadow: inset 1px 1px 0 var(--c-black), inset -1px -1px 0 var(--c-grey-light);
}
.bevel-thin-in {
  border: 1px solid;
  border-color: var(--c-grey-dark) var(--c-white) var(--c-white) var(--c-grey-dark);
}

/* ===== Window chrome ===== */
.window {
  position: absolute;
  background: var(--c-grey);
  border-top: 2px solid var(--c-white);
  border-left: 2px solid var(--c-white);
  border-right: 2px solid var(--c-grey-dark);
  border-bottom: 2px solid var(--c-grey-dark);
  box-shadow:
    inset -1px -1px 0 var(--c-black),
    inset 2px 2px 0 var(--c-grey-light);
  display: flex;
  flex-direction: column;
  min-width: 200px;
  min-height: 80px;
}
.window.maximized {
  top: 0 !important;
  left: 0 !important;
  width: 100% !important;
  height: calc(100% - 28px) !important;
}
.resize-handle {
  position: absolute;
  z-index: 5;
  user-select: none;
}
.window.maximized .resize-handle { display: none; }
.resize-n  { top: -3px;    left: 8px;    right: 8px;   height: 6px;  cursor: ns-resize; }
.resize-s  { bottom: -3px; left: 8px;    right: 8px;   height: 6px;  cursor: ns-resize; }
.resize-e  { right: -3px;  top: 8px;     bottom: 8px;  width: 6px;   cursor: ew-resize; }
.resize-w  { left: -3px;   top: 8px;     bottom: 8px;  width: 6px;   cursor: ew-resize; }
.resize-ne { top: -3px;    right: -3px;  width: 12px;  height: 12px; cursor: nesw-resize; }
.resize-nw { top: -3px;    left: -3px;   width: 12px;  height: 12px; cursor: nwse-resize; }
.resize-se { bottom: -3px; right: -3px;  width: 12px;  height: 12px; cursor: nwse-resize; }
.resize-sw { bottom: -3px; left: -3px;   width: 12px;  height: 12px; cursor: nesw-resize; }
@media (max-width: 767px) {
  .resize-handle { display: none !important; }
}
.window.minimized { display: none; }

.titlebar {
  height: 18px;
  background: var(--title-active);
  color: var(--c-white);
  display: flex;
  align-items: center;
  padding: 0 2px;
  font-weight: bold;
  font-size: 11px;
  cursor: move;
  user-select: none;
  flex-shrink: 0;
}
/* Inactive titlebar: darker bg + white text gives 4.6:1 (AA for large text). */
.window.inactive .titlebar { background: #6e6e6e; color: #ffffff; }

.titlebar .title {
  flex: 1;
  text-align: center;
  letter-spacing: 0;
  font-family: "Pixelated MS Sans Serif", "W31", sans-serif;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: clip;
  padding: 0 4px;
}

/* Win 3.1 minimize/maximize/control button */
.tb-btn {
  width: 17px;
  height: 14px;
  background: var(--c-grey);
  border-top: 1px solid var(--c-white);
  border-left: 1px solid var(--c-white);
  border-right: 1px solid var(--c-grey-dark);
  border-bottom: 1px solid var(--c-grey-dark);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: "Pixelated MS Sans Serif", monospace;
  font-size: 9px;
  font-weight: bold;
  color: var(--c-black);
  padding: 0;
  cursor: pointer;
}
.tb-btn:active {
  border-color: var(--c-grey-dark) var(--c-white) var(--c-white) var(--c-grey-dark);
}
.tb-btn .glyph {
  display: block;
  image-rendering: pixelated;
}
.tb-btn.system { width: 18px; height: 14px; margin-right: 2px; }
.tb-controls { display: flex; gap: 0; margin-left: auto; padding-right: 0; }

/* ===== Menubar ===== */
.menubar {
  display: flex;
  background: var(--c-grey);
  border-bottom: 1px solid var(--c-grey-dark);
  padding: 1px 2px;
  font-size: 11px;
  flex-shrink: 0;
}
.menu-item {
  padding: 2px 7px;
  cursor: pointer;
  position: relative;
  white-space: nowrap;
}
.menu-item .accel { text-decoration: underline; }
.menu-item:hover, .menu-item.open {
  background: var(--c-navy);
  color: var(--c-white);
}

.menu-dropdown {
  position: absolute;
  top: 100%;
  left: -1px;
  background: var(--c-grey);
  border-top: 1px solid var(--c-white);
  border-left: 1px solid var(--c-white);
  border-right: 1px solid var(--c-black);
  border-bottom: 1px solid var(--c-black);
  box-shadow: 1px 1px 0 var(--c-grey-dark);
  min-width: 160px;
  padding: 1px;
  z-index: 1000;
  color: var(--c-black);
}
.menu-row {
  padding: 3px 18px 3px 22px;
  position: relative;
  cursor: pointer;
  font-size: 11px;
  display: flex;
  justify-content: space-between;
  gap: 24px;
}
.menu-row:hover {
  background: var(--c-navy);
  color: var(--c-white);
}
.menu-row.disabled { color: var(--c-grey-dark); cursor: default; }
.menu-row.disabled:hover { background: transparent; color: var(--c-grey-dark); }
.menu-sep {
  height: 0;
  border-top: 1px solid var(--c-grey-dark);
  border-bottom: 1px solid var(--c-white);
  margin: 2px 1px;
}

/* ===== Status bar ===== */
.statusbar {
  display: flex;
  border-top: 1px solid var(--c-white);
  background: var(--c-grey);
  padding: 2px 2px;
  gap: 2px;
  font-size: 11px;
  flex-shrink: 0;
}
.status-cell {
  flex: 1;
  padding: 1px 4px;
  border-top: 1px solid var(--c-grey-dark);
  border-left: 1px solid var(--c-grey-dark);
  border-right: 1px solid var(--c-white);
  border-bottom: 1px solid var(--c-white);
}

/* ===== Window body ===== */
.window-body {
  flex: 1;
  overflow: auto;
  position: relative;
  background: var(--c-grey);
}
.window-body.padded { padding: 8px; }
.window-body.white { background: var(--c-white); }

/* Scrollbars (Win 3.1 style) */
.window-body::-webkit-scrollbar { width: 16px; height: 16px; }
.window-body::-webkit-scrollbar-track {
  background: var(--c-white);
  background-image:
    repeating-linear-gradient(45deg, var(--c-grey) 0 1px, transparent 1px 2px),
    repeating-linear-gradient(-45deg, var(--c-grey) 0 1px, transparent 1px 2px);
  background-color: #a0a0a0;
}
.window-body::-webkit-scrollbar-thumb {
  background: var(--c-grey);
  border-top: 1px solid var(--c-white);
  border-left: 1px solid var(--c-white);
  border-right: 1px solid var(--c-grey-dark);
  border-bottom: 1px solid var(--c-grey-dark);
  box-shadow: inset -1px -1px 0 var(--c-black);
}
.window-body::-webkit-scrollbar-corner { background: var(--c-grey); }

/* ===== Buttons ===== */
.btn {
  background: var(--c-grey);
  border-top: 1px solid var(--c-white);
  border-left: 1px solid var(--c-white);
  border-right: 1px solid var(--c-grey-dark);
  border-bottom: 1px solid var(--c-grey-dark);
  box-shadow: inset -1px -1px 0 var(--c-black), inset 1px 1px 0 var(--c-grey-light);
  padding: 4px 14px;
  font-size: 11px;
  cursor: pointer;
  min-width: 75px;
  color: var(--c-black);
  font-family: inherit;
}
.btn:active, .btn.pressed {
  border-color: var(--c-grey-dark) var(--c-white) var(--c-white) var(--c-grey-dark);
  box-shadow: inset 1px 1px 0 var(--c-black);
  padding: 5px 13px 3px 15px;
}
.btn:disabled { color: var(--c-grey-dark); cursor: default; text-shadow: 1px 1px 0 var(--c-white); }
.btn.default {
  border: 2px solid var(--c-black);
  padding: 3px 13px;
  position: relative;
}
.btn.default::before {
  content: "";
  position: absolute;
  inset: 0;
  border-top: 1px solid var(--c-white);
  border-left: 1px solid var(--c-white);
  border-right: 1px solid var(--c-grey-dark);
  border-bottom: 1px solid var(--c-grey-dark);
  pointer-events: none;
}

/* ===== Inputs ===== */
.field {
  background: var(--c-white);
  border-top: 1px solid var(--c-grey-dark);
  border-left: 1px solid var(--c-grey-dark);
  border-right: 1px solid var(--c-white);
  border-bottom: 1px solid var(--c-white);
  box-shadow: inset 1px 1px 0 var(--c-black), inset -1px -1px 0 var(--c-grey-light);
  padding: 2px 4px;
  font-family: inherit;
  font-size: 11px;
  outline: none;
}
.field:focus { background: #fffff0; }
textarea.field { resize: none; }

/* checkbox & radio */
.checkbox, .radio {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  cursor: pointer;
}
.checkbox input, .radio input { display: none; }
.cb-box {
  width: 13px;
  height: 13px;
  background: var(--c-white);
  border-top: 1px solid var(--c-grey-dark);
  border-left: 1px solid var(--c-grey-dark);
  border-right: 1px solid var(--c-white);
  border-bottom: 1px solid var(--c-white);
  box-shadow: inset 1px 1px 0 var(--c-black);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: bold;
  line-height: 1;
}
.checkbox input:checked + .cb-box::after {
  content: "x";
  color: var(--c-black);
  font-family: "Pixelated MS Sans Serif", monospace;
  margin-top: -2px;
}

/* ===== Group box (fieldset) ===== */
.group {
  border-top: 1px solid var(--c-grey-dark);
  border-left: 1px solid var(--c-grey-dark);
  border-right: 1px solid var(--c-white);
  border-bottom: 1px solid var(--c-white);
  box-shadow: 1px 1px 0 var(--c-grey-light) inset;
  padding: 14px 10px 10px;
  margin-top: 6px;
  position: relative;
}
.group > legend {
  position: absolute;
  top: -7px;
  left: 8px;
  background: var(--c-grey);
  padding: 0 4px;
  font-size: 11px;
}

/* ===== Listing (File Manager-style rows) ===== */
.listing {
  background: var(--c-white);
  height: 100%;
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  overflow: auto;            /* single scroll container, both axes */
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}

/* ===== Secondary filter bar (faceted dropdowns) — mobile fallback only ===== */
.filter-bar {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 3px 6px;
  background: var(--c-grey);
  border-bottom: 1px solid var(--c-grey-dark);
  border-top: 1px solid var(--c-white);
  font-size: 11px;
  flex-wrap: wrap;
}
.filter-bar--mobile { display: none; } /* hidden on desktop; tree is the filter UI */
.filter-label {
  font-size: 11px;
  color: #000;
  margin-left: 4px;
}
.filter-select {
  font-size: 11px;
  padding: 1px 2px;
  min-width: 90px;
  max-width: 160px;
}
.listing-head {
  display: grid;
  grid-template-columns: 28px 1.6fr 1.1fr 0.9fr 1.3fr 0.7fr 90px;
  background: var(--c-grey);
  border-bottom: 1px solid var(--c-grey-dark);
  font-size: 11px;
  position: sticky;          /* stay visible while scrolling vertically */
  top: 0;
  z-index: 3;
}
.listing-head > div {
  padding: 3px 6px;
  border-right: 1px solid var(--c-grey-dark);
  background: var(--c-grey);
  border-top: 1px solid var(--c-white);
  border-left: 1px solid var(--c-white);
  border-bottom: 1px solid var(--c-grey-dark);
  cursor: pointer;
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  position: relative;
}
.listing-head > div:hover { background: var(--c-grey-light); }
.listing-head > div.sort-asc::after { content: " ▲"; font-size: 9px; }
.listing-head > div.sort-desc::after { content: " ▼"; font-size: 9px; }
.col-resizer {
  position: absolute;
  top: 0;
  right: -3px;
  width: 6px;
  height: 100%;
  cursor: col-resize;
  user-select: none;
  z-index: 2;
  background: transparent;
}
.col-resizer:hover,
.col-resizer.is-dragging {
  background: var(--c-navy);
  opacity: 0.5;
}
body.col-resizing,
body.col-resizing * {
  cursor: col-resize !important;
  user-select: none !important;
}

.listing-rows {
  flex: 1;
  background: var(--c-white);
}
.row {
  display: grid;
  grid-template-columns: 28px 1.6fr 1.1fr 0.9fr 1.3fr 0.7fr 90px;
  font-size: 11px;
  cursor: pointer;
  border-bottom: 1px dotted #e8e8e8;
}
.row > div {
  padding: 3px 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: flex;
  align-items: center;
}
.row .ico { padding: 2px 0 2px 6px; }
.row.selected {
  background: var(--c-navy);
  color: var(--c-white);
}
.row.selected a { color: var(--c-white); }
.row a { color: var(--c-navy); text-decoration: underline; }
.row .verified {
  color: var(--c-green);
  font-weight: bold;
}
.row.selected .verified { color: var(--c-yellow); }

/* Folder tree column on left of MSP listing */
.tree-col {
  width: 190px;
  background: var(--c-white);
  border-right: 1px solid var(--c-grey-dark);
  flex-shrink: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 6px 4px;
  font-size: 11px;
}
.tree-node {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 1px 3px;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tree-node.active { background: var(--c-navy); color: var(--c-white); }
.tree-node img { width: 16px; height: 16px; image-rendering: pixelated; }
.tree-node > svg,
.tree-node > img,
.tree-group-head > svg,
.tree-group-head > img { flex: 0 0 auto; }

/* Faceted-folder groups (Region / Industry / Size) */
.tree-group-head {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 1px 3px;
  cursor: pointer;
  font-weight: bold;
  user-select: none;
}
.tree-group-head:hover { background: var(--c-grey); }
.tree-chev {
  display: inline-block;
  width: 10px;
  font-size: 9px;
  text-align: center;
  color: #000;
}
.tree-group-label {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tree-clear {
  border: 1px solid var(--c-grey-dark);
  background: var(--c-grey);
  font-size: 10px;
  line-height: 1;
  padding: 0 4px;
  cursor: pointer;
  font-family: inherit;
}
.tree-clear:hover { background: var(--c-white); }
.tree-children {
  padding-left: 14px;
}
.tree-children .tree-node { font-weight: normal; }

/* ===== Toolbar (drive icons / view toggles) ===== */
.toolbar {
  display: flex;
  gap: 4px;
  padding: 4px;
  background: var(--c-grey);
  border-bottom: 1px solid var(--c-grey-dark);
  align-items: center;
  flex-shrink: 0;
  flex-wrap: wrap;
}
.tool-btn {
  background: var(--c-grey);
  border-top: 1px solid var(--c-white);
  border-left: 1px solid var(--c-white);
  border-right: 1px solid var(--c-grey-dark);
  border-bottom: 1px solid var(--c-grey-dark);
  box-shadow: inset -1px -1px 0 var(--c-black);
  padding: 2px 6px;
  font-size: 11px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.tool-btn.pressed,
.tool-btn:active {
  border-color: var(--c-grey-dark) var(--c-white) var(--c-white) var(--c-grey-dark);
  box-shadow: inset 1px 1px 0 var(--c-black);
}
.tool-divider { width: 1px; align-self: stretch; background: var(--c-grey-dark); margin: 0 4px; box-shadow: 1px 0 0 var(--c-white); }

/* ===== Clock window ===== */
.clock-window { width: 130px; }
.clock-face {
  width: 100%;
  aspect-ratio: 1 / 1;
  background: var(--c-white);
  border-top: 1px solid var(--c-grey-dark);
  border-left: 1px solid var(--c-grey-dark);
  border-right: 1px solid var(--c-white);
  border-bottom: 1px solid var(--c-white);
  box-shadow: inset 1px 1px 0 var(--c-black);
  position: relative;
  margin: 4px;
  width: calc(100% - 8px);
}

/* ===== Program Manager group icons ===== */
.pm-group {
  background: var(--c-grey);
  display: grid;
  grid-template-columns: repeat(auto-fill, 84px);
  gap: 8px;
  padding: 12px;
  align-content: start;
  height: 100%;
  overflow: auto;
}
.pm-icon {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  padding: 4px;
  width: 84px;
  text-align: center;
  font-size: 11px;
}
.pm-icon img { width: 32px; height: 32px; image-rendering: pixelated; }
.pm-icon .label {
  text-align: center;
  line-height: 1.1;
  word-break: break-word;
}
.pm-icon.selected .label {
  background: var(--c-navy);
  color: var(--c-white);
  padding: 0 2px;
}

/* MDI client area */
.mdi {
  flex: 1;
  background: #888;
  /* checkered desktop pattern */
  background-image:
    repeating-conic-gradient(#787878 0 25%, #888 0 50%);
  background-size: 2px 2px;
  position: relative;
  overflow: hidden;
}

/* ===== Taskbar (bottom) ===== */
.taskbar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 28px;
  background: var(--c-grey);
  border-top: 2px solid var(--c-white);
  box-shadow: inset 1px 1px 0 var(--c-grey-light);
  display: flex;
  align-items: center;
  padding: 2px 4px;
  gap: 3px;
  z-index: 9999;
  font-size: 11px;
}
.start-btn {
  background: var(--c-grey);
  border-top: 1px solid var(--c-white);
  border-left: 1px solid var(--c-white);
  border-right: 1px solid var(--c-grey-dark);
  border-bottom: 1px solid var(--c-grey-dark);
  box-shadow: inset -1px -1px 0 var(--c-black), inset 1px 1px 0 var(--c-grey-light);
  font-weight: bold;
  padding: 2px 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  height: 22px;
}
.start-btn.pressed {
  border-color: var(--c-grey-dark) var(--c-white) var(--c-white) var(--c-grey-dark);
  box-shadow: inset 1px 1px 0 var(--c-black);
}
.task-btn {
  background: var(--c-grey);
  border-top: 1px solid var(--c-white);
  border-left: 1px solid var(--c-white);
  border-right: 1px solid var(--c-grey-dark);
  border-bottom: 1px solid var(--c-grey-dark);
  box-shadow: inset -1px -1px 0 var(--c-black);
  height: 22px;
  padding: 2px 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  min-width: 130px;
  max-width: 170px;
  white-space: nowrap;
  overflow: hidden;
}
.task-btn.active {
  border-color: var(--c-grey-dark) var(--c-white) var(--c-white) var(--c-grey-dark);
  box-shadow: inset 1px 1px 0 var(--c-black);
  background-image:
    repeating-linear-gradient(45deg, var(--c-white) 0 1px, transparent 1px 2px);
}
.tray {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 2px 6px;
  border-top: 1px solid var(--c-grey-dark);
  border-left: 1px solid var(--c-grey-dark);
  border-right: 1px solid var(--c-white);
  border-bottom: 1px solid var(--c-white);
  box-shadow: inset 1px 1px 0 var(--c-black);
  height: 22px;
}
.tray-sound {
  appearance: none;
  -webkit-appearance: none;
  font: inherit;
  font-family: "VT323", monospace;
  font-size: 16px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 18px;
  padding: 0;
  margin-right: 2px;
  cursor: pointer;
  color: var(--c-black);
  background: var(--c-grey);
  border-top: 1px solid var(--c-grey-dark);
  border-left: 1px solid var(--c-grey-dark);
  border-right: 1px solid var(--c-white);
  border-bottom: 1px solid var(--c-white);
  box-shadow: inset 1px 1px 0 var(--c-black);
}
.tray-sound:focus-visible {
  outline: 1px dotted var(--c-black);
  outline-offset: -3px;
}
.tray-sound:active {
  border-color: var(--c-grey-dark) var(--c-white) var(--c-white) var(--c-grey-dark);
}
.tray-sound.is-off {
  color: var(--c-grey-dark);
  background-image: repeating-linear-gradient(45deg, var(--c-grey) 0 2px, var(--c-grey-dark) 2px 3px);
}
.tray-sound__glyph { display: inline-block; transform: translateY(-1px); }
.tray-sound__sr {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

/* ===== Start menu ===== */
.start-menu {
  position: fixed;
  bottom: 28px;
  left: 4px;
  width: 200px;
  background: var(--c-grey);
  border-top: 2px solid var(--c-white);
  border-left: 2px solid var(--c-white);
  border-right: 2px solid var(--c-black);
  border-bottom: 2px solid var(--c-black);
  box-shadow: inset -1px -1px 0 var(--c-grey-dark), 2px 2px 0 rgba(0,0,0,0.4);
  z-index: 10000;
  display: flex;
  font-size: 11px;
}
.start-side {
  width: 22px;
  background: var(--c-grey-dark);
  background: linear-gradient(to top, var(--c-grey-dark), #555);
  color: var(--c-white);
  font-weight: bold;
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  display: flex;
  align-items: center;
  justify-content: flex-start;
  padding: 8px 0;
  font-size: 16px;
  letter-spacing: 1px;
  font-family: "Pixelated MS Sans Serif", sans-serif;
}
.start-side b { color: var(--c-white); }
.start-list { flex: 1; padding: 2px; }
.start-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 6px;
  cursor: pointer;
}
.start-row img { width: 22px; height: 22px; image-rendering: pixelated; }
.start-row:hover { background: var(--c-navy); color: var(--c-white); }
.start-sep { height: 0; border-top: 1px solid var(--c-grey-dark); border-bottom: 1px solid var(--c-white); margin: 2px 4px; }

/* ===== BSOD ===== */
.bsod {
  position: fixed;
  inset: 0;
  background: var(--c-navy);
  color: var(--c-white);
  font-family: "VT323", "Courier New", monospace;
  font-size: 22px;
  padding: 60px 80px;
  z-index: 99999;
  line-height: 1.4;
}
.bsod h1 {
  background: var(--c-white);
  color: var(--c-navy);
  display: inline-block;
  padding: 0 8px;
  margin: 0 0 24px 0;
  font-size: 22px;
  font-weight: bold;
}
.bsod-cursor::after {
  content: "_";
  animation: blink 1s steps(2) infinite;
}
@keyframes blink { 50% { opacity: 0; } }

/* ===== Boot screen ===== */
.boot {
  position: fixed;
  inset: 0;
  background: var(--c-black);
  color: var(--c-white);
  font-family: "VT323", monospace;
  font-size: 22px;
  z-index: 99998;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
}
.boot-logo {
  width: 320px;
  margin-bottom: 24px;
}
.boot-text {
  height: 24px;
  font-family: "VT323", monospace;
}
.boot-bar-wrap {
  margin-top: 16px;
  width: 280px;
  height: 16px;
  background: var(--c-black);
  border: 1px solid var(--c-white);
  padding: 1px;
}
.boot-bar { height: 100%; background: var(--c-white); width: 0; transition: width 0.2s linear; }

/* ===== Misc ===== */
.dither-h-sep {
  height: 2px;
  border-top: 1px solid var(--c-grey-dark);
  border-bottom: 1px solid var(--c-white);
  margin: 6px 0;
}
.dither-v-sep {
  width: 2px;
  align-self: stretch;
  border-left: 1px solid var(--c-grey-dark);
  border-right: 1px solid var(--c-white);
  margin: 0 4px;
}

.kbd {
  display: inline-block;
  padding: 0 4px;
  background: var(--c-grey);
  border-top: 1px solid var(--c-white);
  border-left: 1px solid var(--c-white);
  border-right: 1px solid var(--c-grey-dark);
  border-bottom: 1px solid var(--c-grey-dark);
  font-size: 10px;
}

a.win-link {
  color: var(--c-navy);
  text-decoration: underline;
  cursor: pointer;
}
a.win-link:visited { color: var(--c-purple); }

.help-body, .help-body * { user-select: text; -webkit-user-select: text; cursor: auto; }
.help-body .topic-bar, .help-body .topic-bar * { user-select: none; -webkit-user-select: none; cursor: default; }
.help-body {
  background: var(--c-white);
  padding: 20px 28px;
  font-family: "Times New Roman", "W31", serif;
  font-size: 14px;
  line-height: 1.5;
  color: var(--c-black);
  height: 100%;
  overflow: auto;
}
.help-body h1 {
  font-size: 20px;
  margin-bottom: 8px;
  font-weight: bold;
}
.help-body h2 {
  font-size: 16px;
  margin: 18px 0 6px;
  font-weight: bold;
}
.help-body p { margin-bottom: 10px; }
.help-body ul { margin: 4px 0 12px 22px; }
.help-body li { margin-bottom: 4px; }
.help-body .topic-bar {
  background: var(--c-grey);
  font-family: "Pixelated MS Sans Serif", sans-serif;
  padding: 4px 8px;
  margin: -20px -28px 16px -28px;
  border-bottom: 1px solid var(--c-grey-dark);
  display: flex;
  gap: 4px;
}
.tool-detail-body {
  height: auto;
  padding: 16px 22px;
  margin-top: 8px;
  border: 1px solid var(--c-grey-dark);
}
.tool-detail-body > h2:first-child { margin-top: 0; }
.tool-detail-body ul { margin: 4px 0 12px 22px; padding: 0; }
.tool-detail-body li { margin-bottom: 4px; }

/* search row */
.search-row {
  display: flex;
  gap: 6px;
  align-items: center;
  padding: 4px 6px;
  background: var(--c-grey);
  border-bottom: 1px solid var(--c-grey-dark);
  flex-wrap: wrap;
}

/* about box */
.about-row {
  display: flex;
  gap: 12px;
  padding: 12px;
  align-items: flex-start;
}

.solitaire-card {
  width: 36px;
  height: 50px;
  background: var(--c-white);
  border: 1px solid var(--c-black);
  border-radius: 0;
  display: inline-flex;
  flex-direction: column;
  padding: 2px 3px;
  font-family: serif;
  font-size: 11px;
  line-height: 1;
  color: var(--c-red);
}

/* tweaks panel host overrides — keep period look */
.tweaks-panel {
  font-family: "Pixelated MS Sans Serif", sans-serif !important;
}

/* ============================================================
   MOBILE SHELL (≤ 767px)
   Reuses existing window contents, swaps the desktop chrome for
   a phone-friendly full-screen + bottom-tab layout.
   ============================================================ */
@media (max-width: 767px) {
  html, body {
    font-size: 13px;
    -webkit-text-size-adjust: 100%;
  }

  /* Kill the teal desktop background — windows go full-bleed. */
  .desktop {
    background: var(--c-grey);
  }

  /* Hide desktop icons, classic taskbar, start menu, tray, etc. */
  .desktop-icons,
  .taskbar,
  .start-menu,
  .tray,
  .dither-v-sep {
    display: none !important;
  }

  /* Hide the floating Clock window entirely (we surface time in mobile nav). */
  .window[data-screen-label="clock"] {
    display: none !important;
  }

  /* Every window: full-screen panel above the mobile bottom nav. */
  .window {
    position: fixed !important;
    inset: 0 !important;
    width: 100% !important;
    height: auto !important;
    bottom: 56px !important;        /* leave room for mobile nav */
    border: none;
    box-shadow: none;
    background: var(--c-grey);
    display: flex;
    flex-direction: column;
  }
  .window.maximized { /* same as default on mobile */
    inset: 0 !important;
    bottom: 56px !important;
  }
  .window.minimized { display: none !important; }

  /* Titlebar becomes a slim app bar — keep close button as Back. */
  .titlebar {
    padding: 0 6px;
    height: 32px;
    font-size: 13px;
    touch-action: pan-y;
  }
  .titlebar .title {
    font-size: 13px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  /* Hide minimize + maximize on mobile; keep close (system menu acts as back). */
  .tb-btn {
    width: 32px;
    height: 28px;
    min-width: 32px;
  }
  .tb-controls .tb-btn:nth-child(1),  /* minimize */
  .tb-controls .tb-btn:nth-child(2) { /* maximize */
    display: none;
  }
  .tb-btn.system {
    width: 32px;
    height: 28px;
    margin-right: 4px;
  }
  .tb-btn.system .glyph,
  .tb-btn.system > span {
    width: 16px !important;
    height: 3px !important;
  }

  /* Menubar — make it horizontally scrollable instead of wrapping. */
  .menubar {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    flex-wrap: nowrap;
    white-space: nowrap;
  }
  .menu-item { padding: 6px 10px; font-size: 12px; }

  /* Status bar takes too much room — hide secondary cells. */
  .statusbar { font-size: 11px; padding: 2px 4px; }
  .statusbar .status-cell:nth-child(n+3) { display: none; }

  /* MSP Index toolbar: wrap, larger tap targets. */
  .toolbar {
    flex-wrap: wrap;
    gap: 4px;
    padding: 6px;
  }
  .tool-btn {
    height: 32px;
    padding: 4px 10px;
    font-size: 12px;
  }
  .tool-divider { display: none; }
  .toolbar > div:last-child { /* "Find:" search row */
    margin-left: 0 !important;
    width: 100%;
  }
  .toolbar input.field {
    width: 100% !important;
    flex: 1;
    min-height: 32px;
    font-size: 16px; /* prevent iOS zoom */
  }

  /* MSP Index body: hide the tree column, listing becomes single-column cards. */
  .tree-col { display: none !important; }
  .filter-bar--mobile { display: flex !important; }

  .listing { border: none; overflow: hidden; } /* mobile: rows scroll, listing doesn't */
  .listing-head {
    display: none !important; /* table headers don't make sense as cards */
  }
  .listing-rows {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 8px;
    background: var(--c-grey);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }
  .row {
    display: grid !important;
    min-width: 0 !important;          /* override inline desktop min-width */
    grid-template-columns: 28px 1fr auto !important;
    grid-template-areas:
      "ico  name  badge"
      ".    loc   loc"
      ".    desc  desc"
      ".    meta  meta";
    gap: 2px 8px;
    padding: 10px 12px;
    background: var(--c-white);
    border-top: 1px solid var(--c-white);
    border-left: 1px solid var(--c-white);
    border-right: 1px solid var(--c-grey-dark);
    border-bottom: 1px solid var(--c-grey-dark);
    box-shadow: 1px 1px 0 var(--c-black);
    min-height: 64px;
    cursor: pointer;
    align-items: start;
  }
  .row:hover { background: var(--c-white); } /* no hover on touch */
  .row.selected {
    background: #e6e6ff;
    color: var(--c-black);
  }
  .row.selected a { color: var(--c-navy); }
  .row > div:nth-child(1) { grid-area: ico; padding: 2px 0 0 0; }
  .row > div:nth-child(2) { grid-area: name; font-size: 14px; }
  .row > div:nth-child(3) { grid-area: loc;  font-size: 11px; color: var(--c-grey-text); }
  .row > div:nth-child(4) { grid-area: meta; font-size: 11px; color: var(--c-grey-text); }
  .row > div:nth-child(5) { grid-area: desc; font-size: 12px; color: #333; line-height: 1.35; }
  .row > div:nth-child(6),
  .row > div:nth-child(7) { display: none; } /* staff + date hidden on cards */
  .row .verified { font-size: 12px; }

  /* Program Manager icon view — bigger tiles. */
  .pm-group {
    grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
    gap: 12px;
    padding: 12px;
  }
  .pm-icon { width: auto; padding: 8px 4px; }
  .pm-icon img,
  .pm-icon svg { width: 40px; height: 40px; }

  /* All inputs: prevent iOS zoom and add tap target padding. */
  .field, input, textarea, select {
    font-size: 16px !important;
    min-height: 32px;
  }
  textarea.field { min-height: 80px; }

  /* Generic buttons: make them tappable. */
  .btn {
    min-height: 32px;
    padding: 6px 14px;
    font-size: 13px;
  }

  /* Window body padding & momentum scroll. */
  .window-body {
    -webkit-overflow-scrolling: touch;
  }
  .window-body.padded { padding: 12px; }

  /* Help / about / contact text: a touch larger for readability. */
  .help-body { font-size: 15px; padding: 16px 18px; }
  .help-body .topic-bar { margin: -16px -18px 14px -18px; padding: 8px; }

  /* About / contact rows: stack vertically. */
  .about-row { flex-direction: column; align-items: stretch; gap: 8px; }

  /* Search row inside windows */
  .search-row { padding: 8px; gap: 8px; }
  .search-row .field { width: 100% !important; }

  /* ============= Mobile bottom nav ============= */
  .mobile-nav {
    position: fixed;
    bottom: 0; left: 0; right: 0;
    height: 56px;
    background: var(--c-grey);
    border-top: 2px solid var(--c-white);
    box-shadow: inset 0 1px 0 var(--c-grey-light);
    display: flex;
    z-index: 99999;
    padding: 4px;
    gap: 2px;
  }
  .mobile-nav button {
    flex: 1;
    background: var(--c-grey);
    border-top: 1px solid var(--c-white);
    border-left: 1px solid var(--c-white);
    border-right: 1px solid var(--c-grey-dark);
    border-bottom: 1px solid var(--c-grey-dark);
    box-shadow: inset -1px -1px 0 var(--c-black);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    padding: 4px 2px;
    font-family: inherit;
    font-size: 10px;
    cursor: pointer;
    color: var(--c-black);
    line-height: 1;
    touch-action: manipulation;
  }
  .mobile-nav button .mn-glyph {
    font-size: 18px;
    line-height: 1;
    font-family: "VT323", monospace;
  }
  .mobile-nav button.active {
    border-color: var(--c-grey-dark) var(--c-white) var(--c-white) var(--c-grey-dark);
    box-shadow: inset 1px 1px 0 var(--c-black);
    background-image: repeating-linear-gradient(
      45deg, var(--c-white) 0 1px, transparent 1px 2px
    );
  }
  .mobile-nav button:active {
    border-color: var(--c-grey-dark) var(--c-white) var(--c-white) var(--c-grey-dark);
    box-shadow: inset 1px 1px 0 var(--c-black);
  }

  /* Mobile sheet (More tab) */
  .mobile-sheet {
    position: fixed;
    bottom: 56px; left: 0; right: 0;
    background: var(--c-grey);
    border-top: 2px solid var(--c-white);
    box-shadow: 0 -4px 0 rgba(0,0,0,0.15);
    z-index: 99998;
    padding: 8px;
    display: flex;
    flex-direction: column;
    gap: 4px;
  }
  .mobile-sheet .sheet-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 10px;
    background: var(--c-grey);
    border-top: 1px solid var(--c-white);
    border-left: 1px solid var(--c-white);
    border-right: 1px solid var(--c-grey-dark);
    border-bottom: 1px solid var(--c-grey-dark);
    box-shadow: inset -1px -1px 0 var(--c-black);
    font-size: 14px;
    cursor: pointer;
    touch-action: manipulation;
  }
  .mobile-sheet .sheet-row .mn-glyph {
    font-size: 18px;
    width: 24px;
    text-align: center;
  }

  /* Hide all touch-disable focus dotted outlines on mobile. */
  .desktop-icon:focus,
  .row:focus { outline: none; }

  /* BSOD: shrink padding so it fits a phone. */
  .bsod { padding: 24px 18px; font-size: 16px; }
  .bsod h1 { font-size: 18px; }

  /* Solitaire is desktop-only — show a polite message instead. */
  .window[data-screen-label="solitaire"] .window-body::after {
    /* purely additive — content unchanged */
  }
}

/* Touch refinements regardless of viewport */
@media (hover: none) {
  .desktop-icon:focus { outline: none; }
  .row { cursor: default; }
}

/* Mobile swipe-to-close affordance */
@media (max-width: 767px) {
  .window {
    will-change: transform, opacity;
  }
  /* Subtle left-edge "back" hint chevron — only on stacked windows (not the home Index). */
  .desktop > .window:not([data-screen-label="msp"]):last-of-type::before {
    content: "";
    position: absolute;
    left: 0;
    top: 50%;
    width: 3px;
    height: 48px;
    transform: translateY(-50%);
    background: var(--c-grey-dark);
    box-shadow: 1px 0 0 var(--c-white);
    border-radius: 0 2px 2px 0;
    opacity: 0.5;
    pointer-events: none;
    z-index: 1;
  }
  .titlebar { cursor: grab; }
}

/* Mobile swipe-to-dismiss hint (one-shot, first window opened) */
@media (max-width: 767px) {
  .swipe-hint {
    position: fixed;
    top: 32px;        /* sits just under the slim mobile titlebar */
    left: 0; right: 0;
    height: 64px;
    z-index: 100000;
    pointer-events: auto;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    background: linear-gradient(
      to right,
      rgba(0, 0, 128, 0.18) 0%,
      rgba(0, 0, 128, 0.08) 40%,
      rgba(0, 0, 128, 0) 80%
    );
    animation: swipeHintFade 3.4s ease-out forwards;
  }
  .swipe-hint__finger {
    width: 28px;
    height: 28px;
    margin-left: 14px;
    border-radius: 50%;
    background: var(--c-white);
    border: 2px solid var(--c-navy);
    box-shadow:
      0 0 0 4px rgba(0, 0, 128, 0.18),
      1px 1px 0 var(--c-black);
    animation: swipeHintFinger 1.4s ease-in-out 0.15s 2;
    transform-origin: center;
  }
  .swipe-hint__label {
    margin-left: 14px;
    padding: 4px 8px;
    background: var(--c-navy);
    color: var(--c-white);
    font-family: "Pixelated MS Sans Serif", sans-serif;
    font-size: 12px;
    box-shadow: 1px 1px 0 var(--c-black);
    animation: swipeHintLabel 3.4s ease-out forwards;
  }

  @keyframes swipeHintFinger {
    0%   { transform: translateX(0)     scale(1);   opacity: 0; }
    10%  { transform: translateX(0)     scale(1.1); opacity: 1; }
    70%  { transform: translateX(160px) scale(1);   opacity: 1; }
    100% { transform: translateX(180px) scale(0.9); opacity: 0; }
  }
  @keyframes swipeHintLabel {
    0%   { opacity: 0; transform: translateX(-4px); }
    10%  { opacity: 1; transform: translateX(0); }
    85%  { opacity: 1; }
    100% { opacity: 0; }
  }
  @keyframes swipeHintFade {
    0%, 90% { opacity: 1; }
    100%    { opacity: 0; }
  }

  @media (prefers-reduced-motion: reduce) {
    .swipe-hint__finger,
    .swipe-hint__label,
    .swipe-hint { animation-duration: 0.01s !important; }
  }
}

/* Bottom-sheet drag handle (mobile) */
@media (max-width: 767px) {
  .mobile-sheet {
    will-change: transform, opacity;
    touch-action: pan-y;          /* allow vertical drag, never horizontal pan */
  }
  .sheet-handle {
    align-self: stretch;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px 0 6px;
    cursor: grab;
    touch-action: none;           /* handle owns the gesture entirely */
    user-select: none;
  }
  .sheet-handle:active { cursor: grabbing; }
  .sheet-handle__bar {
    display: block;
    width: 44px;
    height: 4px;
    background: var(--c-grey-dark);
    border-top: 1px solid var(--c-white);
    border-bottom: 1px solid var(--c-black);
  }
}

/* More-sheet settings section + Win95-style toggle switch */
@media (max-width: 767px) {
  .sheet-section {
    margin: 8px 4px 2px;
    padding: 0 6px;
    font-size: 10px;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: var(--c-grey-text);
    border-bottom: 1px solid var(--c-grey-dark);
    box-shadow: 0 1px 0 var(--c-white);
    padding-bottom: 2px;
  }
  .sheet-row--toggle {
    align-items: center;
  }
  .sheet-row__main {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1;
    min-width: 0;
  }
  .sheet-row__label {
    font-size: 14px;
    line-height: 1.1;
  }
  .sheet-row__hint {
    font-size: 11px;
    color: var(--c-grey-text);
    line-height: 1.25;
  }
  .sheet-toggle {
    flex-shrink: 0;
    position: relative;
    width: 56px;
    height: 24px;
    background: var(--c-grey);
    border-top: 1px solid var(--c-grey-dark);
    border-left: 1px solid var(--c-grey-dark);
    border-right: 1px solid var(--c-white);
    border-bottom: 1px solid var(--c-white);
    box-shadow: inset 1px 1px 0 var(--c-black);
    display: flex;
    align-items: center;
    padding: 1px;
  }
  .sheet-toggle__knob {
    position: absolute;
    top: 1px;
    bottom: 1px;
    width: 26px;
    background: var(--c-grey);
    border-top: 1px solid var(--c-white);
    border-left: 1px solid var(--c-white);
    border-right: 1px solid var(--c-grey-dark);
    border-bottom: 1px solid var(--c-grey-dark);
    box-shadow: inset -1px -1px 0 var(--c-black);
    transition: left 140ms ease-out;
  }
  .sheet-toggle.is-on  .sheet-toggle__knob { left: 28px; }
  .sheet-toggle.is-off .sheet-toggle__knob { left: 1px; }
  .sheet-toggle__label {
    width: 100%;
    text-align: center;
    font-family: "Pixelated MS Sans Serif", sans-serif;
    font-size: 9px;
    font-weight: bold;
    letter-spacing: 1px;
    color: var(--c-black);
    z-index: 0;
    user-select: none;
  }
  .sheet-toggle.is-on  .sheet-toggle__label { padding-right: 28px; color: var(--c-navy); }
  .sheet-toggle.is-off .sheet-toggle__label { padding-left: 28px; color: var(--c-grey-dark); }
}

/* Crawl-only navigation: invisible to users, present for search engines. */
.seo-links {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

/* ===== Empty directory state ===== */
.empty-dir {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 20px 16px;
  width: 100%;
}
.empty-dir__panel {
  width: 100%;
  max-width: 460px;
  background: var(--c-grey);
  padding: 18px 20px 16px;
  border-top: 1px solid var(--c-white);
  border-left: 1px solid var(--c-white);
  border-right: 1px solid var(--c-grey-dark);
  border-bottom: 1px solid var(--c-grey-dark);
  box-shadow:
    inset 1px 1px 0 var(--c-white),
    inset -1px -1px 0 var(--c-black),
    2px 2px 0 var(--c-black);
  text-align: left;
  color: var(--c-black);
  font-size: 12px;
  line-height: 1.5;
}
.empty-dir__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
  margin: 0 0 10px;
  background: var(--c-white);
  border: 1px solid var(--c-black);
  box-shadow: inset -1px -1px 0 var(--c-grey-dark);
}
.empty-dir__title {
  margin: 0 0 6px;
  font-family: "VT323", monospace;
  font-size: 20px;
  font-weight: bold;
  letter-spacing: 0.02em;
}
.empty-dir__lede {
  margin: 0 0 12px;
  color: #222;
}
.empty-dir__steps {
  margin: 0 0 14px;
  padding: 8px 10px 8px 28px;
  background: var(--c-white);
  border: 1px solid var(--c-black);
  box-shadow: inset 1px 1px 0 var(--c-grey-dark);
}
.empty-dir__steps li { margin: 2px 0; }
.empty-dir__actions {
  display: flex;
  gap: 8px;
  margin: 0 0 10px;
}
.empty-dir__cta {
  font-weight: bold;
  padding: 6px 14px;
}
.empty-dir__foot {
  margin: 0;
  font-size: 11px;
  color: #555;
}

/* ===========================================================================
   Excel 4 / Win 3.1 dashboard window
   =========================================================================== */
.xl-root {
  display: flex;
  flex-direction: column;
  height: 100%;
  background: var(--c-grey, #c0c0c0);
  font-family: "Pixelated MS Sans Serif", "W31", "Microsoft Sans Serif", "Tahoma", sans-serif;
  font-size: 11px;
  color: #000;
}

/* ----- Toolbars ----- */
.xl-toolbar {
  display: flex;
  align-items: center;
  gap: 0;
  padding: 2px 4px;
  background: var(--c-grey, #c0c0c0);
  border-bottom: 1px solid #fff;
  box-shadow: 0 1px 0 #808080;
}
.xl-toolbar--row2 { box-shadow: 0 1px 0 #808080, inset 0 1px 0 #fff; }
.xl-tool {
  width: 22px;
  height: 22px;
  margin-right: 1px;
  padding: 0;
  background: var(--c-grey, #c0c0c0);
  border-top:    1px solid #fff;
  border-left:   1px solid #fff;
  border-right:  1px solid #808080;
  border-bottom: 1px solid #808080;
  cursor: default;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: inherit;
}
.xl-tool:active {
  border-top:    1px solid #808080;
  border-left:   1px solid #808080;
  border-right:  1px solid #fff;
  border-bottom: 1px solid #fff;
}
.xl-tool-glyph {
  font-size: 13px;
  line-height: 1;
  pointer-events: none;
}
.xl-tool-gap {
  display: inline-block;
  width: 1px;
  height: 18px;
  background: #808080;
  margin: 0 4px;
  box-shadow: 1px 0 0 #fff;
}
.xl-tool-combo {
  height: 20px;
  margin-left: 4px;
  padding: 1px 4px;
  width: 96px;
  font-family: inherit;
  font-size: 11px;
  background: #fff;
  border-top:    1px solid #808080;
  border-left:   1px solid #808080;
  border-right:  1px solid #fff;
  border-bottom: 1px solid #fff;
}
.xl-tool-combo--small { width: 36px; }

/* ----- Formula bar ----- */
.xl-formulabar {
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 2px 4px;
  background: var(--c-grey, #c0c0c0);
  border-bottom: 1px solid #808080;
  box-shadow: inset 0 1px 0 #fff;
}
.xl-cellref {
  width: 96px;
  height: 18px;
  padding: 0 6px;
  display: flex;
  align-items: center;
  background: #fff;
  border-top:    1px solid #808080;
  border-left:   1px solid #808080;
  border-right:  1px solid #fff;
  border-bottom: 1px solid #fff;
  font-size: 11px;
}
.xl-fb-btn {
  width: 20px;
  height: 20px;
  padding: 0;
  background: var(--c-grey, #c0c0c0);
  border-top:    1px solid #fff;
  border-left:   1px solid #fff;
  border-right:  1px solid #808080;
  border-bottom: 1px solid #808080;
  font-family: inherit;
  font-size: 11px;
  cursor: default;
}
.xl-formula {
  flex: 1;
  height: 20px;
  padding: 0 4px;
  background: #fff;
  border-top:    1px solid #808080;
  border-left:   1px solid #808080;
  border-right:  1px solid #fff;
  border-bottom: 1px solid #fff;
  font-family: inherit;
  font-size: 11px;
  color: #000;
}

/* ----- Sheet area ----- */
.xl-sheet {
  flex: 1;
  position: relative;
  background: #fff;
  border-top:    1px solid #808080;
  border-left:   1px solid #808080;
  border-right:  1px solid #fff;
  border-bottom: 1px solid #fff;
  margin: 2px;
  overflow: hidden;
  padding: 12px 16px 8px 16px;
}

/* ----- Floating Chart palette ----- */
.xl-chartpal {
  position: absolute;
  top: 8px;
  right: 8px;
  background: var(--c-grey, #c0c0c0);
  border-top:    1px solid #fff;
  border-left:   1px solid #fff;
  border-right:  1px solid #404040;
  border-bottom: 1px solid #404040;
  box-shadow: 1px 1px 0 #000;
  z-index: 2;
  user-select: none;
}
.xl-chartpal-tb {
  background: var(--title-active, #000080);
  color: #fff;
  font-size: 10px;
  padding: 1px 6px;
  letter-spacing: 0.5px;
}
.xl-chartpal-body {
  padding: 2px 3px;
  display: flex;
}

/* ----- Chart ----- */
.xl-chart {
  display: grid;
  grid-template-rows: auto 1fr auto auto;
  height: 100%;
}
.xl-chart-title {
  text-align: center;
  font-size: 13px;
  font-weight: bold;
  margin-bottom: 6px;
}
.xl-chart-plotwrap {
  position: relative;
  display: grid;
  grid-template-columns: 50px 1fr;
  min-height: 0;
}
.xl-chart-yaxis {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: flex-end;
  padding-right: 4px;
  font-size: 10px;
  color: #000;
}
.xl-chart-ytick { line-height: 1; }
.xl-chart-ylabel {
  position: absolute;
  left: -4px;
  top: 50%;
  transform: translateY(-50%) rotate(-90deg);
  transform-origin: center;
  font-size: 10px;
  color: #000;
  white-space: nowrap;
}
.xl-chart-plot {
  position: relative;
  background: #fff;
  border: 1px solid #000;
  overflow: hidden;
}
.xl-chart-hatch {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(to right, rgba(192,192,192,0.55) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(192,192,192,0.55) 1px, transparent 1px);
  background-size: 4px 4px;
  pointer-events: none;
}
.xl-chart-grid {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  pointer-events: none;
}
.xl-chart-gridline {
  height: 1px;
  background: #808080;
  opacity: 0.6;
}
.xl-chart-bars {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: flex-end;
  justify-content: space-around;
  padding: 0 6px;
}
.xl-chart-barcol {
  flex: 1 1 0;
  max-width: 56px;
  margin: 0 3px;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
  position: relative;
}
.xl-chart-bar {
  width: 70%;
  border-top:    1px solid #fff;
  border-left:   1px solid #fff;
  border-right:  1px solid #000;
  border-bottom: 1px solid #000;
  /* Faux pixel "pattern fill" to evoke the cross-hatched bars in the screenshot */
  background-image:
    linear-gradient(135deg, rgba(255,255,255,0.35) 25%, transparent 25%, transparent 50%, rgba(255,255,255,0.35) 50%, rgba(255,255,255,0.35) 75%, transparent 75%);
  background-size: 4px 4px;
  background-blend-mode: overlay;
  min-height: 1px;
  transition: height 240ms ease-out;
}
.xl-chart-barval {
  font-size: 9px;
  color: #000;
  margin-bottom: 2px;
  white-space: nowrap;
}
.xl-chart-empty {
  width: 100%;
  text-align: center;
  align-self: center;
  font-style: italic;
  color: #555;
  padding: 24px 0;
}
.xl-chart-xaxis {
  display: grid;
  grid-template-columns: 50px 1fr;
  margin-top: 4px;
}
.xl-chart-xaxis::before { content: ""; }
.xl-chart-xaxis > div {
  display: flex;
  justify-content: space-around;
  padding: 0 6px;
  font-size: 10px;
}
.xl-chart-xaxis > .xl-chart-xtick {
  /* If only one column with multiple ticks rendered as siblings */
}
.xl-chart-xaxis {
  display: grid;
  grid-template-columns: 50px 1fr;
}
.xl-chart-xaxis > .xl-chart-xtick {
  /* fallthrough — overridden by wrapper below */
}
/* Wrapper-less: the JSX renders xticks directly inside xl-chart-xaxis.
   Lay them out across the second column. */
.xl-chart-xaxis {
  grid-template-columns: 50px 1fr;
}
.xl-chart-xaxis > .xl-chart-xtick:first-child {
  grid-column-start: 2;
}
.xl-chart-xaxis > .xl-chart-xtick {
  flex: 1 1 0;
  text-align: center;
  font-size: 10px;
  padding: 0 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 80px;
}
.xl-chart-xlabel {
  text-align: center;
  font-size: 10px;
  margin-top: 4px;
  margin-left: 50px;
}

/* The xtick layout above is wonky because xticks are siblings of yaxis-spacer.
   Override with a flex row that ignores the grid. */
.xl-chart-xaxis {
  display: flex;
  padding-left: 50px;
}
.xl-chart-xaxis > .xl-chart-xtick {
  flex: 1 1 0;
  text-align: center;
}

/* ----- Sheet tab bar ----- */
.xl-tabbar {
  display: flex;
  align-items: center;
  background: var(--c-grey, #c0c0c0);
  border-top: 1px solid #fff;
  padding: 1px 2px;
  gap: 1px;
}
.xl-tabnav {
  width: 18px;
  height: 18px;
  background: var(--c-grey, #c0c0c0);
  border-top:    1px solid #fff;
  border-left:   1px solid #fff;
  border-right:  1px solid #808080;
  border-bottom: 1px solid #808080;
  font-size: 9px;
  padding: 0;
  cursor: default;
}
.xl-tabs {
  display: flex;
  align-items: flex-end;
  margin-left: 4px;
  flex-wrap: nowrap;
  overflow: hidden;
}
.xl-tab {
  font-family: inherit;
  font-size: 11px;
  background: var(--c-grey, #c0c0c0);
  border-top:    1px solid #fff;
  border-left:   1px solid #fff;
  border-right:  1px solid #808080;
  border-bottom: 0;
  padding: 2px 10px;
  margin-right: -1px;
  cursor: default;
  color: #000;
  white-space: nowrap;
}
.xl-tab.is-active {
  background: #fff;
  font-weight: bold;
  padding-top: 4px;
  padding-bottom: 3px;
  position: relative;
  top: -1px;
}
.xl-tabspacer { flex: 1; }
.xl-statusright {
  font-size: 10px;
  padding: 0 8px;
  border-left: 1px solid #808080;
  box-shadow: inset 1px 0 0 #fff;
}

/* ----- Readme/About sheets ----- */
.xl-readme { padding: 4px 8px; font-size: 12px; line-height: 1.45; }
.xl-readme h3 { margin: 0 0 6px 0; font-size: 13px; }
.xl-readme p { margin: 0 0 8px 0; }
.xl-readme ul { margin: 4px 0 8px 18px; padding: 0; }
