/* ============================================================
   nt4.css — Windows NT 4.0 Visual System
   Complete CSS foundation for NT4 desktop simulation.
   All bevels use box-shadow inset (NOT border-style outset/inset).
   All colors match the Windows 95/NT4 "Windows Standard" scheme.
   NO title bar blending. NO warm grey tones. This is NT4, not Win98.
   ============================================================ */

/* === Font Face === */

@font-face {
  font-family: "W95FA";
  src: url("../assets/fonts/w95fa.woff2") format("woff2"),
       url("../assets/fonts/w95fa.woff") format("woff");
  font-weight: normal;
  font-style: normal;
}

/* === CSS Custom Properties === */

:root {
  /* Surface Colors */
  --button-face:        #C0C0C0;
  --button-highlight:   #FFFFFF;
  --button-light:       #DFDFDF;
  --button-shadow:      #808080;
  --button-dk-shadow:   #000000;
  --window-bg:          #FFFFFF;
  --window-text:        #000000;

  /* Title Bar Colors */
  --active-title:       #000080;
  --active-title-text:  #FFFFFF;
  --inactive-title:     #808080;
  --inactive-title-text:#C0C0C0;

  /* Desktop & System */
  --desktop:            #008080;
  --menu-bg:            #C0C0C0;
  --menu-text:          #000000;
  --highlight:          #000080;
  --highlight-text:     #FFFFFF;
  --scrollbar:          #C0C0C0;
  --tooltip-bg:         #FFFFE1;
  --tooltip-text:       #000000;
  --disabled-text:      #808080;
  --app-workspace:      #808080;

  /* Link Colors (IE-era) */
  --link:               #0000FF;
  --visited-link:       #800080;
}

/* === Global Reset & Base Styles === */

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html, body { height: 100%; overflow: hidden; }
body {
  font-family: "W95FA", "MS Sans Serif", "Microsoft Sans Serif", Tahoma, sans-serif;
  font-size: 11px;
  color: var(--window-text);
  -webkit-font-smoothing: none;
  -moz-osx-font-smoothing: grayscale;
  font-smooth: never;
  text-rendering: optimizeSpeed;
  cursor: default;
}

/* === Bevel Utility Classes === */

.raised {
  box-shadow: inset -1px -1px var(--button-dk-shadow),
              inset  1px  1px var(--button-highlight),
              inset -2px -2px var(--button-shadow),
              inset  2px  2px var(--button-light);
  background: var(--button-face);
}

.sunken {
  box-shadow: inset -1px -1px var(--button-highlight),
              inset  1px  1px var(--button-shadow),
              inset -2px -2px var(--button-light),
              inset  2px  2px var(--button-dk-shadow);
  background: var(--window-bg);
}

.pressed {
  box-shadow: inset -1px -1px var(--button-highlight),
              inset  1px  1px var(--button-shadow),
              inset -2px -2px var(--button-light),
              inset  2px  2px var(--button-dk-shadow);
  background: var(--button-face);
}

.well {
  box-shadow: inset -1px -1px var(--button-highlight),
              inset  1px  1px var(--button-shadow);
}

/* === NT4 Button Styles === */

.nt4-button {
  box-shadow: inset -1px -1px var(--button-dk-shadow),
              inset  1px  1px var(--button-highlight),
              inset -2px -2px var(--button-shadow),
              inset  2px  2px var(--button-light);
  background: var(--button-face);
  border: none;
  padding: 4px 12px;
  font-family: inherit;
  font-size: 11px;
  cursor: default;
  min-width: 75px;
  text-align: center;
}

.nt4-button:active {
  box-shadow: inset -1px -1px var(--button-highlight),
              inset  1px  1px var(--button-shadow),
              inset -2px -2px var(--button-light),
              inset  2px  2px var(--button-dk-shadow);
  padding: 5px 11px 3px 13px;
}

.nt4-button:focus {
  outline: 1px dotted var(--window-text);
  outline-offset: -4px;
}

/* === Window Chrome === */

