/* ============================================================
   AIJETO — Retro paint application UI
   Visual language: late-90s / early-2000s desktop software
   ============================================================ */

:root {
  --desktop: #008080;
  --desktop-dark: #006666;
  --face: #c0c0c0;
  --face-light: #ffffff;
  --face-mid: #dfdfdf;
  --face-dark: #808080;
  --face-darker: #404040;
  --title: #000080;
  --title-end: #000080;
  --title-text: #ffffff;
  --canvas-bg: #808080;
  --paper: #ffffff;
  --select: #000080;
  --select-text: #ffffff;
  --focus: #000000;
  --font: "Tahoma", "MS Sans Serif", "Segoe UI", sans-serif;
  --font-mono: "Courier New", Courier, monospace;
  --app-w: min(94vw, 1600px);
  --app-h: 92vh;
  --toolbar-w: 58px;
  --title-h: 22px;
  --menu-h: 22px;
  --palette-h: 52px;
  --status-h: 22px;
  --bevel-raise: inset 1px 1px 0 var(--face-light), inset -1px -1px 0 var(--face-darker),
    inset 1px 1px 0 var(--face-light), inset -2px -2px 0 var(--face-dark);
  --bevel-sunken: inset 1px 1px 0 var(--face-darker), inset -1px -1px 0 var(--face-light),
    inset 2px 2px 0 var(--face-dark), inset -2px -2px 0 var(--face-mid);
  --bevel-btn: inset 1px 1px 0 var(--face-light), inset -1px -1px 0 var(--face-darker);
  --bevel-btn-press: inset 1px 1px 0 var(--face-darker), inset -1px -1px 0 var(--face-light);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  height: 100%;
  overflow: hidden;
  font-family: var(--font);
  font-size: 12px;
  color: #000;
  background: var(--desktop);
  -webkit-tap-highlight-color: transparent;
}

button,
input,
select,
textarea {
  font-family: inherit;
  font-size: inherit;
}

button {
  cursor: pointer;
}

:focus-visible {
  outline: 1px dotted var(--focus);
  outline-offset: -2px;
}

