/* Page-specific styles for index.html — extracted for browser caching */

.project-list { list-style: none; }

.project-list li {
  padding: 4px 6px;
  cursor: default;
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.project-list li:hover { background: var(--highlight); color: var(--highlight-text); }
.project-list li:hover a { color: var(--highlight-text); }
.project-list li:hover .desc { color: var(--silver); }
.project-list li:hover .tag { background: var(--title-light); color: var(--highlight); }

.project-list a {
  text-decoration: none;
  color: var(--link);
  font-weight: bold;
  white-space: nowrap;
}

.project-list a:hover { text-decoration: underline; }
.project-list .desc { color: var(--text-muted); font-size: 12px; }

.tag {
  display: inline-block;
  background: var(--silver);
  color: #000;
  font-size: 11px;
  font-weight: bold;
  padding: 0 6px;
  border: 1px solid;
  border-color: var(--white) var(--shadow) var(--shadow) var(--white);
  white-space: nowrap;
  margin-left: auto;
}

.about { line-height: 1.5; padding: 4px; }

/* My Computer window */
#mycomputer { width: 380px; max-width: 95vw; left: 120px; top: 40px; }

.sysinfo-hero {
  text-align: center;
  padding: 16px 12px 8px;
}

.sysinfo-hero svg { margin-bottom: 8px; }

.sysinfo-hero .sysinfo-os {
  font-size: 16px;
  font-weight: bold;
  margin-bottom: 2px;
}

.sysinfo-hero .sysinfo-browser {
  font-size: 12px;
  color: var(--text-muted);
}

#mycomputer .section-title { margin: 10px 0 4px; }
#mycomputer .sunken { margin-bottom: 0; }

.sysinfo-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.sysinfo-table tr { border-bottom: 1px solid var(--silver); }
.sysinfo-table tr:last-child { border-bottom: none; }

.sysinfo-table th {
  text-align: right;
  padding: 3px 8px 3px 4px;
  font-weight: bold;
  white-space: nowrap;
  width: 1%;
  color: var(--dk-shadow);
}

.sysinfo-table td {
  padding: 3px 4px;
}

/* Virtual Aquarium window */
#aquarium { width: 640px; max-width: 95vw; left: 60px; top: 30px; }
#aquarium .window-body { padding: 0; background: #000; }
#aquarium .aquarium-embed { position: relative; width: 100%; padding-top: 56.25%; overflow: hidden; }
#aquarium .aquarium-embed iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: none; transform: scale(1.5); transform-origin: center; }
#aquarium .aquarium-shield {
  position: absolute; inset: 0; z-index: 1;
  background: #0a1628;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; color: #5a8ab5;
  transition: background 1.5s ease, color 1s ease;
}
#aquarium .aquarium-shield.loaded { background: transparent; color: transparent; }

@media (prefers-reduced-motion: reduce) {
  #aquarium .aquarium-shield { transition: none; }
}

/* On Target window */
#ontarget { width: 640px; max-width: 95vw; left: 80px; top: 40px; }
#ontarget .window-body { padding: 0; }
#ontarget .game-embed { position: relative; width: 100%; height: 400px; }
#ontarget .game-embed iframe { width: 100%; height: 100%; border: none; }

/* Brick Breaker window */
#brickbreaker { width: 520px; max-width: 95vw; left: 100px; top: 30px; }
#brickbreaker .window-body { padding: 0; }
#brickbreaker .game-embed { position: relative; width: 100%; height: 440px; }
#brickbreaker .game-embed iframe { width: 100%; height: 100%; border: none; }

/* WikiBrowser window */
#browser { width: 720px; max-width: 95vw; left: 60px; top: 30px; }
#browser .window-body { padding: 0; display: flex; flex-direction: column; }

.browser-toolbar {
  display: flex;
  gap: 4px;
  padding: 4px;
  background: var(--silver);
  border-bottom: 1px solid var(--shadow);
}

.browser-url {
  flex: 1;
  font-size: 12px;
  font-family: inherit;
  padding: 2px 6px;
  border: 2px solid;
  border-color: var(--shadow) var(--white) var(--white) var(--shadow);
  box-shadow: inset 1px 1px 0 var(--dk-shadow);
  background: #fff;
  outline: none;
}