.nt4-window {
  background: var(--button-face);
  box-shadow: inset -1px -1px var(--button-dk-shadow),
              inset  1px  1px var(--button-highlight),
              inset -2px -2px var(--button-shadow),
              inset  2px  2px var(--button-light);
  position: absolute;
  display: flex;
  flex-direction: column;
}

.nt4-window.chromeless {
  background: transparent;
  box-shadow: none;
}

.nt4-window.chromeless .window-content {
  padding: 0;
  overflow: visible;
  background: transparent;
}

.nt4-titlebar {
  background: var(--active-title);
  color: var(--active-title-text);
  padding: 2px 3px;
  font-weight: bold;
  font-size: 11px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  user-select: none;
}

.nt4-titlebar.inactive {
  background: var(--inactive-title);
  color: var(--inactive-title-text);
}

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

.nt4-titlebar-btn {
  width: 16px;
  height: 14px;
  background: var(--button-face);
  box-shadow: inset -1px -1px var(--button-dk-shadow),
              inset  1px  1px var(--button-highlight),
              inset -2px -2px var(--button-shadow),
              inset  2px  2px var(--button-light);
  border: none;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: default;
  font-size: 8px;
  line-height: 1;
  position: relative;
}

.nt4-titlebar-btn:active {
  box-shadow: inset -1px -1px var(--button-highlight),
              inset  1px  1px var(--button-shadow),
              inset -2px -2px var(--button-light),
              inset  2px  2px var(--button-dk-shadow);
}

/* Window Button Glyphs -- CSS-drawn, not text */

/* Minimize: small horizontal line near bottom */
.nt4-titlebar-btn.minimize::after {
  content: "";
  display: block;
  width: 6px;
  height: 1px;
  background: var(--window-text);
  position: absolute;
  bottom: 3px;
  left: 50%;
  transform: translateX(-50%);
}

/* Maximize: small rectangle outline */
.nt4-titlebar-btn.maximize::after {
  content: "";
  display: block;
  width: 7px;
  height: 7px;
  border: 1px solid var(--window-text);
  border-top-width: 2px;
  position: absolute;
  top: 2px;
  left: 50%;
  transform: translateX(-50%);
}

/* Close: X drawn with two crossing pseudo-elements */
.nt4-titlebar-btn.close::before,
.nt4-titlebar-btn.close::after {
  content: "";
  display: block;
  width: 8px;
  height: 1px;
  background: var(--window-text);
  position: absolute;
  top: 50%;
  left: 50%;
}

.nt4-titlebar-btn.close::before {
  transform: translate(-50%, -50%) rotate(45deg);
}

.nt4-titlebar-btn.close::after {
  transform: translate(-50%, -50%) rotate(-45deg);
}

/* === Dialog Styles === */

.nt4-dialog {
  background: var(--button-face);
  box-shadow: inset -1px -1px var(--button-dk-shadow),
              inset  1px  1px var(--button-highlight),
              inset -2px -2px var(--button-shadow),
              inset  2px  2px var(--button-light);
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 1000;
}

.dialog-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: transparent;
  z-index: 9999;
  cursor: default;
}

.dialog-titlebar {
  background: var(--active-title);
  color: var(--active-title-text);
  padding: 2px 4px;
  font-weight: bold;
  font-size: 11px;
  user-select: none;
}

.dialog-body {
  padding: 12px 16px;
}

.dialog-buttons {
  padding: 8px 16px 12px;
  display: flex;
  justify-content: center;
  gap: 6px;
}

/* === Form Field Styles === */

.nt4-input {
  box-shadow: inset -1px -1px var(--button-highlight),
              inset  1px  1px var(--button-shadow),
              inset -2px -2px var(--button-light),
              inset  2px  2px var(--button-dk-shadow);
  background: var(--window-bg);
  border: none;
  padding: 2px 4px;
  font-family: inherit;
  font-size: 11px;
}

.nt4-select {
  box-shadow: inset -1px -1px var(--button-highlight),
              inset  1px  1px var(--button-shadow),
              inset -2px -2px var(--button-light),
              inset  2px  2px var(--button-dk-shadow);
  background: var(--window-bg);
  border: none;
  padding: 2px;
  font-family: inherit;
  font-size: 11px;
}

