/* Explorer-style windows. Each carries its own --c (accent) from the track it belongs to. */
.windows { position: fixed; inset: 0 0 var(--taskbar); pointer-events: none; z-index: 20; }
.win {
  --c: var(--base);
  --cd: var(--deep);
  position: absolute;
  width: min(640px, calc(100vw - 24px));
  height: min(460px, calc(100svh - var(--taskbar) - 40px));
  display: grid;
  grid-template-rows: auto auto auto 1fr auto;
  pointer-events: auto;
  border-radius: 10px 10px 4px 4px;
  background: #ece9e1;
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--cd) 80%, #000), 0 18px 50px #0008, 0 4px 10px #0005;
  overflow: hidden;
  animation: winIn 0.42s var(--ease-spring);
  transform-origin: var(--ox, 50%) var(--oy, 50%);
}
@keyframes winIn { from { transform: scale(0.2); opacity: 0; } }
.win.is-closing { animation: winOut 0.22s ease-in forwards; }
@keyframes winOut { to { transform: scale(0.6); opacity: 0; } }
.win.is-min { display: none; }
.win__bar {
  height: 32px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 5px 0 9px;
  color: #fff;
  font: 700 13px var(--ui);
  text-shadow: 1px 1px 1px #0009;
  background:
    linear-gradient(180deg, #ffffff90 0%, #ffffff20 40%, #0000 50%, #ffffff18 100%),
    linear-gradient(90deg, var(--cd), var(--c) 55%, color-mix(in srgb, var(--c) 60%, #fff));
  cursor: grab;
  touch-action: none;
  user-select: none;
}
.win:not(.is-front) .win__bar { filter: saturate(0.45) brightness(1.1); }
.win__bar:active { cursor: grabbing; }
.win__bar i { width: 16px; height: 16px; border-radius: 4px; background: radial-gradient(circle at 35% 30%, #fff, var(--c) 60%, var(--cd)); box-shadow: 0 0 0 1px #0004; }
.win__bar span { flex: 1; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.win__btn {
  width: 22px;
  height: 22px;
  border: 1px solid #fffc;
  border-radius: 4px;
  padding: 0;
  display: grid;
  place-items: center;
  background: linear-gradient(180deg, #ffffff70, #ffffff10 50%, #0001);
  box-shadow: inset 0 0 0 1px #0002;
}
.win__btn svg { width: 11px; height: 11px; stroke: #fff; stroke-width: 2; fill: none; }
.win__btn--x { background: linear-gradient(180deg, #ffb09b, #e2462b 50%, #c1301a); }
.win__btn:hover { filter: brightness(1.2); }
.win__menu { display: flex; gap: 0; padding: 2px 4px; border-bottom: 1px solid #d0cbbd; background: #f6f4ee; font-size: 11px; }
.win__menu span { padding: 2px 7px; border-radius: 2px; }
.win__menu span:hover { background: var(--c); color: #fff; }
.win__addr {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 3px 6px;
  border-bottom: 1px solid #d0cbbd;
  background: linear-gradient(#fbfaf6, #ebe8de);
  font-size: 11px;
}
.win__addr label { color: #6a6658; }
.win__addr div { flex: 1; padding: 2px 6px; border: 1px solid #7f9db9; background: #fff; font-family: var(--ui); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.win__body { display: grid; grid-template-columns: 190px 1fr; min-height: 0; }
.win__side {
  padding: 10px;
  overflow: auto;
  background: linear-gradient(180deg, color-mix(in srgb, var(--c) 35%, #c6d3f7), color-mix(in srgb, var(--cd) 40%, #6375d6));
}
.pane { border-radius: 6px 6px 0 0; overflow: hidden; margin-bottom: 10px; background: #f0f3fd; box-shadow: 0 1px 2px #0003; }
.pane h5 {
  margin: 0;
  padding: 6px 10px;
  font-size: 11px;
  color: #fff;
  background: linear-gradient(90deg, var(--cd), var(--c));
}
.pane ul { margin: 0; padding: 7px 10px; list-style: none; display: grid; gap: 5px; font-size: 11px; }
.pane a,
.pane button { color: #1b3e9c; text-decoration: none; border: 0; background: none; padding: 0; text-align: left; }
.pane a:hover,
.pane button:hover { text-decoration: underline; color: var(--cd); }
.pane p { margin: 0; padding: 7px 10px; font-size: 11px; line-height: 1.45; color: #333; }
.win__main { padding: 14px 16px; overflow: auto; background: #fff; }
.win__main h3 { margin: 0 0 2px; font: 800 22px var(--display); letter-spacing: -0.03em; color: var(--cd); }
.win__main .sub { margin: 0 0 12px; color: #666; font-size: 11px; }
.win__main p { margin: 0 0 12px; font-size: 12px; line-height: 1.55; color: #222; max-width: 60ch; }
.win__main ul.facts { margin: 0 0 12px; padding-left: 18px; font-size: 12px; line-height: 1.6; }
.files { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 6px; margin: 4px 0 12px; padding: 0; list-style: none; }
.file {
  display: grid;
  justify-items: center;
  gap: 4px;
  padding: 6px 2px;
  border: 1px solid transparent;
  border-radius: 3px;
  background: none;
  font-size: 11px;
  text-align: center;
}
.file:hover { background: color-mix(in srgb, var(--c) 12%, #fff); border-color: color-mix(in srgb, var(--c) 40%, #fff); }
.file.is-selected { background: color-mix(in srgb, var(--c) 25%, #fff); }
.file svg { width: 40px; height: 40px; }
.file small { color: #777; }
.win__status { display: flex; gap: 14px; padding: 3px 8px; border-top: 1px solid #d0cbbd; background: #ece9e1; font-size: 11px; color: #444; }
.win__status span + span { padding-left: 14px; border-left: 1px solid #c6c1b2; }

/* properties dialog */
.win--dialog { width: min(400px, calc(100vw - 24px)); height: auto; grid-template-rows: auto 1fr; }
.dialog { padding: 14px; display: grid; gap: 12px; font-size: 12px; }
.dialog__tabs { display: flex; gap: 2px; border-bottom: 1px solid #919b9c; }
.dialog__tabs span { padding: 4px 10px; border: 1px solid #919b9c; border-bottom: 0; border-radius: 4px 4px 0 0; background: #f4f3ee; }
.dialog__tabs span:first-child { background: #fcfcfe; border-top: 2px solid #f4b23c; margin-bottom: -1px; }
.dialog__body { display: grid; grid-template-columns: 110px 1fr; gap: 14px; padding: 12px; background: #fcfcfe; border: 1px solid #919b9c; border-top: 0; }
.dialog__body .orbmini { width: 100px; height: 100px; border-radius: 50%; background: radial-gradient(60% 40% at 50% 15%, #fffd, #fff0 70%), radial-gradient(circle, var(--base), var(--deep) 80%); box-shadow: 0 0 20px var(--glow), inset 0 -8px 14px #0007; display: grid; place-items: center; font: italic 900 26px var(--display); color: #fff; }
.dialog__body dl { margin: 0; display: grid; gap: 2px; line-height: 1.5; }
.dialog__body dt { color: #555; margin-top: 6px; }
.dialog__body dd { margin: 0 0 0 10px; }
.dialog__ok { justify-self: end; padding: 4px 20px; border: 1px solid #003c74; border-radius: 3px; background: linear-gradient(#fff, #e3e3db); box-shadow: inset 0 0 0 1px #fff, 0 0 0 1px #f4b23c inset; }

/* shut down */
.bye {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: grid;
  place-items: center;
  background: #000;
  color: #ff9a3c;
  font: clamp(22px, 4vw, 46px) var(--lcdfont);
  text-align: center;
  cursor: pointer;
  animation: fadeIn 0.8s ease;
}
.bye small { display: block; margin-top: 18px; font-size: 0.5em; color: #888; }

@media (max-width: 700px) {
  .win { left: 6px !important; right: 6px; top: 6px !important; width: auto; height: calc(100svh - var(--taskbar) - 12px); }
  .win--dialog { height: auto; }
  .win__body { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
  .win__side { display: flex; gap: 8px; overflow-x: auto; padding: 8px; }
  .win__side .pane { flex: none; width: 200px; margin: 0; }
  .win__menu { display: none; }
  .dialog__body { grid-template-columns: 1fr; justify-items: center; }
}
