* {
  box-sizing: border-box;
}

:root {
  color-scheme: dark;
  --bg: #020815;
  --blue: #1737f2;
  --blue-2: #071b9c;
  --panel: #06114a;
  --panel-2: #051037;
  --line: rgba(128, 224, 255, .55);
  --text: #f4fbff;
  --muted: #b8e9ff;
  --soft: #70e8ff;
  --accent: #22ff77;
  --warn: #fff064;
  --ink: #020815;
  --mono: "Courier New", Courier, monospace;
}

body {
  margin: 0;
  background:
    linear-gradient(rgba(255, 255, 255, .025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, .02) 1px, transparent 1px),
    var(--bg);
  background-size: 8px 8px;
  color: var(--text);
  font-family: var(--mono);
}

a {
  color: #80bfff;
}

.page {
  max-width: 1240px;
  margin: 0 auto;
  padding: 28px 18px 52px;
}

.topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
  color: var(--soft);
  font-size: 15px;
  text-transform: uppercase;
}

.topline a {
  color: var(--soft);
  text-decoration: none;
}

.dos-hero {
  margin-bottom: 22px;
}

.dos-frame {
  border: 2px solid var(--line);
  background: #000713;
  box-shadow: 0 0 0 4px rgba(23, 55, 242, .38);
}

.dos-titlebar {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 8px 12px;
  background: var(--soft);
  color: var(--ink);
  font-weight: 700;
}

.dos-screen {
  min-height: 360px;
  padding: 28px;
  background:
    linear-gradient(rgba(255,255,255,.035) 50%, rgba(0,0,0,.035) 50%),
    var(--blue);
  background-size: 100% 4px;
  border: 12px solid #05070b;
}

.dos-line {
  margin: 0 0 6px;
  color: var(--text);
  font-size: 20px;
  line-height: 1.25;
}

.dos-line.muted {
  margin-top: 24px;
  color: var(--warn);
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--accent);
  text-transform: uppercase;
  font-size: 14px;
}

h1 {
  max-width: 920px;
  margin: 28px 0 0;
  color: var(--text);
  font-size: clamp(34px, 6vw, 72px);
  line-height: 1;
  text-transform: uppercase;
}

.lead {
  max-width: 760px;
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.55;
}

.dos-prompt,
.actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-top: 26px;
}

.dos-prompt span {
  color: var(--warn);
  font-size: 20px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 9px 14px;
  border: 2px solid var(--line);
  border-radius: 0;
  background: var(--blue-2);
  color: var(--text);
  font-family: var(--mono);
  font-weight: 700;
  text-decoration: none;
  text-transform: uppercase;
}

.button.primary {
  background: var(--accent);
  color: var(--ink);
  border-color: #d8ffe6;
}

.section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  margin-top: 36px;
  margin-bottom: 10px;
}

.section-head h2 {
  margin: 0;
  font-size: 24px;
  text-transform: uppercase;
}

.section-head h2 span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  height: 26px;
  margin-left: 8px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 0;
  color: var(--accent);
  font-size: 14px;
  vertical-align: middle;
}

.section-head p {
  margin: 0;
  color: var(--muted);
  text-transform: uppercase;
}

.pill {
  display: inline-flex;
  width: max-content;
  min-width: 82px;
  padding: 3px 7px;
  border: 1px solid rgba(255,255,255,.28);
  border-radius: 0;
  background: rgba(0, 0, 0, .18);
  color: var(--accent);
  font-size: 13px;
  text-transform: uppercase;
}

.pill.warn {
  color: var(--warn);
}

.archive-panel {
  margin-top: 32px;
  padding: 18px;
  background: var(--panel-2);
  border: 2px solid var(--line);
}

.archive-panel h2 {
  margin: 0 0 10px;
  text-transform: uppercase;
}

.archive-panel p {
  max-width: 820px;
  margin: 0 0 18px;
  color: var(--muted);
  line-height: 1.6;
}

.program-table,
.archive-list {
  display: grid;
  gap: 0;
}

.program-table {
  overflow-x: auto;
  padding-bottom: 2px;
}