/* === Desktop Background === */

#desktop {
  width: 100vw;
  height: 100vh;
  background-color: #008080;
  background-image: url('../assets/wallpaper/nk.png');
  background-size: contain;
  background-position: center center;
  background-repeat: no-repeat;
  position: relative;
  overflow: hidden;
}

#desktop-logo {
  display: none;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 240px;
  opacity: 0.15;
  pointer-events: none;
  user-select: none;
  image-rendering: auto;
}

/* === Boot Screen Backgrounds === */

#boot-screen {
  width: 100vw;
  height: 100vh;
  position: relative;
}

.boot-post {
  background: #000000;
  color: #AAAAAA;
  font-family: "Courier New", Courier, monospace;
  font-size: 14px;
  padding: 20px;
  width: 100%;
  height: 100%;
  white-space: pre;
  line-height: 1.4;
}

.boot-ntldr {
  background: #000000;
  color: #AAAAAA;
  font-family: "Courier New", Courier, monospace;
  font-size: 14px;
  padding: 20px;
  width: 100%;
  height: 100%;
  white-space: pre;
  line-height: 1.4;
}

.boot-ntldr .highlight {
  background: var(--active-title-text);
  color: var(--active-title);
}

.boot-starting {
  background: var(--active-title);
  color: var(--active-title-text);
  font-family: "Courier New", Courier, monospace;
  font-size: 16px;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  line-height: 1.6;
}

.boot-security {
  background: var(--active-title);
  color: var(--active-title-text);
  font-family: inherit;
  font-size: 14px;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.boot-login {
  background: var(--desktop);
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* === Viewport Gate === */

.viewport-gate {
  min-width: 350px;
  max-width: 420px;
}

.viewport-gate .dialog-body {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.viewport-gate .dialog-icon {
  font-size: 32px;
  flex-shrink: 0;
}

/* === Logon Error Dialog === */

.dialog-icon-img {
  width: 32px;
  height: 32px;
  flex-shrink: 0;
}

.logon-error .dialog-body p {
  font-size: 11px;
  line-height: 1.4;
}

/* === Loading Settings Screen (return visitors) === */

.boot-loading-settings {
  background: var(--desktop);
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--active-title-text);
  font-size: 14px;
}

/* === Scrollbar Styles (Webkit) === */

::-webkit-scrollbar { width: 16px; height: 16px; }
::-webkit-scrollbar-track { background: var(--scrollbar); }
::-webkit-scrollbar-thumb {
  background: var(--button-face);
  box-shadow: inset -1px -1px var(--button-dk-shadow),
              inset  1px  1px var(--button-highlight),
              inset -2px -2px var(--button-shadow),
              inset  2px  2px var(--button-light);
}
::-webkit-scrollbar-button { display: block; height: 16px; width: 16px; background: var(--button-face); }

/* === Desktop Icons === */

.desktop-icons {
  position: absolute;
  top: 8px;
  left: 8px;
  display: flex;
  flex-direction: column;
  flex-wrap: wrap;
  gap: 4px;
  max-height: calc(100vh - 44px); /* leave room for taskbar */
  align-content: flex-start;
}

.desktop-icons-bottom {
  position: absolute;
  bottom: 36px;
  left: 8px;
}

.desktop-icon {
  width: 80px;
  text-align: center;
  padding: 4px;
  cursor: default;
  user-select: none;
}

.desktop-icon-image {
  width: 32px;
  height: 32px;
  margin: 0 auto 2px;
}

.desktop-icon-label {
  font-size: 11px;
  color: #FFFFFF;
  padding: 1px 2px;
  word-wrap: break-word;
  overflow-wrap: break-word;
  line-height: 1.2;
  text-shadow: 1px 1px 1px #000000;
}

.desktop-icon.selected .desktop-icon-label {
  background: var(--highlight);
  color: var(--highlight-text);
  outline: 1px dotted var(--highlight-text);
}

/* === Window Layout === */

.window-content {
  flex: 1;
  overflow: auto;
  overscroll-behavior: contain;
  background: var(--window-bg);
}

.window-statusbar {
  padding: 2px 4px;
  font-size: 11px;
  flex-shrink: 0;
}

/* === Drag Prevention === */

.dragging, .dragging * {
  user-select: none !important;
  cursor: default !important;
}

/* === Taskbar === */

#taskbar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 28px;
  z-index: 10000;
  display: flex;
  align-items: center;
  padding: 2px;
  gap: 2px;
}

#start-button {
  height: 22px;
  padding: 2px 6px;
  display: flex;
  align-items: center;
  gap: 4px;
  font-weight: bold;
  font-size: 11px;
  font-family: inherit;
  border: none;
  cursor: default;
  flex-shrink: 0;
}

