/* Extracted from the supplied latest maiDOS page. */
.title-icon {
  width: 18px;
  height: 18px;
  object-fit: contain;
  image-rendering: pixelated;
}
.app-window {
  position: relative;
  z-index: 3;
  width: min(980px, 100%);
  height: min(850px, 100%);
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  background: var(--terminal);
  border: 1px solid var(--border);
  border-radius: 5px;
  overflow: hidden;
  animation: terminal-open 0.35s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}
.app-window.maximized {
  width: 100%;
  height: 100%;
}
.titlebar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex: none;
  height: 36px;
  background: var(--chrome);
  border-bottom: 1px solid #292930;
  user-select: none;
  padding-left: 13px;
}
.title {
  font-size: 12px;
  color: #b1b1b8;
  display: flex;
  gap: 10px;
  align-items: center;
}
.title-symbol {
  color: var(--accent);
  font-size: 16px;
}
.window-controls {
  display: flex;
  align-self: stretch;
}
.window-controls button {
  display: grid;
  place-items: center;
  width: 40px;
  color: #b0b0b8;
  border: 0;
  background: transparent;
  font-size: 18px;
}
.window-controls button:hover {
  background: #2d2d35;
  color: #fff;
}
.window-controls .close:hover {
  background: #9c262e;
}
.window-controls svg {
  width: 12px;
  height: 12px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1;
}
@keyframes terminal-open {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
@media (max-width: 700px) {
  .app-window {
    border-radius: 3px;
  }
  .title {
    font-size: 11px;
  }
  .titlebar {
    padding-left: 10px;
  }
  .window-controls button {
    width: 34px;
  }
  .title .long-title {
    display: none;
  }
}
/* Shared frame: every app gets the same chrome, geometry and interactions. */
.window-layer {
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  isolation: isolate;
  overflow: hidden;
}
.app-window {
  position: absolute;
  pointer-events: auto;
  margin: 0;
  max-width: 100%;
  max-height: 100%;
  box-shadow: 0 16px 60px #0007;
  animation: terminal-open 0.25s ease both;
}
.app-window[data-focused="true"] {
  border-color: #666673;
}
.app-window[data-mode="maximized"],
.app-window[data-mode="fullscreen"] {
  border-radius: 0;
}
.app-window[data-mode="fullscreen"] .titlebar {
  cursor: default;
}
.app-window .titlebar {
  touch-action: none;
  cursor: move;
  min-width: 0;
}
.app-window .title {
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
}
.app-window .title > span {
  overflow: hidden;
  text-overflow: ellipsis;
}
.app-window .title-icon,
.app-window .window-controls {
  flex-shrink: 0;
}
.app-content {
  flex: 1;
  min-height: 0;
  min-width: 0;
  overflow: auto;
  position: relative;
}
.app-loading,
.app-load-error {
  padding: 20px;
}
.app-load-error button {
  background: var(--accent);
  color: #101014;
  border: 0;
  padding: 8px 16px;
}
.resize-handle {
  position: absolute;
  right: 0;
  bottom: 0;
  width: 17px;
  height: 17px;
  touch-action: none;
  cursor: nwse-resize;
  background: linear-gradient(
    135deg,
    transparent 65%,
    #555560 66%,
    transparent 72%,
    transparent 80%,
    #555560 81%,
    transparent 88%
  );
}
.app-window.moving {
  user-select: none;
}
.app-window.moving iframe {
  pointer-events: none;
}
@media (prefers-reduced-motion: reduce) {
  .app-window {
    animation: none;
  }
}
