.ims-retro {
  box-sizing: border-box;
  width: min(640px, calc(100% - 28px));
  max-height: min(650px, calc(100dvh - 30px));
  padding: 0;
  overflow: auto;
  border: 2px solid #d9c7a1;
  border-radius: 20px;
  background: #cbb899;
  color: #262216;
  box-shadow: 0 20px 80px #000a, inset 0 2px 1px #fff8;
}

.ims-retro::backdrop { background: #080e14c7; backdrop-filter: blur(4px); }

.ims-retro-bezel {
  padding: clamp(11px, 3vw, 24px);
  background: linear-gradient(135deg, #f2e6c9, #baa583);
  font: 500 clamp(14px, 2.4vw, 16px)/1.5 Consolas, "Courier New", monospace;
}

.ims-retro-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 12px;
}

.ims-retro-header h2 { margin: 0; color: #262216; font-size: clamp(18px, 4vw, 24px); }
.ims-retro-header form { margin: 0; }

.ims-retro-screen {
  display: grid;
  gap: 15px;
  padding: clamp(12px, 4vw, 27px);
  border: 6px inset #927e62;
  border-radius: 18px;
  background: repeating-linear-gradient(0deg, #a0ffbc08 0 1px, transparent 1px 5px),
    radial-gradient(ellipse, #142d20, #0b140f 80%);
  color: #c3f3b6;
  box-shadow: inset 0 0 25px #000b;
}

.ims-retro-path, .ims-retro-readout p { margin: 0; }
.ims-retro-readout {
  min-height: 6em;
  padding: 12px 0 0;
  border-top: 1px solid #76bc7266;
}
.ims-retro-readout strong { color: #f2ffbe; }
.ims-retro-files { display: flex; flex-wrap: wrap; gap: 6px; }
.ims-retro button, .ims-retro input {
  min-height: 44px;
  padding: 7px 9px;
  border: 1px solid #80bb78;
  border-radius: 6px;
  background: #152b1e;
  color: #c3f3b6;
  font: inherit;
}

.ims-retro button { cursor: pointer; }
.ims-retro button:is(:hover, [aria-pressed="true"]) { background: #b9f1a8; color: #112819; }
.ims-retro .ims-retro-close { border-color: #715f46; background: #332d24; color: #fff4d6; }
.ims-retro :is(button, input):focus-visible { outline: 3px solid #f7e495; outline-offset: 2px; }
.ims-retro-close:focus-visible { outline-color: #284c37 !important; }

.ims-retro-prompt { display: grid; grid-template-columns: max-content minmax(0, 1fr) auto; align-items: center; gap: 7px; }
.ims-retro-prompt input { min-width: 0; }
.ims-retro-prompt input::placeholder { color: #aacba5; }

@media (max-width: 475px) {
  .ims-retro-prompt { grid-template-columns: minmax(0, 1fr) auto; }
  .ims-retro-prompt label { grid-column: 1 / -1; }
}