#taskbar-buttons {
  display: flex;
  flex: 1;
  overflow: hidden;
  gap: 2px;
  align-items: center;
}

.taskbar-window-btn {
  flex: 0 1 160px;
  min-width: 40px;
  height: 22px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: left;
  padding: 2px 6px;
  font-size: 11px;
  font-family: inherit;
  border: none;
  cursor: default;
  display: flex;
  align-items: center;
  gap: 4px;
}

.taskbar-window-btn .taskbar-btn-icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.taskbar-window-btn .taskbar-btn-title {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#system-tray {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 0 4px;
  height: 22px;
  flex-shrink: 0;
}

#tray-clock {
  font-size: 11px;
  padding: 0 2px;
}

/* === Start Menu === */

.start-menu {
  position: fixed;
  bottom: 28px;
  left: 0;
  z-index: 10001;
  width: 200px;
  padding: 2px;
}

.start-menu-sidebar {
  position: absolute;
  left: 2px;
  top: 2px;
  bottom: 2px;
  width: 24px;
  background: var(--inactive-title);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding-bottom: 4px;
}

.start-menu-sidebar-text {
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  color: var(--button-highlight);
  font-weight: bold;
  font-size: 16px;
  letter-spacing: 2px;
}

.start-menu-items {
  margin-left: 24px;
}

.start-menu-item {
  padding: 4px 8px 4px 8px;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: default;
  position: relative;
}

.start-menu-item:hover {
  background: var(--highlight);
  color: var(--highlight-text);
}

.start-menu-item.disabled {
  color: var(--disabled-text);
}

.start-menu-item.disabled:hover {
  background: transparent;
  color: var(--disabled-text);
}

.start-menu-item .submenu-arrow {
  margin-left: auto;
  font-size: 8px;
}

.start-menu-separator {
  height: 1px;
  margin: 2px 0;
  margin-left: 24px;
  border-top: 1px solid var(--button-shadow);
  border-bottom: 1px solid var(--button-highlight);
}

.start-submenu {
  position: absolute;
  left: 100%;
  top: -2px;
  width: 180px;
  padding: 2px;
  z-index: 10002;
}

/* Cascade-up variant: when submenu would clip below taskbar, anchor to bottom of parent item instead */
.start-submenu.cascade-up {
  top: auto;
  bottom: -2px;
}

/* Scoped submenu item color -- prevents the parent .start-menu-item:hover white text
   from cascading into nested submenu items on first hover (FOUC fix for UI-02).
   Specificity (0,2,0) beats .start-menu-item:hover (0,1,1) so default state wins
   on submenu items until they themselves are hovered. */
.start-submenu .start-menu-item {
  color: var(--menu-text);
}

.start-submenu .start-menu-item:hover {
  background: var(--highlight);
  color: var(--highlight-text);
}

/* === Shutdown Screen === */

.shutdown-overlay {
  position: fixed;
  inset: 0;
  z-index: 30000;
  background: #000000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.shutdown-text {
  color: #FF8C00;
  font-size: 24px;
  font-family: "Courier New", Courier, monospace;
  text-align: center;
}

/* === Shutdown Dialog === */

.shutdown-dialog {
  z-index: 20000;
}

/* Restore glyph (two overlapping rectangles) for maximized windows */

.nt4-titlebar-btn.maximize.restore::after {
  width: 5px;
  height: 5px;
  border: 1px solid var(--window-text);
  border-top-width: 2px;
  top: 4px;
  left: calc(50% - 4px);
}

