/* ================================================================
   OS Core — Structural & layout rules shared across all OS themes.
   No colors, backgrounds, fonts, borders (decorative), shadows, or
   animations. Only display, flex, position, overflow, sizing,
   z-index, pointer-events, cursor, white-space, text-overflow,
   and outline resets.
   ================================================================ */

/* ── Desktop ───────────────────────────────────────────────────── */

.os-desktop {
  width: 100vw;
  height: 100vh;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.os-desktop-area {
  flex: 1;
  position: relative;
  overflow: hidden;
}

/* ── Desktop Icons ─────────────────────────────────────────────── */

.os-icon-grid {
  display: flex;
  flex-direction: column;
  flex-wrap: wrap;
  gap: 2px;
  padding: 8px;
  align-content: flex-start;
  height: 100%;
}

.os-desktop-icon {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  width: 80px;
  padding: 6px 4px 4px;
  cursor: default;
  border: 1px solid transparent;
}

.os-desktop-icon img {
  width: 48px;
  height: 48px;
  pointer-events: none;
}

/* ── Taskbar ───────────────────────────────────────────────────── */

.os-taskbar {
  display: flex;
  align-items: center;
  position: relative;
  z-index: 9999;
  flex-shrink: 0;
}

.os-start-btn {
  display: flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  border: none;
}

.os-taskbar-separator {
  flex-shrink: 0;
}

.os-taskbar-apps {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 0 4px;
  overflow: hidden;
}

.os-taskbar-app-btn {
  position: relative;
  display: flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  overflow: visible;
  white-space: nowrap;
}

.os-taskbar-app-btn > span:first-of-type {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ── Tooltip ───────────────────────────────────────────────────── */

.os-tooltip {
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s 0.5s;
  z-index: 99999;
}

.os-taskbar-app-btn:hover .os-tooltip {
  opacity: 1;
}

/* ── System Tray ───────────────────────────────────────────────── */

.os-system-tray {
  display: flex;
  align-items: center;
  margin-left: auto;
  position: relative;
}

/* ── Tray Buttons ─────────────────────────────────────────────── */

.os-tray-icon-btn,
.os-clock-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0 2px;
  display: flex;
  align-items: center;
}

.os-tray-icon {
  width: 16px;
  height: 16px;
}

/* ── Calendar Popup ───────────────────────────────────────────── */

.os-calendar-popup {
  position: absolute;
  bottom: 100%;
  right: 0;
  z-index: 100000;
  margin-bottom: 4px;
  width: 200px;
}

.os-calendar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.os-calendar-nav {
  background: none;
  border: none;
  cursor: pointer;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.os-calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  text-align: center;
}

.os-calendar-day,
.os-calendar-day-label {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 22px;
  margin: 0 auto;
}

/* ── Notification Balloon ──────────────────────────────────────── */

.os-balloon {
  position: absolute;
  bottom: 100%;
  right: 0;
  z-index: 99999;
}

.os-balloon-arrow {
  position: absolute;
  bottom: -8px;
  right: 20px;
  width: 0;
  height: 0;
}

.os-balloon-header {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 4px;
}

.os-balloon-close {
  background: none;
  border: none;
  cursor: pointer;
  line-height: 1;
}

/* ── Window Layer ──────────────────────────────────────────────── */

.os-window-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.os-window-layer > * {
  pointer-events: auto;
}

/* ── Window Chrome ─────────────────────────────────────────────── */

.window {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.window .title-bar {
  display: flex;
  align-items: center;
  gap: 4px;
}

.window .title-bar-text {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.os-window-icon {
  width: 16px;
  height: 16px;
}

.window-body {
  flex: 1;
  overflow: auto;
}

/* ── Start Menu ────────────────────────────────────────────────── */

.os-start-menu {
  position: absolute;
  left: 0;
  z-index: 10000;
  overflow: hidden;
}

.os-start-menu-header {
  display: flex;
  align-items: center;
  gap: 8px;
}

.os-start-menu-body {
  display: flex;
}

.os-start-menu-item {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
}

.os-start-menu-item img {
  flex-shrink: 0;
}

.os-start-menu-item-label {
  flex: 1;
}

.os-start-menu-arrow {
  font-size: 8px;
  margin-left: 4px;
}

.os-start-menu-footer {
  display: flex;
  align-items: center;
}

.os-start-menu-footer button {
  display: flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  background: none;
  border: none;
}

.os-start-menu-footer-icon {
  width: 16px;
  height: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ── Shutdown Dialog ───────────────────────────────────────────── */

.os-shutdown-overlay {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 99999;
}

.os-shutdown-buttons {
  display: flex;
  justify-content: center;
}

.os-shutdown-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  background: none;
  border: 2px solid transparent;
}

.os-shutdown-btn-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

/* ── Selection Rectangle ───────────────────────────────────────── */

.os-selection-rect {
  position: absolute;
  pointer-events: none;
  z-index: 5;
}

/* ── Snap Preview ─────────────────────────────────────────────── */

.os-snap-preview {
  position: absolute;
  pointer-events: none;
  background: rgba(100, 149, 237, 0.25);
  border: 2px solid rgba(100, 149, 237, 0.6);
  border-radius: 4px;
  transition: left 0.15s ease-out, width 0.15s ease-out;
  transition: all 0.15s ease;
}

/* ── Context Menu ──────────────────────────────────────────────── */

.os-context-menu {
  position: absolute;
  z-index: 10001;
}

.os-context-menu-item {
  cursor: default;
  white-space: nowrap;
  display: flex;
  align-items: center;
  position: relative;
}

.os-context-menu-submenu-trigger {
  justify-content: space-between;
}

.os-context-menu-arrow {
  margin-left: 16px;
  font-size: 8px;
}

.os-context-menu-submenu {
  display: none;
  position: absolute;
  left: 100%;
  top: 0;
}

.os-context-menu-submenu-trigger:hover > .os-context-menu-submenu {
  display: block;
}

/* ── App Menubar ───────────────────────────────────────────────── */

.os-app-menubar {
  display: flex;
  gap: 0;
}

.os-app-menubar span {
  cursor: default;
}

.os-app-menu-group {
  position: relative;
}

.os-app-menu-label {
  cursor: default;
  display: block;
}

.os-app-menu-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  z-index: 100;
  min-width: 160px;
}

.os-app-menu-item {
  display: block;
  width: 100%;
  text-align: left;
  cursor: default;
  border: none;
  background: none;
  white-space: nowrap;
}

.os-app-menu-separator {
  pointer-events: none;
}

/* ── App Textarea ──────────────────────────────────────────────── */

.os-app-textarea {
  flex: 1;
  border: none;
  outline: none;
  resize: none;
}

/* ── Notepad Find Bar ─────────────────────────────────────────── */

.notepad-find-bar {
  display: flex;
  gap: 4px;
  padding: 4px 8px;
  align-items: center;
  flex-shrink: 0;
}

.notepad-find-input {
  flex: 1;
}

.notepad-find-btn {
  cursor: pointer;
  white-space: nowrap;
}

/* ── App Statusbar ─────────────────────────────────────────────── */

.os-app-statusbar {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

/* ── App Toolbar ───────────────────────────────────────────────── */

.os-app-toolbar {
  display: flex;
  align-items: center;
}

.os-app-toolbar-btn {
  display: flex;
  align-items: center;
  cursor: pointer;
  background: none;
  border: 1px solid transparent;
  font-size: 11px;
  padding: 2px 6px;
  gap: 2px;
}

.os-app-toolbar-btn.disabled,
.os-app-toolbar-btn:disabled {
  opacity: 0.5;
  cursor: default;
}

.os-app-toolbar-separator {
  width: 1px;
  height: 20px;
  background: #ccc;
  margin: 0 4px;
}

.os-app-toolbar-path {
  font-size: 11px;
  font-weight: bold;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ── App Addressbar ────────────────────────────────────────────── */

.os-app-addressbar {
  display: flex;
  align-items: center;
}

.os-app-addressbar-input-wrap {
  flex: 1;
  position: relative;
  display: flex;
}

.os-app-addressbar-input-wrap input {
  flex: 1;
  min-width: 0;
}

.os-app-addressbar-dropdown-btn {
  cursor: pointer;
  flex-shrink: 0;
  border: none;
  background: none;
  display: flex;
  align-items: center;
}

.os-app-addressbar-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  z-index: 100;
  max-height: 200px;
  overflow-y: auto;
}

.os-app-addressbar-dropdown-item {
  display: block;
  width: 100%;
  text-align: left;
  cursor: default;
  border: none;
  background: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.os-app-go-btn {
  cursor: pointer;
  flex-shrink: 0;
}

/* ── App Explorer (My Computer) ────────────────────────────────── */

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

.os-app-sidebar {
  flex-shrink: 0;
}

.os-app-sidebar-section {
  overflow: hidden;
}

.os-app-sidebar-item {
  cursor: pointer;
}

.os-app-explorer-main {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
}

.os-app-content {
  flex: 1;
  overflow: auto;
  padding: 4px;
}

.os-app-empty {
  padding: 20px;
  text-align: center;
  color: #888;
}

.os-app-error {
  padding: 20px;
  text-align: center;
}

.os-app-section-label {
  padding: 4px 8px;
  font-weight: bold;
  font-size: 11px;
  color: #333;
}

/* ── App Grid ──────────────────────────────────────────────────── */

.os-app-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 4px;
}

.os-app-grid-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 80px;
  padding: 4px;
  cursor: default;
  text-align: center;
  border-radius: 3px;
}

.os-app-grid-item:hover {
  background: rgba(0, 0, 0, 0.04);
}

.os-app-grid-item img {
  width: 32px;
  height: 32px;
}

.os-app-grid-label {
  font-size: 11px;
  word-break: break-word;
  margin-top: 2px;
  line-height: 1.2;
}

.os-app-empty-trash-btn {
  cursor: pointer;
  padding: 1px 6px;
  font-size: 11px;
  background: #ddd;
  border: 1px solid #999;
  border-radius: 2px;
}

.os-app-empty-trash-btn:hover {
  background: #ccc;
}

/* ── Browser (IE) ──────────────────────────────────────────────── */

.ie-browser {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.ie-content {
  flex: 1;
  overflow: auto;
  position: relative;
}

.ie-iframe-wrapper {
  width: 100%;
  height: 100%;
  position: relative;
}

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

.ie-blank {
  width: 100%;
  height: 100%;
  background: #fff;
}

.ie-throbber-spacer {
  flex: 1;
}

.ie-throbber {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ie-throbber-icon {
  width: 20px;
  height: 20px;
  border-radius: 50%;
}

.ie-context-menu {
  position: absolute;
  z-index: 200;
  min-width: 140px;
}

.ie-context-menu-item {
  display: block;
  width: 100%;
  text-align: left;
  cursor: default;
  border: none;
  background: none;
  white-space: nowrap;
}

.ie-context-menu-separator {
  pointer-events: none;
}

.ie-home-content {
  display: flex;
  flex-direction: column;
}

.ie-home-links {
  list-style: none;
  margin: 0;
  padding: 0;
}

/* IE Search Page */
.ie-search-page {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100%;
  padding: 40px 20px;
}

.ie-search-box {
  display: flex;
  gap: 4px;
  width: 100%;
  max-width: 400px;
}

.ie-search-input {
  flex: 1;
}

.ie-search-links {
  margin-top: 16px;
}

/* IE Portfolio Page */
.ie-portfolio {
  overflow: auto;
  height: 100%;
}

.ie-portfolio-layout {
  width: 100%;
}

.ie-portfolio-sidebar {
  width: 150px;
  vertical-align: top;
}

.ie-portfolio-main {
  vertical-align: top;
}

.ie-portfolio-nav {
  padding: 8px;
}

.ie-portfolio-nav ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

/* IE Help Page */
.ie-help {
  padding: 20px;
  overflow: auto;
  height: 100%;
}

.ie-help ul {
  margin: 8px 0 16px;
}

/* ── Boot Screen ───────────────────────────────────────────────── */

.os-boot-overlay {
  position: fixed;
  inset: 0;
  z-index: 999999;
  background: #000;
}

.os-app-loading {
  padding: 16px;
  font-size: 11px;
}

.os-boot-loading {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
}

.os-boot-content {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.os-boot-logo {
  display: flex;
  align-items: center;
}

.os-boot-logo-text {
  display: flex;
  flex-direction: column;
}

.os-boot-progress-track {
  overflow: hidden;
}

.os-boot-copyright {
  position: absolute;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
}

/* ── Theme Picker ─────────────────────────────────────────────── */

.theme-picker {
  display: flex;
  flex-direction: column;
  height: 100%;
  position: relative;
  overflow: hidden;
}

.theme-picker-tabs-row {
  display: flex;
  align-items: flex-end;
  flex-shrink: 0;
}

.theme-picker-tab {
  position: relative;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.theme-picker-content {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.theme-picker-preview-area {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  flex-shrink: 0;
}

.theme-picker-details {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.theme-picker-actions {
  display: flex;
  align-items: center;
  margin-top: auto;
}

.theme-picker-transition {
  position: absolute;
  inset: 0;
  z-index: 10;
}

/* ── Oli Tray Icon ─────────────────────────────────────────────── */

.oli-tray-btn {
  background: none;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ── Oli Chat App ──────────────────────────────────────────────── */

.oli-chat {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.oli-chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.oli-chat-colony-info {
  display: flex;
  flex-direction: column;
}

.oli-chat-ants {
  display: flex;
}

.oli-chat-messages {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

.oli-chat-welcome {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
}

.oli-chat-msg {
  display: flex;
  flex-direction: column;
}

.oli-chat-msg--user {
  align-items: flex-end;
}

.oli-chat-msg-header {
  display: flex;
  align-items: center;
}

.oli-chat-avatar {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.oli-chat-input {
  display: flex;
}

.oli-chat-input input {
  flex: 1;
  outline: none;
}

.oli-chat-quota {
  text-align: center;
  padding: 2px 8px;
}

.oli-chat-header-right {
  display: flex;
  align-items: center;
}

.oli-chat-typing {
  display: inline-flex;
  align-items: center;
}

/* ── Terminal App ──────────────────────────────────────────────── */

.terminal {
  height: 100%;
  overflow: hidden;
  cursor: text;
}

.terminal-output {
  height: 100%;
  overflow-y: auto;
}

.terminal-input-line {
  display: flex;
  align-items: center;
}

.terminal-prompt {
  flex-shrink: 0;
}

.terminal-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  padding: 0;
}

/* ── Utility: App Layout ───────────────────────────────────────── */

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

/* ── Alt+Tab Switcher ─────────────────────────────────────────── */

.os-alt-tab-overlay {
  position: fixed;
  inset: 0;
  z-index: 200000;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.os-alt-tab-container {
  display: flex;
  gap: 8px;
  padding: 16px;
  max-width: 80vw;
  flex-wrap: wrap;
  justify-content: center;
}

.os-alt-tab-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  min-width: 80px;
}

.os-alt-tab-label {
  font-size: 11px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100px;
}

/* ── Display Properties ───────────────────────────────────────── */

.os-display-props {
  display: flex;
  flex-direction: column;
  height: 100%;
  font-size: 11px;
}

.os-display-props-tabs {
  display: flex;
  padding: 4px 8px 0;
  gap: 2px;
}

.os-display-props-tab {
  padding: 4px 12px;
  border: 1px solid #999;
  border-bottom: none;
  background: #e0e0e0;
  cursor: pointer;
  font-size: 11px;
  border-radius: 3px 3px 0 0;
}

.os-display-props-tab.active {
  background: #f0f0f0;
  border-bottom: 1px solid #f0f0f0;
  margin-bottom: -1px;
  position: relative;
  z-index: 1;
}

.os-display-props-body {
  flex: 1;
  border-top: 1px solid #999;
  padding: 12px;
  overflow: auto;
  background: #f0f0f0;
}

.os-display-props-preview {
  display: flex;
  justify-content: center;
  margin-bottom: 12px;
}

.os-display-props-monitor {
  width: 200px;
  height: 150px;
  border: 3px solid #555;
  border-radius: 6px 6px 2px 2px;
  background: #333;
  padding: 8px;
  position: relative;
}

.os-display-props-monitor::after {
  content: "";
  display: block;
  width: 60px;
  height: 12px;
  background: #555;
  margin: 6px auto 0;
  border-radius: 0 0 4px 4px;
}

.os-display-props-screen {
  width: 100%;
  height: 100%;
  border-radius: 2px;
}

.os-display-props-section {
  margin-bottom: 10px;
}

.os-display-props-label {
  display: block;
  margin-bottom: 4px;
  font-weight: bold;
}

.os-display-props-list {
  border: 1px solid #999;
  background: #fff;
  max-height: 100px;
  overflow-y: auto;
  border-radius: 2px;
}

.os-display-props-list-item {
  padding: 2px 6px;
  cursor: pointer;
}

.os-display-props-list-item:hover {
  background: #e8e8e8;
}

.os-display-props-list-item.selected {
  background: #316ac5;
  color: #fff;
}

.os-display-props-colors {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.os-display-props-color-swatch {
  width: 24px;
  height: 24px;
  border: 2px solid #999;
  border-radius: 2px;
  cursor: pointer;
  padding: 0;
}

.os-display-props-color-swatch:hover {
  border-color: #333;
}

.os-display-props-color-swatch.selected {
  border-color: #316ac5;
  box-shadow: 0 0 0 1px #316ac5;
}

.os-display-props-footer {
  display: flex;
  justify-content: flex-end;
  gap: 6px;
  padding: 8px 12px;
  border-top: 1px solid #ddd;
}

.os-display-props-btn {
  padding: 3px 16px;
  font-size: 11px;
  cursor: pointer;
  border: 1px solid #999;
  background: #e0e0e0;
  border-radius: 2px;
}

.os-display-props-btn:hover {
  background: #d0d0d0;
}

/* ── Screensaver ──────────────────────────────────────────────── */

.os-screensaver {
  position: fixed;
  inset: 0;
  z-index: 300000;
  background: #000;
  cursor: none;
  overflow: hidden;
}

.os-screensaver-content {
  width: 100%;
  height: 100%;
  position: relative;
}

.os-screensaver-star {
  position: absolute;
  width: 2px;
  height: 2px;
  background: #fff;
  border-radius: 50%;
  animation: screensaver-star-fly linear infinite;
}

@keyframes screensaver-star-fly {
  0% { transform: scale(0); opacity: 0; }
  20% { opacity: 1; }
  100% { transform: scale(4); opacity: 0; }
}

.os-screensaver-bubble {
  position: absolute;
  bottom: -100px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, rgba(255,255,255,0.3), rgba(100,150,255,0.1));
  border: 1px solid rgba(255,255,255,0.2);
  animation: screensaver-bubble-rise linear infinite;
}

@keyframes screensaver-bubble-rise {
  0% { transform: translateY(0); opacity: 0.7; }
  100% { transform: translateY(-120vh); opacity: 0; }
}

.os-screensaver-logo {
  position: absolute;
  font-size: 48px;
  color: #fff;
  animation: screensaver-bounce 8s linear infinite;
}

@keyframes screensaver-bounce {
  0% { top: 10%; left: 10%; }
  25% { top: 60%; left: 80%; }
  50% { top: 30%; left: 50%; }
  75% { top: 70%; left: 20%; }
  100% { top: 10%; left: 10%; }
}

/* ── Paint app layout ──────────────────────────────────────── */

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

.paint-toolbox {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 4px;
  flex-shrink: 0;
  width: 60px;
}

.paint-tool-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4px;
  cursor: pointer;
  font-size: 9px;
  text-align: center;
  border: none;
  background: none;
}

.paint-tool-separator {
  height: 1px;
  margin: 4px 0;
}

.paint-size-label {
  display: flex;
  flex-direction: column;
  font-size: 9px;
  gap: 2px;
}

.paint-size-slider {
  width: 100%;
}

.paint-canvas-wrap {
  flex: 1;
  overflow: auto;
  position: relative;
}

.paint-canvas {
  display: block;
  cursor: crosshair;
}

.paint-palette {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  flex-shrink: 0;
}

.paint-color-preview {
  width: 28px;
  height: 28px;
  flex-shrink: 0;
  position: relative;
}

.paint-color-fg {
  width: 100%;
  height: 100%;
}

.paint-color-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 1px;
}

.paint-color-swatch {
  width: 16px;
  height: 16px;
  cursor: pointer;
  border: none;
  padding: 0;
}

/* ── Calculator app layout ─────────────────────────────────── */

.calc-body {
  display: flex;
  flex-direction: column;
  flex: 1;
  padding: 8px;
  gap: 6px;
}

.calc-display {
  text-align: right;
  padding: 4px 8px;
  font-size: 20px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  flex-shrink: 0;
}

.calc-buttons {
  display: flex;
  flex-direction: column;
  gap: 3px;
  flex: 1;
}

.calc-row {
  display: flex;
  gap: 3px;
  flex: 1;
}

.calc-btn {
  flex: 1;
  cursor: pointer;
  font-size: 12px;
  border: none;
  padding: 0;
  min-width: 0;
}

/* ── Minesweeper app layout ────────────────────────────────── */

.ms-body {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
  padding: 8px;
  gap: 6px;
}

.ms-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 4px;
}

.ms-counter {
  font-family: monospace;
  font-size: 20px;
  letter-spacing: 2px;
  width: 50px;
  text-align: center;
}

.ms-face {
  font-size: 18px;
  width: 36px;
  height: 36px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  padding: 0;
}

.ms-board {
  display: grid;
  gap: 0;
  flex: 1;
  width: 100%;
}

.ms-cell {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 12px;
  font-weight: bold;
  padding: 0;
  min-width: 0;
  min-height: 0;
  user-select: none;
}

/* ── Admin / User Accounts App ────────────────────────────────── */

.os-app-admin {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 20px;
  height: 100%;
  overflow-y: auto;
}

.os-app-admin-header {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding-bottom: 16px;
  margin-bottom: 16px;
}

.os-app-admin-avatar {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 20px;
  font-weight: bold;
}

.os-app-admin-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.os-app-admin-name {
  font-weight: bold;
  font-size: 14px;
}

.os-app-admin-role {
  font-size: 11px;
}

.os-app-admin-stats {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 20px;
}

.os-app-admin-stat {
  display: flex;
  justify-content: space-between;
  padding: 6px 8px;
  font-size: 12px;
}

.os-app-admin-stat-label {
  font-weight: normal;
}

.os-app-admin-stat-value {
  font-weight: bold;
}

.os-app-admin-logout {
  padding: 4px 20px;
  cursor: pointer;
  font-size: 12px;
}

.os-app-admin-login {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  width: 100%;
  max-width: 280px;
  padding-top: 20px;
}

.os-app-admin-label {
  font-size: 12px;
  text-align: center;
}

.os-app-admin-field {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
}

.os-app-admin-field-label {
  font-size: 12px;
  white-space: nowrap;
}

.os-app-admin-input {
  flex: 1;
  padding: 3px 4px;
  font-size: 12px;
}

.os-app-admin-error {
  font-size: 11px;
  text-align: center;
}

.os-app-admin-submit {
  padding: 4px 20px;
  cursor: pointer;
  font-size: 12px;
}

.os-app-admin-submit:disabled {
  cursor: default;
  opacity: 0.6;
}

/* ── Reduced Motion ──────────────────────────────────────────────── */

@media (prefers-reduced-motion: reduce) {
  .os-screensaver-star,
  .os-screensaver-bubble,
  .os-screensaver-logo,
  .os-boot-progress-bar,
  .ie-throbber-icon,
  .oli-chat-typing-dot,
  .ie-portfolio-marquee {
    animation: none !important;
  }

  .os-balloon,
  .os-window-layer > * {
    transition: none !important;
  }
}

/* ── Focus Indicators ────────────────────────────────────────────── */

.os-start-menu-item:focus-visible,
.os-taskbar-app-btn:focus-visible,
.os-start-btn:focus-visible,
.os-shutdown-btn:focus-visible,
.os-context-menu-item:focus-visible,
.os-desktop-icon:focus-visible,
.calc-btn:focus-visible,
.ms-cell:focus-visible,
.paint-tool-btn:focus-visible {
  outline: 2px solid Highlight;
  outline-offset: -2px;
}
