:root {
  color-scheme: dark;
  --bg: #101414;
  --panel: #151b1b;
  --panel-strong: #1d2624;
  --text: #e7f1eb;
  --muted: #91a49b;
  --line: #33403c;
  --accent: #61d394;
  --accent-strong: #33b878;
  --danger: #ff7a7a;
  --warning: #ffd166;
  --shadow: rgba(0, 0, 0, 0.32);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(135deg, rgba(97, 211, 148, 0.08), transparent 36%),
    var(--bg);
  color: var(--text);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
}

button,
input,
select {
  font: inherit;
}

.terminal-shell {
  width: min(1060px, calc(100% - 32px));
  min-height: calc(100vh - 48px);
  margin: 24px auto;
  border: 1px solid var(--line);
  background: var(--panel);
  box-shadow: 0 20px 80px var(--shadow);
}

.terminal-titlebar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--line);
  background: var(--panel-strong);
}

h1 {
  margin: 0 0 6px;
  font-size: clamp(20px, 4vw, 30px);
  line-height: 1.2;
  font-weight: 700;
}

.terminal-titlebar p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.status-dot {
  width: 14px;
  height: 14px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 6px rgba(97, 211, 148, 0.12);
}

.menu-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
}

.menu-grid button,
.send-form button {
  min-height: 44px;
  border: 1px solid #486158;
  background: #17221f;
  color: var(--text);
  cursor: pointer;
}

.menu-grid button:hover,
.send-form button:hover,
.menu-grid button:focus-visible,
.send-form button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-color: var(--accent);
  color: #f8fff9;
}

.terminal-output {
  min-height: 520px;
  padding: 22px 20px 28px;
  overflow-x: auto;
  white-space: normal;
}

.terminal-output p,
.terminal-output pre {
  margin: 0 0 14px;
}

.terminal-output pre {
  overflow-x: auto;
  color: var(--warning);
  line-height: 1.65;
}

.send-form {
  display: grid;
  gap: 16px;
  max-width: 820px;
}

.send-form label {
  display: grid;
  gap: 8px;
}

.send-form label span {
  color: var(--muted);
  font-size: 14px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

input,
select {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  background: #0f1514;
  color: var(--text);
  padding: 9px 11px;
}

input:focus,
select:focus {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.send-form button {
  width: min(220px, 100%);
  background: var(--accent-strong);
  border-color: var(--accent);
  color: #06110b;
  font-weight: 700;
}

.result-block {
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.output-line {
  display: grid;
  grid-template-columns: 140px minmax(0, 1fr);
  gap: 14px;
  align-items: start;
  margin-bottom: 12px;
}

.output-line span {
  color: var(--muted);
}

code {
  display: block;
  overflow-wrap: anywhere;
  color: var(--warning);
}

.success {
  color: var(--accent);
}

.error {
  color: var(--danger);
}

.muted {
  color: var(--muted);
}

.history-item {
  padding: 14px 0;
  border-top: 1px solid var(--line);
}

.history-item p {
  overflow-wrap: anywhere;
}

@media (max-width: 760px) {
  .terminal-shell {
    width: 100%;
    min-height: 100vh;
    margin: 0;
    border-left: 0;
    border-right: 0;
  }

  .menu-grid,
  .form-grid,
  .output-line {
    grid-template-columns: 1fr;
  }

  .menu-grid {
    padding: 14px;
  }

  .terminal-titlebar,
  .terminal-output {
    padding-left: 14px;
    padding-right: 14px;
  }
}