.nt4-titlebar-btn.maximize.restore::before {
  content: "";
  display: block;
  width: 5px;
  height: 5px;
  border: 1px solid var(--window-text);
  border-top-width: 2px;
  position: absolute;
  top: 1px;
  left: calc(50% + 0px);
}

/* ============================================================
   App Layouts — shared chrome for Explorer, viewers, etc.
   ============================================================ */

.app-menubar {
  display: flex;
  padding: 2px 0;
  background: var(--button-face);
  border-bottom: 1px solid var(--button-shadow);
}

.app-menubar .menu-item {
  padding: 2px 8px;
  cursor: default;
  font-size: 11px;
}

.app-menubar .menu-item:hover {
  background: var(--highlight);
  color: var(--highlight-text);
}

.app-toolbar {
  display: flex;
  align-items: center;
  padding: 2px 4px;
  gap: 2px;
  min-height: 26px;
}

.toolbar-btn {
  width: 24px;
  height: 22px;
  border: none;
  background: var(--button-face);
  cursor: default;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: bold;
  padding: 0;
}

.toolbar-btn-text {
  height: 22px;
  border: none;
  background: var(--button-face);
  cursor: default;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: inherit;
  font-size: 11px;
  padding: 2px 8px;
  white-space: nowrap;
}

.toolbar-btn-text:active {
  box-shadow: inset -1px -1px var(--button-highlight),
              inset  1px  1px var(--button-shadow),
              inset -2px -2px var(--button-light),
              inset  2px  2px var(--button-dk-shadow);
}

.toolbar-separator {
  width: 1px;
  height: 18px;
  margin: 0 2px;
  border-left: 1px solid var(--button-shadow);
  border-right: 1px solid var(--button-highlight);
}

/* ---- Explorer ---- */