.browser-viewport {
  width: 100%;
  height: 440px;
  background: #fff;
}

.browser-viewport iframe {
  width: 100%;
  height: 100%;
  border: none;
}

/* Run terminal window */
#run { width: 560px; max-width: 95vw; left: 70px; top: 50px; }
#run .window-body { padding: 0; }
.term {
  background: #000; color: #c0c0c0;
  font-family: var(--mono);
  font-size: 13px; line-height: 1.4;
  padding: 8px; height: 260px;
  display: flex; flex-direction: column;
}
.term-output {
  flex: 1; overflow-y: auto; white-space: pre-wrap; word-break: break-word;
  contain: content;
}
.term-input-row { display: flex; gap: 0; flex-shrink: 0; }
.term-prompt { white-space: pre; }
.term-input {
  flex: 1; background: none; border: none; outline: none;
  color: #c0c0c0; font: inherit; padding: 0; margin: 0;
  caret-color: #c0c0c0;
}

/* Fish Finder window */
#fishfinder { width: 420px; max-width: 95vw; left: 100px; top: 50px; }
.finder-label { font-size: 11px; font-weight: bold; color: var(--dk-shadow); text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 4px; }
.finder-name { font-size: 15px; font-weight: bold; }
.finder-location { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.finder-distance { font-size: 13px; margin-top: 4px; }

/* Fish of the Day window */
#fishofday { width: 480px; max-width: 95vw; left: 160px; top: 60px; }

.photo-frame {
  background: #1a1a2e;
  border: 2px solid;
  border-color: var(--shadow) var(--white) var(--white) var(--shadow);
  box-shadow: inset 1px 1px 0 var(--dk-shadow);
  height: 280px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.photo-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.photo-frame .placeholder {
  color: var(--shadow);
  font-size: 12px;
  padding: 24px;
  text-align: center;
}

.fish-name {
  font-size: 18px;
  font-weight: bold;
  margin-top: 10px;
}

.fish-name[data-linked]:hover { text-decoration: underline; }

.fish-scientific {
  font-style: italic;
  color: var(--text-muted);
  font-size: 13px;
  margin-top: 2px;
}

.fish-details {
  margin-top: 8px;
  font-size: 12px;
  line-height: 1.8;
}

.fish-details dt {
  display: inline;
  font-weight: bold;
}

.fish-details dt::after { content: ": "; }

.fish-details dd {
  display: inline;
  margin: 0;
}

.fish-details dd::after {
  content: "";
  display: block;
}

/* Notepad window */
#notepad { width: 480px; max-width: 95vw; left: 100px; top: 60px; }

.notepad-toolbar {
  display: flex;
  gap: 4px;
  padding: 4px;
  background: var(--silver);
  border-bottom: 1px solid var(--shadow);
}

.notepad-toolbar .btn {
  padding: 2px 10px;
  min-width: 0;
  font-size: 12px;
}

.notepad-editor {
  width: 100%;
  height: 280px;
  border: none;
  padding: 8px;
  font-family: var(--mono);
  font-size: 13px;
  resize: none;
  outline: none;
  background: #fff;
}

#notepad .window-body { position: relative; }

.notepad-dialog {
  position: absolute;
  inset: 0;
  background: var(--silver);
  display: flex;
  flex-direction: column;
  padding: 12px;
  gap: 8px;
  z-index: 1;
}

.notepad-dialog label {
  font-size: 12px;
  font-weight: bold;
}

.notepad-dialog input[type="text"] {
  width: 100%;
  padding: 3px 4px;
  font-size: 13px;
  font-family: inherit;
  border: 2px solid;
  border-color: var(--shadow) var(--white) var(--white) var(--shadow);
  box-shadow: inset 1px 1px 0 var(--dk-shadow);
  box-sizing: border-box;
}

.notepad-file-list {
  flex: 1;
  overflow-y: auto;
  background: var(--white);
  border: 2px solid;
  border-color: var(--shadow) var(--white) var(--white) var(--shadow);
  box-shadow: inset 1px 1px 0 var(--dk-shadow);
  padding: 2px;
}

.notepad-file-item {
  display: flex;
  align-items: center;
  padding: 3px 6px;
  cursor: default;
  font-size: 12px;
}

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

.notepad-file-item span {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.notepad-file-item button {
  font-size: 11px;
  padding: 1px 6px;
  margin-left: 6px;
  flex-shrink: 0;
}

.notepad-dialog .notepad-empty {
  padding: 12px;
  text-align: center;
  color: var(--shadow);
  font-size: 12px;
}

.notepad-dialog .button-row {
  margin-top: 4px;
}

/* Calculator window */
#calculator { width: 240px; max-width: 95vw; left: 140px; top: 70px; }

.calc-display {
  background: #d8e8d0;
  border: 2px solid;
  border-color: var(--shadow) var(--white) var(--white) var(--shadow);
  box-shadow: inset 1px 1px 0 var(--dk-shadow);
  padding: 6px 8px;
  font-size: 20px;
  font-family: var(--mono);
  text-align: right;
  overflow: hidden;
  white-space: nowrap;
  margin-bottom: 8px;
}

.calc-buttons {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 3px;
}

.calc-btn {
  font-family: var(--font);
  font-size: 14px;
  padding: 8px 0;
  background: var(--silver);
  border: 2px solid;
  border-color: var(--white) var(--dk-shadow) var(--dk-shadow) var(--white);
  box-shadow: inset -1px -1px 0 var(--shadow), inset 1px 1px 0 var(--silver);
  cursor: default;
  outline: none;
}

.calc-btn:active {
  border-color: var(--dk-shadow) var(--white) var(--white) var(--dk-shadow);
  box-shadow: inset 1px 1px 0 var(--shadow);
}

.calc-btn.calc-op { background: #e8e0d8; }
.calc-btn.calc-eq { background: #c8d8e8; }
.calc-btn.calc-zero { grid-column: span 2; }

/* Calendar window */
#calendar { width: 240px; max-width: 95vw; left: 160px; top: 80px; }

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

.cal-title {
  flex: 1;
  text-align: center;
  font-weight: bold;
  font-size: 13px;
}

.cal-nav {
  min-width: 28px;
  padding: 4px 0;
  font-size: 16px;
}

.cal-today {
  font-size: 11px;
  padding: 4px 8px;
}

.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 1px;
  text-align: center;
  font-size: 12px;
}

.cal-day-header {
  font-weight: bold;
  padding: 2px 0;
  font-size: 11px;
}

.cal-day {
  padding: 3px 0;
}

.cal-day.other-month {
  color: var(--shadow);
}

.cal-day.today {
  background: var(--highlight);
  color: var(--highlight-text);
  font-weight: bold;
}

/* Time Zone window */
#timezone { width: 540px; max-width: 95vw; left: 130px; top: 60px; }

.tz-toolbar {
  display: flex;
  margin-bottom: 6px;
}

.tz-toggle {
  font-size: 11px;
  padding: 4px 10px;
}

.tz-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
}

.tz-tile {
  text-align: center;
  padding: 6px;
}

.tz-clock-face {
  display: inline-block;
  width: 64px;
  height: 64px;
  border: 2px solid;
  border-color: var(--shadow) var(--white) var(--white) var(--shadow);
  box-shadow: inset 1px 1px 0 var(--dk-shadow);
  border-radius: 50%;
  margin-bottom: 4px;
}

.tz-clock-face svg {
  display: block;
  width: 100%;
  height: 100%;
}

.tz-clock-face svg line[id^="tz"] {
  transform-origin: 32px 32px;
  will-change: transform;
}

.tz-city {
  font-size: 11px;
  font-weight: bold;
}

.tz-digital {
  font-size: 14px;
  font-family: var(--mono);
  display: none;
}

.tz-offset {
  font-size: 10px;
  color: var(--shadow);
}

.tz-grid.tz-digital-mode .tz-clock-face { display: none; }
.tz-grid.tz-digital-mode .tz-digital { display: block; }

/* Explorer / folder browser */
#explorer { width: 600px; max-width: 95vw; left: 80px; top: 60px; }

.folder-toolbar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 6px;
  background: var(--silver);
  border-bottom: 1px solid var(--shadow);
}

.folder-address {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: 1;
}

.folder-address-label {
  font-size: 11px;
  font-weight: bold;
  color: var(--dk-shadow);
  white-space: nowrap;
}

.folder-address-bar {
  flex: 1;
  font-size: 12px;
  font-family: inherit;
  padding: 2px 6px;
  border: 2px solid;
  border-color: var(--shadow) var(--white) var(--white) var(--shadow);
  box-shadow: inset 1px 1px 0 var(--dk-shadow);
  background: #fff;
  white-space: nowrap;
  overflow: hidden;
}

.folder-view-btns {
  display: flex;
  gap: 2px;
}

.folder-view-btn {
  font-family: var(--font);
  font-size: 14px;
  width: 24px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--silver);
  border: 2px solid;
  border-color: var(--white) var(--dk-shadow) var(--dk-shadow) var(--white);
  box-shadow: inset -1px -1px 0 var(--shadow), inset 1px 1px 0 var(--silver);
  cursor: default;
  outline: none;
  padding: 0;
}

.folder-view-btn:active, .folder-view-btn.active {
  border-color: var(--dk-shadow) var(--white) var(--white) var(--dk-shadow);
  box-shadow: inset 1px 1px 0 var(--shadow);
}

/* Two-pane explorer layout */
.explorer-panes {
  display: flex;
  height: 320px;
}

.explorer-sidebar {
  width: 160px;
  min-width: 160px;
  background: #fff;
  border-right: 2px solid;
  border-color: var(--shadow);
  overflow-y: auto;
  padding: 4px 0;
}

.sidebar-tree { font-size: 12px; }

.tree-item {
  padding: 3px 8px;
  cursor: default;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 4px;
}

.tree-item:hover { background: var(--highlight); color: var(--highlight-text); }
.tree-item.active { background: var(--highlight); color: var(--highlight-text); font-weight: bold; }
.tree-child { padding-left: 24px; }
.tree-icon { font-size: 14px; }

.explorer-content {
  flex: 1;
  background: #fff;
  overflow-y: auto;
  padding: 0;
  min-height: 0;
  contain: content;
}

/* Folder icon view */
.folder-icon-view {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
  gap: 4px;
  padding: 8px;
}

.folder-icon-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 6px 4px;
  cursor: default;
  border: 1px solid transparent;
  text-align: center;
}

