/* ═══════════════════════════════════════════════════════════════════════════
   funstuff.app — landing page
   Nostalgic Win95/98 aesthetic, modern underneath
   ═══════════════════════════════════════════════════════════════════════════ */

/* ─── Self-hosted fonts ─── */
@font-face {
  font-family: 'VT323';
  font-style: normal;
  font-weight: 400;
  font-display: block;  /* invisible during load — no fallback swap, no layout shift */
  src: url('/vt323.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;
}

/* ─── Reset & base ─── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
* { touch-action: manipulation; }          /* disable double-tap zoom on iOS */

:root {
  /* Win95 palette */
  --win-bg: #008080;
  --win-silver: #c0c0c0;
  --win-dark: #808080;
  --win-white: #ffffff;
  --win-navy: #000080;
  --win-title: #000080;
  --win-title-text: #ffffff;
  --win-btn-highlight: #dfdfdf;
  --win-btn-shadow: #808080;
  --win-surface: #f5f0e8;

  /* Content */
  --text: #1a1a1a;
  --text-muted: #555;
  --link: #0645ad;
  --link-hover: #0b0080;
  --accent: #e8a735;

  /* Sizing */
  --window-max: 780px;
  --radius: 0px; /* Win95: no rounded corners */
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--win-bg);
  color: var(--text);
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  line-height: 1.6;
}

/* ─── CRT scanline overlay (subtle) ─── */
.crt-lines {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9999;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0, 0, 0, 0.015) 2px,
    rgba(0, 0, 0, 0.015) 4px
  );
}