.seo-text {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ---------- Desktop ---------- */

.desktop {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 100dvh;
  background: var(--desktop);
  background-image: linear-gradient(180deg, var(--desktop) 0%, var(--desktop-dark) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.desktop-wallpaper {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  opacity: 0;
  transition: opacity 150ms linear;
  z-index: 1;
}

.desktop.has-minimized-app .desktop-wallpaper {
  opacity: 1;
}

.desktop-logo {
  width: min(42vw, 280px);
  height: auto;
  opacity: 0.92;
  filter: drop-shadow(0 2px 0 rgba(0, 0, 0, 0.25));
  image-rendering: auto;
  user-select: none;
}

/* ---------- Startup ---------- */

.startup-splash {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: var(--desktop);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 150ms linear;
}

.startup-splash.is-done {
  opacity: 0;
  pointer-events: none;
}

.startup-box {
  background: var(--face);
  padding: 16px 28px;
  box-shadow: var(--bevel-raise);
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 220px;
}

.startup-box p {
  margin: 0;
  font-size: 12px;
}

.startup-icon,
.app-icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  image-rendering: pixelated;
  background:
    linear-gradient(45deg, #fff 25%, transparent 25%) -2px 0 / 4px 4px,
    linear-gradient(-45deg, #fff 25%, transparent 25%) -2px 0 / 4px 4px,
    linear-gradient(45deg, transparent 75%, #fff 75%) -2px -2px / 4px 4px,
    linear-gradient(-45deg, transparent 75%, #fff 75%) -2px -2px / 4px 4px,
    #000080;
  border: 1px solid #000;
  box-shadow: inset 0 0 0 1px #4a90d9;
}

.app-icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  image-rendering: pixelated;
  background:
    radial-gradient(circle at 4px 5px, #e11d48 2px, transparent 2.5px),
    radial-gradient(circle at 9px 4px, #2563eb 2px, transparent 2.5px),
    radial-gradient(circle at 12px 8px, #eab308 2px, transparent 2.5px),
    radial-gradient(circle at 7px 10px, #16a34a 2px, transparent 2.5px),
    linear-gradient(#78716c 0 0) 7px 11px / 2px 4px no-repeat,
    #f5f5f4;
  border: 1px solid #000;
}

.app-icon-sm {
  width: 14px;
  height: 14px;
}

/* ---------- Main application window ---------- */

.paint-app {
  position: relative;
  z-index: 2;
  width: var(--app-w);
  height: var(--app-h);
  max-width: 1600px;
  background: var(--face);
  display: flex;
  flex-direction: column;
  border: 2px solid var(--face);
  box-shadow:
    inset 1px 1px 0 var(--face-light),
    inset -1px -1px 0 var(--face-darker),
    inset 2px 2px 0 var(--face-mid),
    inset -2px -2px 0 var(--face-dark),
    6px 6px 0 rgba(0, 0, 0, 0.28);
  opacity: 0;
  transition: opacity 120ms linear;
  /* visible so menu dropdowns are not clipped */
  overflow: visible;
}

.paint-app.is-ready {
  opacity: 1;
}

.paint-app.is-maximized {
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  max-width: none;
  box-shadow:
    inset 1px 1px 0 var(--face-light),
    inset -1px -1px 0 var(--face-darker);
}

.paint-app.is-minimized {
  display: none;
}

/* ---------- Title bar ---------- */

.titlebar {
  position: relative;
  z-index: 401;
  height: var(--title-h);
  min-height: var(--title-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 2px 3px 2px 4px;
  background: var(--title);
  color: var(--title-text);
  user-select: none;
  flex-shrink: 0;
}

.titlebar-left {
  display: flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
  overflow: hidden;
}

.titlebar-title {
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: 0;
}

.titlebar-controls {
  display: flex;
  gap: 2px;
  flex-shrink: 0;
  margin-left: 8px;
}

.tb-btn {
  width: 16px;
  height: 14px;
  padding: 0;
  margin: 0;
  border: none;
  background: var(--face);
  box-shadow: var(--bevel-btn);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  line-height: 1;
  color: #000;
  font-family: var(--font);
}

.tb-btn span {
  display: block;
  transform: translateY(-1px);
  font-weight: 700;
}

.tb-btn:active,
.tb-btn.is-pressed {
  box-shadow: var(--bevel-btn-press);
}

.tb-btn:active span {
  transform: translate(1px, 0);
}

/* ---------- Menu bar ---------- */

.menu-bar {
  position: relative;
  z-index: 4000;
  height: var(--menu-h);
  min-height: var(--menu-h);
  display: flex;
  align-items: stretch;
  padding: 1px 2px;
  background: var(--face);
  border-bottom: 1px solid var(--face-dark);
  box-shadow: inset 0 -1px 0 var(--face-light);
  flex-shrink: 0;
  user-select: none;
  overflow: visible;
}

.menu-bar::-webkit-scrollbar {
  display: none;
}

.menu-item {
  position: relative;
  flex-shrink: 0;
}

.menu-item.is-open {
  z-index: 5000;
}

.menu-trigger {
  height: 100%;
  border: none;
  background: transparent;
  padding: 1px 8px;
  font-size: 12px;
  color: #000;
}

.menu-trigger:hover,
.menu-item.is-open > .menu-trigger {
  background: var(--select);
  color: var(--select-text);
}

.menu-dropdown {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 200px;
  background: var(--face);
  z-index: 5001;
  padding: 2px;
  box-shadow:
    inset 1px 1px 0 var(--face-light),
    inset -1px -1px 0 var(--face-darker),
    2px 2px 0 rgba(0, 0, 0, 0.35);
}

.menu-item.is-open > .menu-dropdown {
  display: block;
  animation: menuIn 100ms linear;
}

@keyframes menuIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.menu-dropdown button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  border: none;
  background: transparent;
  text-align: left;
  padding: 3px 18px 3px 22px;
  font-size: 12px;
  color: #000;
  white-space: nowrap;
}

.menu-dropdown button:hover,
.menu-dropdown button:focus-visible {
  background: var(--select);
  color: var(--select-text);
  outline: none;
}

.menu-accel {
  margin-left: 24px;
  opacity: 0.85;
  font-size: 11px;
}

.menu-sep {
  height: 1px;
  margin: 3px 2px;
  background: var(--face-dark);
  box-shadow: 0 1px 0 var(--face-light);
}

/* ---------- Workspace ---------- */

.workspace {
  flex: 1;
  display: flex;
  min-height: 0;
  background: var(--face);
  padding: 4px 4px 2px 4px;
  gap: 4px;
  position: relative;
  z-index: 1;
  overflow: hidden;
}

.toolbar-panel {
  width: var(--toolbar-w);
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.toolbar {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  padding: 2px;
  background: var(--face);
  box-shadow: var(--bevel-raise);
}

.tool-btn {
  width: 25px;
  height: 25px;
  padding: 2px;
  border: none;
  background: var(--face);
  box-shadow: var(--bevel-btn);
  display: flex;
  align-items: center;
  justify-content: center;
}

.tool-btn svg {
  width: 16px;
  height: 16px;
  pointer-events: none;
}

.tool-btn:hover {
  background: var(--face-mid);
}

.tool-btn:active,
.tool-btn.is-active {
  box-shadow: var(--bevel-btn-press);
  background: var(--face-mid);
}

.tool-btn.is-active {
  background:
    repeating-conic-gradient(#c0c0c0 0% 25%, #ffffff 0% 50%) 0 0 / 2px 2px;
}

.tool-options {
  margin-top: 2px;
  padding: 6px 4px;
  background: var(--face);
  box-shadow: var(--bevel-sunken);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  min-height: 70px;
}

.size-option {
  background: #000;
  height: 1px;
  width: 18px;
  cursor: pointer;
}

.size-option[data-size="3"] {
  height: 3px;
}
.size-option[data-size="5"] {
  height: 5px;
}
.size-option[data-size="8"] {
  height: 8px;
}

.size-option.is-active {
  outline: 1px dotted #000;
  outline-offset: 2px;
}

/* ---------- Canvas ---------- */

.canvas-panel {
  flex: 1;
  min-width: 0;
  min-height: 0;
  background: var(--canvas-bg);
  box-shadow: var(--bevel-sunken);
  position: relative;
}

.canvas-scroll {
  position: absolute;
  inset: 0;
  overflow: scroll;
  background: var(--canvas-bg);
}

.canvas-wrap {
  position: relative;
  width: 100%;
  height: 100%;
  min-width: 640px;
  min-height: 400px;
  margin: 2px;
  background: var(--paper);
  box-shadow: 1px 1px 0 #000;
}

#paint-canvas,
#paint-overlay {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
}

.paint-overlay {
  z-index: 2;
}

/* ---------- Palette ---------- */

.palette-bar {
  height: var(--palette-h);
  min-height: var(--palette-h);
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 8px 6px 6px;
  background: var(--face);
  flex-shrink: 0;
  border-top: 1px solid var(--face-light);
}

.color-boxes {
  position: relative;
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  background: var(--face);
  box-shadow: var(--bevel-sunken);
}

.color-box {
  position: absolute;
  width: 16px;
  height: 16px;
  border: none;
  padding: 0;
  box-shadow: inset 1px 1px 0 #000, inset -1px -1px 0 #fff;
}

.color-box-fg {
  top: 5px;
  left: 5px;
  z-index: 2;
  background: #000;
}

.color-box-bg {
  top: 13px;
  left: 13px;
  z-index: 1;
  background: #fff;
}

.palette-grid {
  display: grid;
  grid-template-columns: repeat(12, 16px);
  grid-template-rows: 16px 16px;
  gap: 1px;
  padding: 2px;
  background: var(--face);
  box-shadow: var(--bevel-sunken);
  overflow-x: auto;
  max-width: 100%;
}

.palette-swatch {
  width: 16px;
  height: 16px;
  border: none;
  padding: 0;
  box-shadow: inset 1px 1px 0 rgba(255, 255, 255, 0.4), inset -1px -1px 0 rgba(0, 0, 0, 0.5);
}

.palette-swatch:focus-visible {
  outline: 1px dotted #000;
  outline-offset: 1px;
  z-index: 1;
}

/* ---------- Status bar ---------- */

.statusbar {
  height: var(--status-h);
  min-height: var(--status-h);
  display: flex;
  gap: 2px;
  padding: 2px 3px 3px;
  background: var(--face);
  flex-shrink: 0;
  font-size: 11px;
  position: relative;
}

.status-seg {
  box-shadow: var(--bevel-sunken);
  padding: 1px 6px;
  display: flex;
  align-items: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.status-msg {
  flex: 1;
  min-width: 80px;
}

.status-tool {
  width: 120px;
  flex-shrink: 0;
}

.status-coords {
  width: 110px;
  flex-shrink: 0;
}

.status-site {
  width: 90px;
  flex-shrink: 0;
  justify-content: center;
}

.status-grip {
  width: 16px;
  flex-shrink: 0;
  background:
    linear-gradient(135deg, transparent 40%, var(--face-dark) 40%, var(--face-dark) 45%, transparent 45%) 0 0 / 5px 5px,
    linear-gradient(135deg, transparent 40%, var(--face-light) 40%, var(--face-light) 50%, transparent 50%) 1px 1px / 5px 5px;
  box-shadow: none;
}

/* ---------- Window layer ---------- */

.window-layer {
  position: absolute;
  /* Start below title + menu so menus stay clickable */
  top: calc(var(--title-h) + var(--menu-h));
  right: 2px;
  bottom: 2px;
  left: 2px;
  pointer-events: none;
  z-index: 100;
  overflow: hidden;
}

.app-window {
  position: absolute;
  pointer-events: auto;
  background: var(--face);
  box-shadow:
    inset 1px 1px 0 var(--face-light),
    inset -1px -1px 0 var(--face-darker),
    inset 2px 2px 0 var(--face-mid),
    inset -2px -2px 0 var(--face-dark),
    3px 3px 0 rgba(0, 0, 0, 0.25);
  display: flex;
  flex-direction: column;
  min-width: 260px;
  max-width: calc(100% - 16px);
  opacity: 0;
  transform: scale(0.98);
  transition: opacity 120ms linear, transform 120ms linear;
}

.app-window.is-open {
  opacity: 1;
  transform: scale(1);
}

.app-window.is-closing {
  opacity: 0;
  transform: scale(0.98);
}

.app-window.is-mobile {
  max-height: 90vh;
}

.win-titlebar {
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1px 2px 1px 4px;
  background: var(--title);
  color: #fff;
  cursor: move;
  user-select: none;
  flex-shrink: 0;
}

.win-titlebar.is-dragging {
  cursor: move;
}

.app-window:not(.is-active) .win-titlebar {
  background: #808080;
}

.win-title {
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.win-controls {
  display: flex;
  gap: 2px;
}

.win-btn {
  width: 16px;
  height: 14px;
  border: none;
  background: var(--face);
  box-shadow: var(--bevel-btn);
  padding: 0;
  line-height: 1;
  font-size: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #000;
}

.win-btn:active {
  box-shadow: var(--bevel-btn-press);
}

.win-body {
  padding: 12px;
  overflow: auto;
  flex: 1;
  min-height: 0;
  max-height: 60vh;
  font-size: 12px;
  line-height: 1.45;
}

.win-footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 8px 12px 12px;
  flex-shrink: 0;
}

/* ---------- Retro buttons ---------- */

.retro-btn {
  min-width: 75px;
  height: 24px;
  padding: 0 12px;
  border: none;
  background: var(--face);
  box-shadow: var(--bevel-btn), 1px 1px 0 var(--face-darker);
  font-size: 12px;
  color: #000;
}

.retro-btn:active {
  box-shadow: var(--bevel-btn-press);
  padding-top: 1px;
  padding-left: 13px;
}

.retro-btn.is-primary {
  font-weight: 700;
}

.retro-btn:disabled {
  opacity: 0.65;
  cursor: default;
}

/* ---------- Content windows ---------- */

.service-window h2 {
  margin: 0 0 10px;
  font-size: 15px;
  font-weight: 700;
  white-space: pre-line;
}

.service-intro,
.service-note {
  margin: 0 0 10px;
}

.service-note {
  color: #222;
}

.capability-list {
  margin: 0 0 14px;
  padding: 8px 8px 8px 24px;
  background: #fff;
  box-shadow: var(--bevel-sunken);
}

.capability-list li {
  margin: 2px 0;
}

.service-cta {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
}

.service-cta p {
  margin: 0;
  font-weight: 700;
}

.portfolio-subtitle {
  margin: 0 0 6px;
  font-family: "Courier New", Courier, monospace;
  font-size: 11px;
  color: #555;
}

.portfolio-window h2 {
  margin-top: 0;
}

.system-info a {
  color: #000080;
}

.about-window p {
  margin: 0 0 10px;
}

.about-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.about-icon {
  width: 32px;
  height: 32px;
  background:
    linear-gradient(#fff 0 0) 4px 6px / 10px 2px no-repeat,
    linear-gradient(#fff 0 0) 4px 11px / 18px 2px no-repeat,
    linear-gradient(#fff 0 0) 4px 16px / 14px 2px no-repeat,
    linear-gradient(#c00 0 0) 20px 20px / 8px 8px no-repeat,
    #000080;
  border: 1px solid #000;
  box-shadow: var(--bevel-raise);
}

.system-info {
  margin-top: 12px;
  padding: 8px;
  background: #fff;
  box-shadow: var(--bevel-sunken);
}

.system-row {
  display: grid;
  grid-template-columns: 90px 1fr;
  gap: 6px;
  margin: 3px 0;
}

.system-label {
  font-weight: 700;
}

.legal-info {
  margin-top: 12px;
  padding: 8px;
  background: #f3f3f3;
  box-shadow: var(--bevel-sunken);
  font-size: 11px;
  line-height: 1.45;
}

.legal-title {
  display: block;
  margin-bottom: 6px;
  font-size: 11px;
}

.legal-info p {
  margin: 0 0 4px;
}

.legal-info p:last-child {
  margin-bottom: 0;
}

.help-welcome {
  font-weight: 700;
  margin: 0 0 12px;
}

.help-section {
  margin-bottom: 10px;
}

.help-section p {
  margin: 2px 0 0;
}

.dialog-message p {
  margin: 4px 0 8px;
}

.text-prompt label {
  display: block;
  margin-bottom: 6px;
}

.text-prompt input {
  width: 100%;
  padding: 3px 4px;
  border: none;
  box-shadow: var(--bevel-sunken);
  background: #fff;
}

/* ---------- Contact ---------- */

.contact-window h2 {
  margin: 0 0 10px;
  font-size: 15px;
}

.contact-meta {
  margin-bottom: 12px;
  padding: 8px;
  background: #fff;
  box-shadow: var(--bevel-sunken);
}

.contact-meta div {
  margin: 3px 0;
}

.contact-meta span {
  font-weight: 700;
  display: inline-block;
  min-width: 70px;
}

.contact-meta a {
  color: #000080;
}

.contact-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.contact-form label {
  display: flex;
  flex-direction: column;
  gap: 3px;
  font-weight: 700;
}

.contact-form input,
.contact-form select,
.contact-form textarea {
  font-weight: 400;
  padding: 3px 4px;
  border: none;
  background: #fff;
  box-shadow: var(--bevel-sunken);
  width: 100%;
}

.contact-form textarea {
  resize: vertical;
  min-height: 72px;
}

.form-error {
  margin: 0;
  color: #800000;
  font-weight: 700;
}

.contact-success .sent-title {
  font-size: 16px;
  font-weight: 700;
  margin: 12px 0 6px;
}

.contact-success .sent-note {
  font-size: 10px;
  color: #555;
  margin: 0;
}

/* ---------- Send ---------- */

.send-window h2 {
  margin: 0 0 10px;
  font-size: 15px;
}

.send-preview-label {
  margin: 0 0 4px;
  font-weight: 700;
}

.send-preview {
  background: #fff;
  box-shadow: var(--bevel-sunken);
  padding: 6px;
  margin-bottom: 12px;
  max-height: 160px;
  overflow: hidden;
}

.send-preview img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 148px;
  object-fit: contain;
  image-rendering: auto;
  background:
    linear-gradient(45deg, #ddd 25%, transparent 25%) 0 0 / 12px 12px,
    linear-gradient(-45deg, #ddd 25%, transparent 25%) 0 6px / 12px 12px,
    #fff;
}

.send-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.send-note {
  margin: 10px 0 0;
  color: #600;
  font-size: 11px;
}

/* ---------- Work browser ---------- */

.work-browser {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 280px;
}

.work-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.work-filter {
  min-width: 0;
  height: 22px;
  padding: 0 8px;
}

.work-hint {
  margin: 0;
  color: #444;
  font-size: 11px;
}

.work-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: 8px;
  padding: 8px;
  background: #fff;
  box-shadow: var(--bevel-sunken);
  min-height: 200px;
  max-height: 280px;
  overflow: auto;
}

.work-item {
  border: none;
  background: transparent;
  padding: 4px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  color: #000;
}

.work-item.is-selected {
  background: var(--select);
  color: var(--select-text);
}

.work-thumb {
  width: 64px;
  height: 48px;
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--thumb) 80%, #fff) 0%, var(--thumb) 100%);
  border: 1px solid #000;
  box-shadow: inset 1px 1px 0 rgba(255, 255, 255, 0.35);
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
  padding: 2px;
}

.work-thumb-label {
  font-size: 9px;
  font-weight: 700;
  color: #fff;
  text-shadow: 0 1px 0 #000;
  font-family: var(--font-mono);
}

.work-name {
  font-size: 11px;
  font-weight: 700;
  word-break: break-word;
}

.work-meta {
  font-size: 10px;
  opacity: 0.85;
}

.project-viewer {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.project-image {
  width: 100%;
  aspect-ratio: 16 / 9;
  background: var(--thumb, #333);
  box-shadow: var(--bevel-sunken);
  overflow: hidden;
}

.project-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.project-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-family: var(--font-mono);
  font-size: 18px;
  font-weight: 700;
  text-shadow: 1px 1px 0 #000;
  background:
    repeating-linear-gradient(
      45deg,
      transparent,
      transparent 8px,
      rgba(255, 255, 255, 0.06) 8px,
      rgba(255, 255, 255, 0.06) 16px
    ),
    var(--thumb, #333);
}

.project-info h2 {
  margin: 0 0 8px;
  font-size: 15px;
}

.project-info dl {
  margin: 0 0 10px;
  display: grid;
  gap: 4px;
}

.project-info dl > div {
  display: grid;
  grid-template-columns: 80px 1fr;
}

.project-info dt {
  font-weight: 700;
}

.project-info dd {
  margin: 0;
}

.project-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

/* ---------- Taskbar / bye screen ---------- */

.desktop-taskbar {
  display: none;
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 32px;
  background: var(--face);
  box-shadow: inset 0 1px 0 var(--face-light), 0 -1px 0 var(--face-dark);
  padding: 3px 4px;
  align-items: center;
  z-index: 50;
}

.desktop-taskbar.is-visible {
  display: flex;
}

.taskbar-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 26px;
  padding: 0 10px;
  border: none;
  background: var(--face);
  box-shadow: var(--bevel-btn);
  font-weight: 700;
  min-width: 140px;
}

.taskbar-btn:active {
  box-shadow: var(--bevel-btn-press);
}

.bye-screen {
  position: fixed;
  inset: 0;
  z-index: 20000;
  background: #000080;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: menuIn 120ms linear;
}

.bye-box {
  background: var(--face);
  padding: 24px 32px;
  text-align: center;
  box-shadow: var(--bevel-raise), 4px 4px 0 rgba(0, 0, 0, 0.4);
  min-width: 260px;
}

.bye-title {
  font-size: 18px;
  font-weight: 700;
  margin: 0 0 8px;
  color: #000080;
}

.bye-box p {
  margin: 0 0 16px;
}

/* ---------- Scrollbars (WebKit) ---------- */

.win-body::-webkit-scrollbar,
.work-grid::-webkit-scrollbar,
.canvas-scroll::-webkit-scrollbar {
  width: 16px;
  height: 16px;
}

.win-body::-webkit-scrollbar-track,
.work-grid::-webkit-scrollbar-track,
.canvas-scroll::-webkit-scrollbar-track {
  background: #dfdfdf;
}

.win-body::-webkit-scrollbar-thumb,
.work-grid::-webkit-scrollbar-thumb,
.canvas-scroll::-webkit-scrollbar-thumb {
  background: var(--face);
  box-shadow: var(--bevel-btn);
}

.win-body::-webkit-scrollbar-button,
.work-grid::-webkit-scrollbar-button,
.canvas-scroll::-webkit-scrollbar-button {
  background: var(--face);
  box-shadow: var(--bevel-btn);
  height: 16px;
  width: 16px;
}

/* ---------- Responsive ---------- */

@media (max-width: 768px) {
  .desktop {
    align-items: stretch;
    justify-content: stretch;
    background: var(--face);
  }

  .paint-app,
  .paint-app.is-maximized {
    width: 100%;
    height: 100%;
    height: 100dvh;
    max-width: none;
    box-shadow: none;
    border: none;
  }

  .workspace {
    flex-direction: column;
    padding: 2px;
    gap: 2px;
  }

  .toolbar-panel {
    width: 100%;
    flex-direction: row;
    align-items: stretch;
    overflow-x: auto;
  }

  .toolbar {
    display: flex;
    flex-direction: row;
    width: max-content;
    gap: 2px;
  }

  .tool-btn {
    width: 36px;
    height: 36px;
  }

  .tool-options {
    display: none;
  }

  .canvas-wrap {
    min-width: 100%;
    min-height: 240px;
    margin: 0;
  }

  .canvas-scroll {
    overflow: hidden;
  }

  .palette-bar {
    height: auto;
    min-height: 44px;
    overflow-x: auto;
  }

  .palette-grid {
    grid-template-columns: repeat(12, 18px);
    grid-template-rows: 18px 18px;
  }

  .palette-swatch {
    width: 18px;
    height: 18px;
  }

  .status-tool {
    width: 90px;
  }

  .status-coords {
    width: 90px;
  }

  .status-site,
  .status-grip {
    display: none;
  }

  .window-layer {
    top: calc(var(--title-h) + var(--menu-h));
    right: 0;
    bottom: 0;
    left: 0;
  }

  .app-window {
    width: calc(100% - 12px) !important;
    max-height: 88vh;
  }

  .win-titlebar {
    cursor: default;
  }

  .win-body {
    max-height: 70vh;
  }

  .work-grid {
    max-height: 50vh;
  }
}

@media (max-width: 390px) {
  .titlebar-title {
    font-size: 11px;
  }

  .status-tool {
    display: none;
  }
}

/* Fallback if color-mix unsupported */
@supports not (background: color-mix(in srgb, red 50%, white)) {
  .work-thumb {
    background: var(--thumb);
  }
}