.folder-icon-tile:hover {
  background: var(--highlight);
  color: var(--highlight-text);
  border-color: var(--highlight);
}

.folder-icon-tile svg { width: 32px; height: 32px; margin-bottom: 4px; }

.folder-icon-tile .folder-icon-label {
  font-size: 11px;
  line-height: 1.2;
  word-break: break-word;
}

/* Folder list view */
.folder-list-view { padding: 0; }

.folder-list-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 3px 8px;
  cursor: default;
  font-size: 12px;
}

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

.folder-list-item:hover .folder-list-desc { color: var(--silver); }
.folder-list-item:hover .tag { background: var(--title-light); color: var(--highlight); }

.folder-list-item svg { width: 16px; height: 16px; flex-shrink: 0; }

.folder-list-item .folder-list-name {
  font-weight: bold;
  white-space: nowrap;
  color: var(--link);
}

.folder-list-item:hover .folder-list-name { color: var(--highlight-text); }

.folder-list-item .folder-list-desc {
  color: var(--text-muted);
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Empty folder message */
.folder-empty {
  padding: 24px;
  text-align: center;
  color: var(--text-muted);
  font-size: 12px;
}

/* Weather window */
#weather { width: 400px; max-width: 95vw; left: 110px; top: 50px; }

.weather-current {
  padding: 12px;
  text-align: center;
}

.weather-temp {
  font-size: 32px;
  font-weight: bold;
}

.weather-desc {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 4px;
}

.weather-forecast {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  padding: 0 8px 8px;
}

.weather-day {
  text-align: center;
  padding: 8px;
  background: var(--white);
  border: 2px solid;
  border-color: var(--shadow) var(--white) var(--white) var(--shadow);
  box-shadow: inset 1px 1px 0 var(--dk-shadow);
}

.weather-day-name {
  font-size: 11px;
  font-weight: bold;
  text-transform: uppercase;
  margin-bottom: 4px;
}

.weather-day-temp {
  font-size: 16px;
  font-weight: bold;
}

.weather-day-range {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
}

.weather-day-desc {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
}

/* Disk Usage window */
#diskusage { width: 340px; max-width: 95vw; left: 150px; top: 60px; }

.du-header {
  padding: 12px 12px 0;
  font-size: 12px;
}

.du-header-title {
  font-weight: bold;
  font-size: 13px;
}

.du-header-sub {
  color: var(--text-muted);
  margin-top: 2px;
}

.du-pie-wrap {
  display: flex;
  justify-content: center;
  padding: 12px 0;
}

.du-pie-wrap svg { display: block; }

.du-legend {
  padding: 0 12px;
  font-size: 12px;
}

.du-legend-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 2px 0;
}

