:root {
  --font-mono: "Consolas", "Lucida Console", "Courier New", monospace;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: system-ui, sans-serif;
}

body.theme-black {
  background: #0a0a0a;
  color: #33ff66;
}

body.theme-color {
  background: #d8d8d8;
  color: #111;
}

.layout {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1rem 1.25rem 2rem;
}

.topbar {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 1rem;
  align-items: flex-start;
  margin-bottom: 1rem;
}

h1 {
  font-size: 1.15rem;
  margin: 0 0 0.25rem;
}

.sub {
  margin: 0;
  opacity: 0.85;
  font-size: 0.85rem;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

button,
.btn {
  font: inherit;
  cursor: pointer;
  border: 1px solid currentColor;
  background: transparent;
  color: inherit;
  padding: 0.35rem 0.65rem;
  border-radius: 4px;
  text-decoration: none;
  font-size: 0.85rem;
}

button.active {
  font-weight: 700;
}

.card {
  border: 1px solid currentColor;
  border-radius: 6px;
  padding: 0.75rem;
  margin-bottom: 1rem;
}

.params {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr));
  gap: 0.75rem;
}

.params label {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.params input {
  font: inherit;
  padding: 0.35rem 0.5rem;
  border: 1px solid currentColor;
  background: transparent;
  color: inherit;
  border-radius: 4px;
}

.main {
  display: grid;
  grid-template-columns: 1fr min(22rem, 100%);
  gap: 1rem;
}

@media (max-width: 900px) {
  .main {
    grid-template-columns: 1fr;
  }
}

.terminal {
  margin: 0;
  min-height: 28rem;
  max-height: 70vh;
  overflow: auto;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  line-height: 1.35;
  white-space: pre-wrap;
  word-break: break-word;
}

body.theme-black .terminal {
  background: #000;
  color: #33ff66;
  padding: 1rem;
}

body.theme-color .terminal {
  background: #ececec;
  color: #111;
  padding: 1rem;
}

.side h2 {
  font-size: 0.85rem;
  margin: 0 0 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.cmd-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.35rem;
  margin-bottom: 0.75rem;
}

.alchemy-row {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  font-size: 0.75rem;
  margin-bottom: 0.75rem;
}

.alchemy-row input {
  font: inherit;
  padding: 0.35rem;
  border: 1px solid currentColor;
  background: transparent;
  color: inherit;
  border-radius: 4px;
}

.json-out {
  margin: 0;
  max-height: 16rem;
  overflow: auto;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  white-space: pre-wrap;
  word-break: break-word;
  opacity: 0.9;
}

footer {
  font-size: 0.75rem;
  opacity: 0.8;
}

footer code {
  font-family: var(--font-mono);
}