.program-row {
  display: grid;
  grid-template-columns: minmax(150px, 1.1fr) minmax(150px, 1.2fr) minmax(90px, .6fr) minmax(110px, .7fr) minmax(170px, 1fr) 74px;
  align-items: center;
  gap: 12px;
  min-height: 46px;
  padding: 8px 10px;
  background: var(--blue);
  border-right: 2px solid var(--line);
  border-bottom: 1px solid rgba(255, 255, 255, .22);
  border-left: 2px solid var(--line);
  color: var(--text);
  font-size: 15px;
}

.program-row:first-child {
  border-top: 2px solid var(--line);
}

.program-row:last-child {
  border-bottom: 2px solid var(--line);
}

.program-row.table-head {
  min-height: 40px;
  background: var(--soft);
  color: var(--ink);
  font-weight: 700;
  text-transform: uppercase;
}

.program-row span,
.program-row code {
  min-width: 0;
  overflow-wrap: anywhere;
}

.program-row code {
  color: var(--warn);
  font-family: var(--mono);
  font-size: 15px;
}

.file-name {
  color: #fff;
  font-weight: 700;
  text-decoration: none;
  text-transform: uppercase;
}

.file-name:hover,
.file-name:focus {
  color: var(--warn);
}

.run-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  border: 2px solid #d8ffe6;
  background: var(--accent);
  color: var(--ink);
  font-weight: 700;
  text-decoration: none;
}

.archive-link {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 18px;
  min-height: 96px;
  padding: 16px;
  background: var(--blue);
  border: 2px solid var(--line);
}

.manager-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.manager-card {
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  gap: 16px;
  min-height: 230px;
  padding: 16px;
  background: var(--panel);
  border: 2px solid var(--line);
}

.manager-card h3 {
  margin: 0 0 10px;
  color: var(--text);
  font-size: 21px;
  text-transform: uppercase;
}

.manager-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.manager-commands,
.dos-help {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.manager-commands code,
.dos-help code {
  padding: 5px 8px;
  border: 1px solid rgba(255,255,255,.26);
  background: rgba(0,0,0,.2);
  color: var(--warn);
  font-family: var(--mono);
}

.dos-help {
  margin-top: 12px;
}

.program-main h3,
.archive-link h3 {
  margin: 0 0 5px;
  font-size: 19px;
}

.program-main p,
.archive-link p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.program-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.emu-page {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 22px;
  max-width: 1260px;
  margin: 0 auto;
  padding: 22px;
}

.emu-shell {
  min-width: 0;
}

.screen-wrap {
  min-height: 580px;
  padding: 14px;
  background: #05070b;
  border: 1px solid var(--line);
  border-radius: 8px;
}

#wmsx-screen {
  margin: 0 auto;
}

.side {
  padding: 20px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.side h1 {
  font-size: 26px;
}

.side p {
  color: var(--muted);
  line-height: 1.55;
}

.msx-input {
  margin-top: 22px;
}

.msx-input label {
  display: block;
  margin-bottom: 8px;
  color: var(--soft);
  font-size: 13px;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.msx-input div {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.msx-input input {
  width: 100%;
  min-height: 42px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, .06);
  color: var(--text);
  font: inherit;
}

.msx-input input:focus {
  outline: 2px solid rgba(110, 231, 183, .45);
  outline-offset: 2px;
}

footer {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  margin-top: 44px;
  color: #94a3b8;
  font-size: 14px;
}

@media (max-width: 960px) {
  .emu-page {
    grid-template-columns: 1fr;
  }

  .archive-link {
    grid-template-columns: 1fr;
  }

  .program-row {
    grid-template-columns: 150px 150px 90px 110px 170px 74px;
    width: max-content;
    min-width: 100%;
  }

  .manager-grid {
    grid-template-columns: 1fr;
  }

  .program-actions {
    justify-content: flex-start;
  }

  .screen-wrap {
    min-height: 360px;
  }
}

@media (max-width: 640px) {
  .page {
    padding: 32px 16px 44px;
  }

  .topline,
  .section-head,
  footer {
    align-items: start;
    flex-direction: column;
  }
}