.du-chip {
  display: inline-block;
  width: 12px;
  height: 12px;
  flex-shrink: 0;
  border: 1px solid;
  border-color: var(--shadow) var(--white) var(--white) var(--shadow);
}

.du-legend-label { flex: 1; }
.du-legend-size { width: 70px; text-align: right; }
.du-legend-pct { width: 36px; text-align: right; color: var(--text-muted); }

.du-bar {
  margin: 12px;
  height: 16px;
  display: flex;
  border: 2px solid;
  border-color: var(--shadow) var(--white) var(--white) var(--shadow);
  box-shadow: inset 1px 1px 0 var(--dk-shadow);
  overflow: hidden;
}

.du-bar-seg { height: 100%; }

.du-total {
  padding: 0 12px 12px;
  font-size: 12px;
  color: var(--text-muted);
}

/* Help window */
#help { width: 640px; max-width: 95vw; left: 90px; top: 40px; }

.help-toolbar {
  display: flex;
  gap: 4px;
  padding: 4px 6px;
  background: var(--silver);
  border-bottom: 1px solid var(--shadow);
}

.help-tb-btn {
  padding: 2px 10px;
  min-width: 0;
  font-size: 12px;
}

.help-tb-btn[disabled] {
  color: var(--shadow);
}

.help-panes {
  display: flex;
  height: 360px;
}

