.window {
  position: absolute;
  background: var(--ui-light);
  border: 1px solid var(--ui-black);
  box-shadow: 2px 2px 0 var(--ui-black);
  min-width: 260px;
  overflow: hidden;
  display: none;
  font-family: var(--font-ui);
}
.window.focused {
  outline: 2px solid var(--ui-black);
  outline-offset: 1px;
}
.window.zoom-compact {
  width: var(--win-compact-w);
  height: var(--win-compact-h);
  transition: width 0.25s ease, height 0.25s ease;
}
.window.zoom-expanded {
  width: var(--win-expanded-w);
  height: var(--win-expanded-h);
  transition: width 0.25s ease, height 0.25s ease;
}

.title-bar {
  height: 20px;
  background: linear-gradient(180deg, var(--titlebar-grad-top) 0%, var(--titlebar-grad-bot) 100%);
  border-bottom: 1px solid var(--ui-black);
  display: flex;
  align-items: center;
  padding: 0 3px;
  gap: 3px;
  user-select: none;
  cursor: grab;
  position: relative;
}
.title-bar:active { cursor: grabbing; }
.title-bar::before {
  content: '';
  position: absolute;
  top: 1px; left: 0; right: 0; height: 1px;
  background: rgba(255,255,255,0.8);
  pointer-events: none;
}
.title-bar.inactive { background: #e0e0e0; }
.title-bar.inactive .title-bar-text { color: var(--ui-dark); }
@media (max-width: 768px) { .title-bar { cursor: default; } }

.title-bar-stripes {
  height: 11px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1px;
  background: var(--titlebar-light);
  z-index: 3;
  flex-shrink: 0;
}
.title-bar-stripes.small { width: 10px; padding: 0 1px; }
.title-bar-stripes.large { width: fit-content; padding: 0 6px 0 1px; flex-grow: 1; }
.title-bar-stripes.large-right { width: fit-content; padding: 0 1px 0 6px; flex-grow: 1; }
.title-bar-stripes .bar { width: 100%; height: 1px; background: var(--ui-dark); align-self: stretch; }

.title-bar-text {
  height: 11px;
  line-height: 11px;
  background: var(--titlebar-light);
  padding: 0;
  white-space: nowrap;
  z-index: 4;
  font-size: 11px;
  user-select: none;
  font-family: var(--font-ui);
}

.close-box {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 2px;
  width: 11px;
  height: 11px;
  background: transparent;
  box-shadow: inset 1px 1px 0px rgba(0,0,0,0.6);
  flex-shrink: 0;
  cursor: pointer;
  position: relative;
}
.close-box:focus-visible { outline: 2px solid #0055cc; outline-offset: 2px; }
.close-box .box {
  width: 7px;
  height: 7px;
  background: var(--ui-bg);
  box-shadow: 1px 1px 0px rgba(0,0,0,0.6), inset 1px 1px 0px rgba(255,255,255,0.6);
}

.zoom-box {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 2px;
  width: 11px;
  height: 11px;
  background: transparent;
  box-shadow: inset 1px 1px 0px rgba(0,0,0,0.6);
  flex-shrink: 0;
  cursor: pointer;
  position: relative;
}
.zoom-box:active { box-shadow: inset 1px 1px 2px rgba(0,0,0,0.8); }
.zoom-box:focus-visible { outline: 2px solid #0055cc; outline-offset: 2px; }
.zoom-box .box {
  width: 7px;
  height: 7px;
  background: var(--ui-bg);
  box-shadow: 1px 1px 0px rgba(0,0,0,0.6), inset 1px 1px 0px rgba(255,255,255,0.6);
}
.zoom-box .inner-box {
  position: absolute;
  width: 4.38px;
  height: 4.38px;
  left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  background: var(--ui-bg);
  box-shadow: 1px 1px 0px rgba(0,0,0,0.48), inset 1px 1px 0px rgba(255,255,255,0.6);
}

.window-content {
  padding: 10px;
  font-size: 11px;
  font-family: var(--font-ui);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  height: calc(100% - 20px);
  box-sizing: border-box;
}

.project-body { max-width: 100%; }
.project-body h1, .project-body h2 {
  font-size: 13px; font-weight: bold;
  margin: 8px 0 4px;
  border-bottom: 1px solid var(--ui-dark);
  padding-bottom: 2px;
}
.project-body p { margin: 4px 0; line-height: 1.5; }
.project-body a { color: var(--ui-black); }
.project-body code {
  font-family: monospace;
  background: var(--ui-bg);
  padding: 1px 4px; font-size: 10px;
}
.project-media img, .project-media video {
  width: 100%; display: block;
  border: 1px solid var(--ui-black);
  margin: 8px 0;
}
.project-links { margin-top: 12px; display: flex; flex-wrap: wrap; gap: 8px; }
.project-link-btn {
  appearance: none; -webkit-appearance: none;
  background: var(--ui-bg);
  border: 1px solid var(--ui-black);
  font-family: var(--font-ui); font-size: 11px;
  padding: 4px 10px; cursor: default;
  text-decoration: none; color: var(--ui-black);
  display: inline-block;
}
.project-link-btn:hover { background: var(--ui-black); color: var(--ui-light); }
.project-link-btn:focus-visible { outline: 2px solid #0055cc; }

.finder-item {
  display: flex; flex-direction: column; align-items: center;
  cursor: default; padding: 4px; text-align: center;
  border: 1px solid transparent;
}
.finder-item:hover, .finder-item:focus {
  background: var(--ui-black); color: var(--ui-light); outline: none;
}
.finder-item:hover img, .finder-item:focus img { filter: invert(1); }
.finder-item img { width: 48px; height: 48px; image-rendering: pixelated; }
.finder-item-label {
  font-size: 11px; margin-top: 5px;
  background: var(--ui-light); padding: 1px 3px;
}
.finder-item:hover .finder-item-label,
.finder-item:focus .finder-item-label {
  background: var(--ui-black); color: var(--ui-light);
}