/* ─── Page layout ─── */
.page {
  position: relative;
  z-index: 300;
  width: 100%;
  max-width: var(--window-max);
  margin: 0 auto;
  padding: 24px 12px 0;
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

/* ═══════════════════════════════════════════════════════════════════════════
   Windows 95–style window chrome
   ═══════════════════════════════════════════════════════════════════════════ */
.app-window {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}

.window {
  background: var(--win-silver);
  border: 2px solid;
  border-color: var(--win-btn-highlight) var(--win-btn-shadow) var(--win-btn-shadow) var(--win-btn-highlight);
  box-shadow:
    inset 1px 1px 0 var(--win-white),
    inset -1px -1px 0 #404040,
    2px 2px 8px rgba(0,0,0,0.25);
}

/* ─── Title bar ─── */
.titlebar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 3px 4px;
  background: linear-gradient(90deg, var(--win-navy), #1084d0);
  color: var(--win-title-text);
  font-family: 'VT323', 'Courier New', monospace;
  font-size: 1.1rem;
  letter-spacing: 0.5px;
  user-select: none;
  cursor: default;
}
.titlebar.inactive {
  background: linear-gradient(90deg, #808080, #b0b0b0);
  color: #d4d0c8;
}

.titlebar-left {
  display: flex;
  align-items: center;
  gap: 6px;
}

.titlebar-icon {
  font-size: 1rem;
}

.titlebar-buttons {
  display: flex;
  gap: 2px;
}

.tb-btn {
  width: 18px;
  height: 18px;
  font-size: 10px;
  font-family: 'VT323', monospace;
  background: var(--win-silver);
  border: 2px solid;
  border-color: var(--win-btn-highlight) var(--win-btn-shadow) var(--win-btn-shadow) var(--win-btn-highlight);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  padding: 0;
  color: #000;
}
.tb-btn:active {
  border-color: var(--win-btn-shadow) var(--win-btn-highlight) var(--win-btn-highlight) var(--win-btn-shadow);
}

/* ─── Main content window ─── */
.main-window {
  margin-top: -2px; /* overlap with titlebar border */
  padding: 24px 28px;
  background: var(--win-surface);
  flex: 1;
  overflow-y: auto;
  min-height: 0;
}

/* ─── Hero ─── */
.hero {
  text-align: center;
  margin-bottom: 8px;
}

.site-title {
  font-family: 'VT323', 'Courier New', monospace;
  font-size: 3.2rem;
  font-weight: 400;
  letter-spacing: 1px;
  color: var(--text);
}

.dot {
  color: var(--accent);
}

.tagline {
  font-family: 'VT323', monospace;
  font-size: 1.05rem;
  color: var(--text-muted);
  margin-top: 4px;
}

/* ─── Dividers ─── */
.divider {
  border: none;
  border-top: 1px solid var(--win-dark);
  border-bottom: 1px solid var(--win-white);
  margin: 24px 0;
}

/* ═══════════════════════════════════════════════════════════════════════════
   DustyTrails project card
   ═══════════════════════════════════════════════════════════════════════════ */
.project-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 16px;
}

.project-name {
  font-family: 'VT323', monospace;
  font-size: 2rem;
  font-weight: 400;
  color: var(--text);
  line-height: 1.1;
}

.project-sub {
  font-size: 0.95rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.project-body p {
  margin-bottom: 14px;
}

.source-list {
  margin: 12px 0 16px 20px;
  list-style: disc;
}

.source-list li {
  margin-bottom: 10px;
  line-height: 1.5;
}

.source-list li strong {
  color: #333;
}

/* ─── Launch button ─── */
.launch-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 24px;
  font-family: 'VT323', monospace;
  font-size: 1.3rem;
  color: var(--win-title-text);
  background: var(--win-navy);
  border: 2px solid;
  border-color: var(--win-btn-highlight) var(--win-btn-shadow) var(--win-btn-shadow) var(--win-btn-highlight);
  text-decoration: none;
  cursor: pointer;
  transition: filter 0.1s;
}

.launch-btn:hover {
  filter: brightness(1.3);
}

.launch-btn:active {
  border-color: var(--win-btn-shadow) var(--win-btn-highlight) var(--win-btn-highlight) var(--win-btn-shadow);
}

.btn-icon {
  font-size: 0.85em;
}

/* ═══════════════════════════════════════════════════════════════════════════
   Embedded demo windows
   ═══════════════════════════════════════════════════════════════════════════ */
.demo-window {
  margin: 20px 0 16px;
  border: 2px solid;
  border-color: var(--win-btn-highlight) var(--win-btn-shadow) var(--win-btn-shadow) var(--win-btn-highlight);
  box-shadow:
    inset 1px 1px 0 var(--win-white),
    inset -1px -1px 0 #404040,
    3px 3px 10px rgba(0,0,0,0.3);
}

/* ─── Demo title bar ─── */
.demo-titlebar {
  display: flex;
  align-items: center;
  padding: 3px 4px;
  background: linear-gradient(90deg, var(--win-navy), #1084d0);
  color: var(--win-title-text);
  font-family: 'VT323', monospace;
  font-size: 0.95rem;
  letter-spacing: 0.3px;
  user-select: none;
  cursor: default;
  gap: 6px;
}

.demo-titlebar-icon {
  font-size: 0.9rem;
}

.demo-titlebar-text {
  flex: 1;
}

.demo-titlebar-buttons {
  display: flex;
  gap: 2px;
}

.demo-tb-btn {
  width: 16px;
  height: 16px;
  font-size: 9px;
  font-family: 'VT323', monospace;
  background: var(--win-silver);
  border: 1.5px solid;
  border-color: var(--win-btn-highlight) var(--win-btn-shadow) var(--win-btn-shadow) var(--win-btn-highlight);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  color: #000;
}

/* ─── Demo viewport ─── */
.demo-viewport {
  position: relative;
  background: #0b0f14;
  overflow: hidden;
}

.demo-viewport iframe {
  display: block;
  width: 100%;
  border: none;
}

/* ─── Map viewport ─── */
.map-viewport {
  height: 340px;
}

/* The map takes the pointer so the links in its footer can be clicked. The
   overlay below covers everything above that footer (fun.js sets its bottom
   edge from the footer height the dashboard reports), and the dashboard in
   lite mode ignores the pointer everywhere except those links. */
.map-viewport iframe {
  width: 100%;
  height: 100%;
  pointer-events: auto;
}

/* Clickable overlay on map preview */
.demo-overlay {
  position: absolute;
  inset: 0;
  cursor: pointer;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding-bottom: 50px;
  background: linear-gradient(
    to bottom,
    transparent 60%,
    rgba(0, 0, 0, 0.45) 100%
  );
  transition: background 0.2s;
}

.demo-overlay:hover {
  background: linear-gradient(
    to bottom,
    rgba(0, 0, 80, 0.05) 0%,
    rgba(0, 0, 80, 0.35) 100%
  );
}

.demo-overlay-label {
  font-family: 'VT323', monospace;
  font-size: 1rem;
  color: rgba(255, 255, 255, 0.85);
  background: rgba(0, 0, 128, 0.7);
  padding: 3px 12px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  letter-spacing: 0.3px;
}

/* ─── Widget mode button: LIVE or a demo's tag, the time, a menu arrow ───
   Same look as the label it replaced: translucent navy, white VT323 text. */
.snapshot-indicator {
  display: none;
  align-items: center;
  gap: 6px;
  position: absolute;
  top: 6px;
  left: 6px;
  font-family: 'VT323', monospace;
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.9);
  background: rgba(0, 0, 128, 0.75);
  padding: 2px 8px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  letter-spacing: 0.3px;
  z-index: 3;
  cursor: pointer;
  user-select: none;
  transition: background 0.15s;
}
.snapshot-indicator:hover,
.snapshot-indicator[aria-expanded="true"] { background: rgba(0, 0, 180, 0.85); }
.snapshot-indicator:focus-visible { outline: 1px dotted #fff; outline-offset: -3px; }
.si-arrow { font-size: 0.55rem; line-height: 1; opacity: 0.85; }

.si-tag { letter-spacing: 1px; text-transform: uppercase; }
/* LIVE: a small green lamp that blinks softly beside the word. */
.si-tag[data-live="1"]::before {
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  margin-right: 5px;
  vertical-align: 1px;
  border-radius: 50%;
  background: #4ade80;
  box-shadow: 0 0 4px #4ade80;
  animation: si-live-blink 1.6s ease-in-out infinite;
}
.si-tag[data-live="1"] { animation: none; }
@keyframes si-live-blink {
  0%, 100% { opacity: 1; box-shadow: 0 0 5px #4ade80; }
  50%      { opacity: 0.35; box-shadow: 0 0 1px #4ade80; }
}
@media (prefers-reduced-motion: reduce) {
  .si-tag[data-live="1"]::before { animation: none; }
}

.snapshot-menu {
  position: absolute;
  top: 28px;
  left: 6px;
  min-width: 170px;
  font-family: 'VT323', monospace;
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.9);
  background: rgba(0, 0, 128, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.2);
  letter-spacing: 0.3px;
  z-index: 4;
  user-select: none;
}
.snapshot-menu[hidden] { display: none; }
.sm-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 2px 8px;
  cursor: pointer;
  white-space: nowrap;
}
.sm-row .si-tag { margin-left: auto; opacity: 0.8; }
.sm-row:hover, .sm-row:focus { background: rgba(0, 0, 180, 0.95); outline: none; }
.sm-row-on::before { content: "\2713"; }
.sm-row:not(.sm-row-on)::before { content: "\00A0"; }

/* ─── TUI terminal viewport ─── */
/* (terminal-window styles removed — uses shared demo-window) */

.tui-viewport {
  height: 380px;
  background: #0a0a0a;
}

.tui-viewport iframe {
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.tui-viewport iframe.interactive {
  pointer-events: auto;
}

/* ─── Responsive demo sizes ─── */
@media (max-width: 600px) {
  .map-viewport {
    height: 260px;
  }
  .tui-viewport {
    height: 300px;
  }
}

@media (min-width: 900px) {
  .map-viewport {
    height: 420px;
  }
  .tui-viewport {
    height: 440px;
  }
}

/* ─── Maximized mode ─── */
.page.maximized {
  max-width: none;
  margin: 0;
  padding: 0;
}
.page.maximized .map-viewport {
  height: 560px;
}
.page.maximized .tui-viewport {
  height: 600px;
}

/* ═══════════════════════════════════════════════════════════════════════════
   Info sections
   ═══════════════════════════════════════════════════════════════════════════ */
.info-section h3 {
  font-family: 'VT323', monospace;
  font-size: 1.5rem;
  font-weight: 400;
  margin-bottom: 10px;
  color: var(--text);
}

.info-section p {
  margin-bottom: 14px;
}

.info-section a {
  color: var(--link);
  text-decoration: underline;
}

.info-section a:hover {
  color: var(--link-hover);
}

/* ═══════════════════════════════════════════════════════════════════════════
   Data Sources & Disclosures (collapsible)
   ═══════════════════════════════════════════════════════════════════════════ */
.disclosures {
  margin: 0;
  border: 1px solid rgba(0, 0, 0, 0.12);
  border-radius: 3px;
  font-size: 0.85rem;
  line-height: 1.5;
  flex: 1;
  min-width: 200px;
}
.disclosures summary {
  padding: 6px 10px;
  cursor: pointer;
  font-family: 'VT323', monospace;
  font-size: 0.95rem;
  color: var(--text);
  user-select: none;
  white-space: nowrap;
}
.disclosures summary:hover {
  background: rgba(0, 0, 0, 0.04);
}
.disclosures-body {
  padding: 4px 14px 12px;
  color: rgba(0, 0, 0, 0.65);
}
.disclosures-body p {
  margin: 0 0 8px;
}
.disclosures-body a {
  color: var(--link);
}
.disclosures-legal {
  margin-top: 10px;
  font-size: 0.8rem;
  color: rgba(0, 0, 0, 0.45);
}

.purpleair-credit {
  margin: 4px 0 0;
  font-size: 0.8rem;
  color: rgba(0, 0, 0, 0.55);
  text-align: left;
}
.purpleair-credit a {
  color: var(--link);
}

/* ═══════════════════════════════════════════════════════════════════════════
   Window footer (copyright inside main-window)
   ═══════════════════════════════════════════════════════════════════════════ */
.window-footer {
  margin-top: 24px;
  padding: 12px 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  text-align: center;
  font-family: 'VT323', monospace;
  font-size: 0.85rem;
  color: rgba(0, 0, 0, 0.45);
  letter-spacing: 0.5px;
}

/* ═══════════════════════════════════════════════════════════════════════════
   Launch row + PWA install button
   ═══════════════════════════════════════════════════════════════════════════ */
.launch-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: flex-start;
  margin-top: 4px;
}

.install-btn {
  display: none;
  align-items: center;
  gap: 7px;
  padding: 10px 18px;
  font-family: 'VT323', monospace;
  font-size: 1.3rem;
  color: var(--text);
  background: var(--win-silver);
  border: 2px solid;
  border-color: var(--win-btn-highlight) var(--win-btn-shadow) var(--win-btn-shadow) var(--win-btn-highlight);
  cursor: pointer;
  transition: filter 0.1s;
}

.install-btn:hover { filter: brightness(0.93); }
.install-btn:active {
  border-color: var(--win-btn-shadow) var(--win-btn-highlight) var(--win-btn-highlight) var(--win-btn-shadow);
}

/* ═══════════════════════════════════════════════════════════════════════════
   Taskbar (footer)
   ═══════════════════════════════════════════════════════════════════════════ */
.taskbar {
  position: relative;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 3px 12px;
  background: var(--win-silver);
  border-top: 2px solid var(--win-btn-highlight);
  font-family: 'VT323', monospace;
  font-size: 0.95rem;
  user-select: none;
  z-index: 10000;
  flex-shrink: 0;
  width: 100%;
}

/* ─── Start button ─── */
.start-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 10px;
  border: 2px solid;
  border-color: var(--win-btn-highlight) var(--win-btn-shadow) var(--win-btn-shadow) var(--win-btn-highlight);
  cursor: pointer;
  background: var(--win-silver);
  color: var(--text);
  font-family: 'VT323', monospace;
  font-size: 0.95rem;
  font-weight: bold;
  white-space: nowrap;
  flex-shrink: 0;
}
.start-btn:active,
.start-btn.open {
  border-color: var(--win-btn-shadow) var(--win-btn-highlight) var(--win-btn-highlight) var(--win-btn-shadow);
  background: rgba(0,0,0,0.05);
}

/* ─── Start Menu ─── */
.start-menu {
  display: none;
  position: absolute;
  bottom: calc(100% + 2px);
  left: 0;
  z-index: 999;
  background: var(--win-silver);
  border: 2px solid;
  border-color: var(--win-btn-highlight) var(--win-btn-shadow) var(--win-btn-shadow) var(--win-btn-highlight);
  box-shadow: 3px 3px 10px rgba(0,0,0,0.45);
  flex-direction: row;
  min-width: 210px;
}
.start-menu.open {
  display: flex;
  flex-direction: row;
}

.start-menu-banner {
  width: 28px;
  background: linear-gradient(to top, #000070 0%, #1a237e 35%, #283593 65%, #1565c0 100%);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding-bottom: 10px;
  flex-shrink: 0;
  min-height: 150px;
}
.start-menu-banner-text {
  font-family: 'VT323', monospace;
  font-size: 1.05rem;
  color: rgba(255,255,255,0.5);
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  letter-spacing: 3px;
  white-space: nowrap;
  user-select: none;
  text-transform: lowercase;
}

.start-menu-items {
  flex: 1;
  padding: 3px 0;
  display: flex;
  flex-direction: column;
}
.start-menu-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 5px 14px 5px 6px;
  background: transparent;
  border: none;
  color: var(--text);
  font-family: 'Inter', sans-serif;
  font-size: 0.88rem;
  cursor: pointer;
  text-align: left;
  white-space: nowrap;
  line-height: 1.3;
  text-decoration: none;
}
.start-menu-item:hover,
.start-menu-item:focus {
  background: var(--win-navy);
  color: var(--win-title-text);
  outline: none;
}
.start-menu-item-shutdown {
  margin-top: auto;
}
.sm-icon {
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.start-menu-sep {
  border: none;
  border-top: 1px solid var(--win-dark);
  border-bottom: 1px solid var(--win-white);
  margin: 4px 4px;
}

/* ─── Start menu folder + submenu ─── */
.start-menu-folder {
  position: relative;
}
.start-menu-folder-btn {
  width: 100%;
}
.sm-arrow {
  margin-left: auto;
  font-size: 0.6rem;
  opacity: 0.6;
}
.start-submenu {
  display: none;
  position: absolute;
  left: calc(100% + 4px);
  top: -3px;
  background: var(--win-silver);
  border: 2px solid;
  border-color: var(--win-btn-highlight) var(--win-btn-shadow) var(--win-btn-shadow) var(--win-btn-highlight);
  box-shadow: 3px 3px 10px rgba(0,0,0,0.35);
  min-width: 150px;
  padding: 3px 0;
  z-index: 1000;
}
/* Submenu open/close controlled by JS debounce — remove CSS :hover trigger */
.start-menu-folder.submenu-open > .start-submenu {
  display: block;
}

/* ─── Taskbar app buttons ─── */
.taskbar-apps {
  flex: 1;
  display: flex;
  gap: 3px;
  align-items: center;
  padding: 0 2px;
  overflow: hidden;
  min-width: 0;
}
.taskbar-app-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 7px;
  font-family: 'VT323', monospace;
  font-size: 0.85rem;
  color: var(--text);
  background: var(--win-silver);
  border: 2px solid;
  border-color: var(--win-btn-highlight) var(--win-btn-shadow) var(--win-btn-shadow) var(--win-btn-highlight);
  cursor: pointer;
  white-space: nowrap;
  max-width: 130px;
  overflow: hidden;
  text-overflow: ellipsis;
  flex-shrink: 0;
}
.taskbar-app-btn.active {
  border-color: var(--win-btn-shadow) var(--win-btn-highlight) var(--win-btn-highlight) var(--win-btn-shadow);
  background: rgba(0,0,0,0.06);
}
.taskbar-app-btn:hover:not(.active) { filter: brightness(0.95); }

.tb-icon {
  flex-shrink: 0;
  vertical-align: middle;
}

.taskbar-tray {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 2px 8px;
  border: 2px solid;
  border-color: var(--win-btn-shadow) var(--win-btn-highlight) var(--win-btn-highlight) var(--win-btn-shadow);
  font-size: 0.9rem;
  color: var(--text);
  white-space: nowrap;
  flex-shrink: 0;
}

/* ═══════════════════════════════════════════════════════════════════════════
   Responsive
   ═══════════════════════════════════════════════════════════════════════════ */
@media (max-width: 600px) {
  .page {
    margin: 8px auto;
    padding: 0 4px;
  }
  .main-window {
    padding: 16px 14px;
  }
  .taskbar {
    padding: 3px max(12px, env(safe-area-inset-left, 12px));
    padding-right: max(12px, env(safe-area-inset-right, 12px));
    padding-bottom: max(3px, env(safe-area-inset-bottom, 3px));
  }
  .taskbar-app-btn span {
    display: none;
  }
  .taskbar-app-btn {
    padding: 2px 5px;
    max-width: none;
  }
  .site-title {
    font-size: 2.4rem;
  }
  .project-name {
    font-size: 1.6rem;
  }
  .project-header {
    gap: 10px;
  }
  .folder-icon svg {
    width: 36px;
    height: 36px;
  }
}

/* ─── Print ─── */
@media print {
  .crt-lines, .taskbar, .titlebar-buttons { display: none; }
  body { background: #fff; }
  .window { box-shadow: none; border: 1px solid #ccc; }
}

/* ═══════════════════════════════════════════════════════════════════════════
   Floating desktop windows (Start menu widgets — draggable)
   ═══════════════════════════════════════════════════════════════════════════ */
.desktop-window {
  position: fixed;
  z-index: 300;
  background: var(--win-silver);
  border: 2px solid;
  border-color: var(--win-btn-highlight) var(--win-btn-shadow) var(--win-btn-shadow) var(--win-btn-highlight);
  box-shadow:
    inset 1px 1px 0 var(--win-white),
    inset -1px -1px 0 #404040,
    4px 4px 14px rgba(0,0,0,0.45);
  display: flex;
  flex-direction: column;
  min-width: 180px;
}

.desktop-titlebar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 3px 4px;
  background: linear-gradient(90deg, var(--win-navy), #1084d0);
  color: var(--win-title-text);
  font-family: 'VT323', 'Courier New', monospace;
  font-size: 1rem;
  letter-spacing: 0.5px;
  user-select: none;
  cursor: grab;
  flex-shrink: 0;
}
.desktop-titlebar.inactive {
  background: linear-gradient(90deg, #808080, #b0b0b0);
  color: #d4d0c8;
}
.desktop-titlebar:active {
  cursor: grabbing;
}

.desk-tb-left {
  display: flex;
  align-items: center;
  gap: 6px;
  overflow: hidden;
  min-width: 0;
}
.desk-tb-icon {
  font-size: 0.9rem;
  flex-shrink: 0;
}
.desk-tb-text {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.desk-tb-btns {
  display: flex;
  gap: 2px;
  flex-shrink: 0;
}
.desk-tb-btn {
  width: 18px;
  height: 18px;
  font-size: 10px;
  font-family: 'VT323', monospace;
  background: var(--win-silver);
  border: 2px solid;
  border-color: var(--win-btn-highlight) var(--win-btn-shadow) var(--win-btn-shadow) var(--win-btn-highlight);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  padding: 0;
  color: #000;
}
.desk-tb-btn:active {
  border-color: var(--win-btn-shadow) var(--win-btn-highlight) var(--win-btn-highlight) var(--win-btn-shadow);
}

.desktop-window-body {
  overflow: hidden;
}