.help-nav {
  width: 200px;
  min-width: 200px;
  display: flex;
  flex-direction: column;
  background: var(--silver);
  border-right: 2px solid var(--shadow);
}

.help-nav.hidden { display: none; }

.help-tabs {
  display: flex;
  padding: 4px 4px 0;
  border-bottom: 1px solid var(--shadow);
  background: var(--silver);
}

.help-tab {
  font-family: var(--font);
  font-size: 11px;
  padding: 3px 10px;
  background: var(--silver);
  border: 1px solid var(--shadow);
  border-bottom: none;
  margin-bottom: -1px;
  cursor: default;
  outline: none;
}

.help-tab.active {
  background: #fff;
  border-bottom: 1px solid #fff;
  font-weight: bold;
}

.help-tab-body {
  flex: 1;
  overflow-y: auto;
  background: #fff;
  contain: content;
}

.help-content {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
  font-size: 12px;
  contain: content;
  line-height: 1.6;
  background: #fff;
}

/* Help tree (Contents tab) */
.help-tree-folder {
  font-weight: bold;
  padding: 3px 8px;
  cursor: default;
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
}

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

.help-tree-children { display: none; }
.help-tree-children.open { display: block; }

.help-tree-topic {
  padding: 2px 8px 2px 28px;
  cursor: default;
  font-size: 12px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.help-tree-topic:hover { background: var(--highlight); color: var(--highlight-text); }
.help-tree-topic.active { background: var(--highlight); color: var(--highlight-text); font-weight: bold; }

.help-tree-icon { font-size: 13px; }

/* Help index & search */
.help-index-input,
.help-search-input {
  width: 100%;
  font-size: 12px;
  font-family: inherit;
  padding: 2px 6px;
  border: 2px solid;
  border-color: var(--shadow) var(--white) var(--white) var(--shadow);
  box-shadow: inset 1px 1px 0 var(--dk-shadow);
  background: #fff;
  outline: none;
  box-sizing: border-box;
}

.help-index-header,
.help-search-header {
  padding: 6px;
  font-weight: bold;
  font-size: 11px;
}

.help-list-item {
  padding: 3px 8px;
  font-size: 12px;
  cursor: default;
}

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

.help-no-results {
  padding: 12px 8px;
  color: var(--text-muted);
  font-style: italic;
  font-size: 12px;
}

.help-search-btn {
  padding: 2px 10px;
  min-width: 0;
  font-size: 12px;
  margin-top: 4px;
}

/* Help topic content */
.help-topic-title {
  font-size: 16px;
  font-weight: bold;
  margin-bottom: 8px;
}

.help-topic-heading {
  font-size: 13px;
  font-weight: bold;
  margin: 10px 0 4px;
}

.help-topic-p {
  margin-bottom: 6px;
}

.help-topic-ul {
  margin: 0 0 6px 20px;
  padding: 0;
}

.help-topic-ul li {
  margin-bottom: 2px;
}

.help-topic-sa {
  border-top: 1px solid var(--shadow);
  margin-top: 12px;
  padding-top: 8px;
  font-size: 11px;
}

.help-topic-sa-label {
  font-weight: bold;
  margin-bottom: 4px;
}

.help-topic-link {
  color: var(--link);
  cursor: pointer;
}

.help-topic-link:hover { text-decoration: underline; }

/* Paint window */
#paint { width: 720px; max-width: 95vw; left: 60px; top: 30px; }
#paint .window-body { position: relative; display: flex; flex-direction: column; }

.paint-toolbar {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px;
  background: var(--silver);
  border-bottom: 1px solid var(--shadow);
  flex-shrink: 0;
}

.paint-toolbar .btn {
  padding: 2px 10px;
  min-width: 0;
  font-size: 12px;
}

.paint-tb-sep {
  width: 1px;
  height: 20px;
  background: var(--shadow);
  margin: 0 4px;
  flex-shrink: 0;
}

.paint-size-label {
  display: flex;
  align-items: center;
  font-size: 11px;
  gap: 4px;
  white-space: nowrap;
}

#paintSize { width: 80px; }

.paint-main {
  display: flex;
  height: 400px;
  flex: 1;
  min-height: 0;
}

.paint-sidebar {
  width: 36px;
  min-width: 36px;
  background: var(--silver);
  border-right: 1px solid var(--shadow);
  display: flex;
  flex-direction: column;
  padding: 2px;
  gap: 1px;
  flex-shrink: 0;
}

.paint-tool {
  width: 30px;
  height: 30px;
  border: 1px solid transparent;
  background: none;
  padding: 2px;
  cursor: default;
  display: flex;
  align-items: center;
  justify-content: center;
  outline: none;
}

.paint-tool svg {
  width: 16px;
  height: 16px;
}

.paint-tool:hover {
  background: var(--silver);
  border-color: var(--white) var(--shadow) var(--shadow) var(--white);
}

.paint-tool.active {
  border-color: var(--shadow) var(--white) var(--white) var(--shadow);
  background: #d0ccc4;
}

.paint-canvas-wrap {
  flex: 1;
  position: relative;
  overflow: auto;
  background: var(--shadow);
}

#paintCanvas, #paintPreview {
  position: absolute;
  top: 0;
  left: 0;
  cursor: crosshair;
  image-rendering: pixelated;
}