.explorer-app {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.explorer-body {
  display: flex;
  flex: 1;
  overflow: hidden;
}

.explorer-tree {
  width: 200px;
  overflow: auto;
  background: white;
  padding: 2px;
}

.explorer-files {
  flex: 1;
  overflow: auto;
  background: white;
}

.tree-item {
  display: flex;
  align-items: center;
  padding: 1px 0;
  cursor: default;
  white-space: nowrap;
  font-size: 11px;
}

.tree-item:hover {
  background: var(--highlight);
  color: var(--highlight-text);
}

.tree-item.selected {
  background: var(--highlight);
  color: var(--highlight-text);
}

.tree-toggle {
  width: 12px;
  display: inline-block;
  text-align: center;
  font-size: 10px;
  font-family: 'Courier New', monospace;
}

.file-list-header {
  display: flex;
  background: var(--button-face);
  border-bottom: 1px solid var(--button-shadow);
  font-size: 11px;
  font-weight: normal;
}

.file-list-header span {
  padding: 2px 4px;
  border-right: 1px solid var(--button-shadow);
  cursor: default;
}

.file-list-item {
  display: flex;
  align-items: center;
  font-size: 11px;
  cursor: default;
  padding: 1px 0;
}

.file-list-item:hover {
  background: var(--highlight);
  color: var(--highlight-text);
}

.file-list-item.selected {
  background: var(--highlight);
  color: var(--highlight-text);
}

.file-list-col {
  padding: 1px 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.explorer-address {
  display: flex;
  align-items: center;
  padding: 2px 4px;
  gap: 4px;
  background: var(--button-face);
  font-size: 11px;
}

.explorer-address .address-label {
  white-space: nowrap;
}

.explorer-address .address-path {
  flex: 1;
  padding: 1px 4px;
  background: white;
  border: 1px solid var(--button-shadow);
  font-size: 11px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.explorer-statusbar {
  padding: 2px 4px;
  font-size: 11px;
  flex-shrink: 0;
}

/* ---- WordPad ---- */

.wordpad-app {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.wordpad-content {
  flex: 1;
  overflow: auto;
  padding: 16px 20px;
  background: white;
  font-family: 'Times New Roman', serif;
  font-size: 13px;
  line-height: 1.5;
}

.wordpad-content h2 { font-size: 16px; margin: 0 0 8px 0; }
.wordpad-content h3 { font-size: 14px; margin: 12px 0 6px 0; }
.wordpad-content p { margin: 6px 0; }
.wordpad-content ul { margin: 4px 0 4px 20px; }
.wordpad-content li { margin: 2px 0; }

/* ---- Notepad ---- */

.notepad-app {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.notepad-content {
  flex: 1;
  overflow: auto;
  padding: 4px;
  margin: 0;
  background: white;
  font-family: 'Fixedsys', 'Courier New', monospace;
  font-size: 13px;
  white-space: pre-wrap;
  border: none;
  outline: none;
}

/* ---- Spreadsheet ---- */

.spreadsheet-app {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.spreadsheet-content {
  flex: 1;
  overflow: auto;
  background: white;
}

.spreadsheet-grid {
  border-collapse: collapse;
  font-size: 11px;
}

.spreadsheet-grid th {
  background: var(--button-face);
  border: 1px solid var(--button-shadow);
  padding: 2px 4px;
  font-weight: normal;
  text-align: center;
  min-width: 60px;
  position: sticky;
  top: 0;
}

.spreadsheet-grid th.row-header {
  position: sticky;
  left: 0;
  min-width: 30px;
  z-index: 1;
}

.spreadsheet-grid td {
  border: 1px solid #C0C0C0;
  padding: 2px 4px;
  white-space: nowrap;
}

.spreadsheet-grid td.row-header {
  background: var(--button-face);
  border: 1px solid var(--button-shadow);
  text-align: center;
  position: sticky;
  left: 0;
}

.formula-bar {
  display: flex;
  align-items: center;
  padding: 2px 4px;
  gap: 4px;
  background: var(--button-face);
  border-bottom: 1px solid var(--button-shadow);
  font-size: 11px;
}

.formula-bar .cell-ref {
  width: 50px;
  text-align: center;
  border-right: 1px solid var(--button-shadow);
  padding-right: 4px;
}

/* Email Client (Outlook 98) */
.email-app {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.email-body {
  display: flex;
  flex: 1;
  overflow: hidden;
}

.email-folders {
  width: 150px;
  overflow: auto;
  background: white;
  padding: 2px;
}

.email-folder-item {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 2px 4px;
  cursor: default;
  font-size: 11px;
  white-space: nowrap;
}

.email-folder-item:hover {
  background: var(--highlight);
  color: var(--highlight-text);
}

.email-folder-item.selected {
  background: var(--highlight);
  color: var(--highlight-text);
}

.email-right {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.email-messages {
  height: 200px;
  overflow: auto;
  background: white;
}

.email-msg-header {
  display: flex;
  background: var(--button-face);
  border-bottom: 1px solid var(--button-shadow);
  font-size: 11px;
  font-weight: normal;
  position: sticky;
  top: 0;
}

.email-msg-header span {
  padding: 2px 4px;
  border-right: 1px solid var(--button-shadow);
  cursor: default;
}

.email-msg-item {
  display: flex;
  align-items: center;
  font-size: 11px;
  cursor: default;
  padding: 1px 0;
  border-bottom: 1px solid #E0E0E0;
}

.email-msg-item:hover {
  background: var(--highlight);
  color: var(--highlight-text);
}

.email-msg-item.selected {
  background: var(--highlight);
  color: var(--highlight-text);
}

.email-msg-item.unread {
  font-weight: bold;
}

.email-msg-col {
  padding: 1px 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.email-divider {
  height: 4px;
  background: var(--button-face);
  cursor: default;
  flex-shrink: 0;
}

.email-preview {
  flex: 1;
  overflow: auto;
  background: white;
  padding: 8px;
}

.email-preview-headers {
  font-size: 11px;
  margin-bottom: 8px;
  line-height: 1.6;
}

.email-preview-headers .header-label {
  font-weight: bold;
  margin-right: 4px;
}

.email-preview-body {
  font-size: 12px;
  line-height: 1.4;
  white-space: pre-wrap;
  padding: 8px;
  background: #FFFFFF;
}

.email-attachment-bar {
  background: #F0F0F0;
  border: 1px solid #C0C0C0;
  padding: 4px 8px;
  margin: 4px 0;
  font-size: 11px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.email-attachment-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 4px;
}

.email-attachment-link:not(.disabled):hover {
  background: #000080;
  color: white;
}

.email-attachment-link.disabled {
  color: #808080;
  cursor: default;
}

.email-quoted {
  color: #808080;
  border-left: 2px solid #808080;
  padding-left: 8px;
  margin: 4px 0 4px 4px;
  font-size: 11px;
}

.email-unread-count {
  color: var(--button-shadow);
  margin-left: 4px;
  font-size: 10px;
}

/* Browser (IE5) */
.browser-app {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.browser-toolbar {
  gap: 4px;
}

.browser-address-bar {
  display: flex;
  align-items: center;
  padding: 2px 4px;
  gap: 4px;
  background: var(--button-face);
  border-bottom: 1px solid var(--button-shadow);
}

.browser-address-bar .address-label {
  font-size: 11px;
  white-space: nowrap;
}

.browser-address-bar input {
  flex: 1;
}

.browser-body {
  display: flex;
  flex: 1;
  overflow: hidden;
}

.browser-favorites {
  width: 200px;
  overflow: auto;
  background: white;
  border-right: 1px solid var(--button-shadow);
}

.browser-favorites-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 8px;
  background: var(--button-face);
  border-bottom: 1px solid var(--button-shadow);
  font-size: 11px;
  font-weight: bold;
}

.browser-favorites-header .close-btn {
  cursor: default;
  background: none;
  border: none;
  font-size: 12px;
  padding: 0 4px;
}

.browser-bookmark-item {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 2px 4px;
  cursor: default;
  font-size: 11px;
  white-space: nowrap;
}

.browser-bookmark-item:hover {
  background: var(--highlight);
  color: var(--highlight-text);
}

.browser-content {
  flex: 1;
  overflow: auto;
  background: white;
}

.browser-content a {
  cursor: default;
}

/* Disabled toolbar button appearance */
.toolbar-btn:disabled,
.toolbar-btn[disabled] {
  opacity: 0.5;
  cursor: default;
}

/* Iframe in browser content */
.browser-content iframe {
  width: 100%;
  height: 100%;
  border: none;
  display: block;
}

/* Throbber in toolbar */
.browser-throbber {
  width: 22px;
  height: 22px;
  margin-left: auto;
  background: url('../assets/icons/16/iexplore.png') center center no-repeat;
  background-size: 16px 16px;
  image-rendering: pixelated;
  flex-shrink: 0;
}

.browser-throbber.loading {
  animation: throbber-spin 1s linear infinite;
}

@keyframes throbber-spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* === Print Queue === */

.tray-printer-blink {
  animation: printer-blink 1s step-end infinite;
  cursor: pointer;
}

@keyframes printer-blink {
  0%, 49.9% { opacity: 1; }
  50%, 100% { opacity: 0.3; }
}

.printqueue-list th {
  white-space: nowrap;
}

.printqueue-list td {
  white-space: nowrap;
}

/* === Resize Cursors & Ghost Outline === */

/* Ghost outline shown during resize drag */
.resize-ghost {
  position: absolute;
  border: 2px dotted #000000;
  pointer-events: none;
  z-index: 9999;
  box-sizing: border-box;
}

/* Resize body class -- prevents text selection during resize drag */
.resizing, .resizing * {
  user-select: none !important;
}

/* Resize cursor persistence during active drag (body-level, overrides everything) */
.resizing[data-resize-dir="n"] *,
.resizing[data-resize-dir="s"] *,
.resizing[data-resize-dir="n"],
.resizing[data-resize-dir="s"]  { cursor: url('../assets/cursors/size_ns.cur'), ns-resize !important; }

.resizing[data-resize-dir="e"] *,
.resizing[data-resize-dir="w"] *,
.resizing[data-resize-dir="e"],
.resizing[data-resize-dir="w"]  { cursor: url('../assets/cursors/size_ew.cur'), ew-resize !important; }

.resizing[data-resize-dir="ne"] *,
.resizing[data-resize-dir="sw"] *,
.resizing[data-resize-dir="ne"],
.resizing[data-resize-dir="sw"] { cursor: url('../assets/cursors/size_nesw.cur'), nesw-resize !important; }

.resizing[data-resize-dir="nw"] *,
.resizing[data-resize-dir="se"] *,
.resizing[data-resize-dir="nw"],
.resizing[data-resize-dir="se"] { cursor: url('../assets/cursors/size_nwse.cur'), nwse-resize !important; }


/* ============================================================
   Adobe Acrobat Reader 4.0 — PDF Viewer
   ============================================================ */

.acrobat-app {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.acrobat-toolbar {
  display: flex;
  align-items: center;
  padding: 2px 4px;
  gap: 4px;
  min-height: 28px;
  flex-shrink: 0;
}

.acrobat-nav-cluster,
.acrobat-zoom-cluster,
.acrobat-tool-cluster {
  display: flex;
  align-items: center;
  gap: 2px;
}

.acrobat-page-input {
  width: 36px;
  text-align: center;
  font-size: 10px;
  height: 18px;
  margin: 0 2px;
}

.acrobat-page-label {
  font-size: 10px;
  white-space: nowrap;
  margin-right: 4px;
}

.acrobat-zoom-select {
  font-size: 10px;
  height: 20px;
  margin: 0 2px;
  min-width: 80px;
}

.acrobat-tool-active {
  box-shadow: inset -1px -1px var(--button-highlight),
              inset  1px  1px var(--button-shadow),
              inset -2px -2px var(--button-light),
              inset  2px  2px var(--button-dk-shadow) !important;
}

.acrobat-viewer {
  flex: 1;
  overflow: hidden;
  background: var(--app-workspace);
  position: relative;
}

.acrobat-iframe {
  width: 100%;
  height: 100%;
  border: none;
  display: block;
}

/* Network Neighborhood — Icon Grid View */
.network-icon-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 8px;
  align-content: flex-start;
  min-height: 100%;
}

.network-icon-item {
  width: 80px;
  padding: 4px;
  text-align: center;
  cursor: default;
  font-size: 11px;
  word-wrap: break-word;
}

.network-icon-item.selected {
  background: var(--highlight);
  color: var(--highlight-text);
}

.network-icon-label {
  margin-top: 2px;
}

.network-icon-img img {
  image-rendering: pixelated;
}

/* Network Neighborhood — Printer Status */
.network-printer-status {
  color: var(--disabled-text);
}

/* Calculator App */
.calculator-app {
  display: flex;
  flex-direction: column;
  background: var(--button-face);
  height: 100%;
  user-select: none;
}
.calc-display-area {
  padding: 4px 5px;
}
.calc-display {
  width: 100%;
  text-align: right;
  font-family: 'W95FA', 'MS Sans Serif', Tahoma, sans-serif;
  font-size: 16px;
  padding: 2px 4px;
  border: 2px inset #808080;
  background: #fff;
  color: #000;
  box-sizing: border-box;
  height: 24px;
  line-height: 20px;
  overflow: hidden;
}
.calc-memory-indicator {
  font-family: 'W95FA', 'MS Sans Serif', Tahoma, sans-serif;
  font-size: 11px;
  height: 14px;
  padding: 0 6px;
  color: #000;
}
.calc-buttons {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  grid-template-rows: repeat(5, 1fr);
  gap: 2px;
  padding: 4px 5px;
  flex: 1;
}
.calc-btn {
  font-family: 'W95FA', 'MS Sans Serif', Tahoma, sans-serif;
  font-size: 11px;
  padding: 0;
  min-height: 21px;
  text-align: center;
  cursor: default;
  background: var(--button-face);
  color: #000;
  border: none;
  outline: none;
}
.calc-btn:active, .calc-btn.pressed {
  border-style: inset;
}
.calc-btn-red {
  color: #800000;
}
.calc-btn-blue {
  color: #0000aa;
}

/* Screensaver */
#screensaver {
  z-index: 50000;
}