#paintCanvas { background: #fff; }
#paintPreview { pointer-events: none; }

.paint-palette-bar {
  display: flex;
  align-items: center;
  padding: 4px;
  gap: 8px;
  background: var(--silver);
  border-top: 1px solid var(--shadow);
  flex-shrink: 0;
}

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

.paint-fg {
  position: absolute;
  top: 0;
  left: 0;
  width: 18px;
  height: 18px;
  border: 2px solid;
  border-color: var(--shadow) var(--white) var(--white) var(--shadow);
  z-index: 1;
  cursor: default;
}

.paint-bg {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 18px;
  height: 18px;
  border: 2px solid;
  border-color: var(--shadow) var(--white) var(--white) var(--shadow);
  cursor: default;
}

.paint-swatches {
  display: grid;
  grid-template-columns: repeat(14, 16px);
  grid-template-rows: repeat(2, 16px);
  gap: 1px;
}

.paint-swatch {
  width: 16px;
  height: 16px;
  border: 1px solid var(--shadow);
  cursor: default;
}

.paint-swatch:hover { border-color: var(--dk-shadow); }

/* Paint dialog (Save As / Open) */
.paint-dialog {
  position: absolute;
  inset: 0;
  background: var(--silver);
  display: flex;
  flex-direction: column;
  padding: 12px;
  gap: 8px;
  z-index: 1;
}

.paint-dialog label {
  font-size: 12px;
  font-weight: bold;
}

.paint-dialog input[type="text"] {
  width: 100%;
  padding: 3px 4px;
  font-size: 13px;
  font-family: inherit;
  border: 2px solid;
  border-color: var(--shadow) var(--white) var(--white) var(--shadow);
  box-shadow: inset 1px 1px 0 var(--dk-shadow);
  box-sizing: border-box;
}

.paint-file-list {
  flex: 1;
  overflow-y: auto;
  background: var(--white);
  border: 2px solid;
  border-color: var(--shadow) var(--white) var(--white) var(--shadow);
  box-shadow: inset 1px 1px 0 var(--dk-shadow);
  padding: 2px;
}

.paint-file-item {
  display: flex;
  align-items: center;
  padding: 3px 6px;
  cursor: default;
  font-size: 12px;
  gap: 8px;
}

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

.paint-file-item span {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.paint-file-item button {
  font-size: 11px;
  padding: 1px 6px;
  flex-shrink: 0;
}

.paint-file-thumb {
  width: 32px;
  height: 24px;
  border: 1px solid var(--shadow);
  object-fit: cover;
  flex-shrink: 0;
  background: #fff;
}

.paint-dialog .paint-empty {
  padding: 12px;
  text-align: center;
  color: var(--shadow);
  font-size: 12px;
}

.paint-dialog .button-row {
  margin-top: 4px;
}

/* ── Mobile Launcher ── */
.mobile-launcher { display: none; }

@media (max-width: 767px) {
  .desktop-area, .taskbar, .start-menu { display: none !important; }

  .mobile-launcher {
    display: flex;
    flex-direction: column;
    flex: 1;
    overflow-y: auto;
  }

  .launcher-header {
    position: sticky;
    top: 0;
    z-index: 5;
    background: linear-gradient(to right, var(--title-dark), var(--title-light));
    color: var(--white);
    font-weight: bold;
    font-size: 16px;
    padding: 12px 16px;
    text-align: center;
  }

  .launcher-content {
    padding: 12px;
  }

  .launcher-section {
    margin-bottom: 16px;
  }

  .launcher-section-title {
    font-size: 11px;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: rgba(255,255,255,0.7);
    margin-bottom: 8px;
    padding: 0 4px;
  }

  .launcher-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
  }

  .launcher-tile {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 12px 4px;
    background: rgba(255,255,255,0.1);
    border-radius: 8px;
    cursor: default;
    border: none;
    font: inherit;
    color: var(--white);
  }

  .launcher-tile:active {
    background: rgba(255,255,255,0.25);
  }

  .launcher-tile svg {
    width: 36px;
    height: 36px;
  }

  .launcher-tile-label {
    font-size: 11px;
    text-align: center;
    line-height: 1.2;
    color: var(--white);
    text-shadow: 0 1px 2px rgba(0,0,0,0.5);
  }

  /* Full-screen windows on mobile */
  .window.draggable {
    position: fixed !important;
    inset: 0 !important;
    width: 100vw !important;
    max-width: 100vw !important;
    height: var(--vh, 100vh) !important;
    z-index: 20 !important;
    display: flex;
    flex-direction: column;
  }

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

  .titlebar-btn[aria-label="Minimize"] { display: none; }

  /* Content adjustments for mobile */
  .explorer-panes { height: auto; flex: 1; }
  .explorer-sidebar { display: none; }
  .help-panes { height: auto; flex: 1; }
  .help-nav { display: none; }
  .browser-viewport { height: auto; flex: 1; }
  .photo-frame { height: 200px; }
  #ontarget .game-embed { height: 100%; }
  #brickbreaker .game-embed { height: 100%; }

  /* Paint mobile */
  .paint-main { height: auto; flex: 1; }
  .paint-sidebar { flex-direction: row; width: auto; min-width: 0; flex-wrap: wrap; }
  .paint-swatches { grid-template-columns: repeat(7, 16px); grid-template-rows: repeat(4, 16px); }
}
