.term-field { display: flex; flex-direction: column; gap: 2px; margin-top: 0.4rem; }
.term-field label { color: var(--subtext0); font-size: 13px; }
.term-field textarea {
  background: var(--crust);
  border: 1px solid var(--surface1);
  border-radius: 4px;
  color: var(--text);
  font-family: 'Monocraft', monospace;
  font-size: 14px;
  padding: 6px 10px;
  outline: none;
  width: 32ch;
  transition: border-color 0.15s;
  caret-color: var(--mauve);
  resize: none;
  min-height: 90px;
  line-height: 1.6;
  white-space: pre;
  overflow-wrap: normal;
  overflow-x: hidden;
}
.term-field textarea:focus { border-color: var(--mauve); }
.term-field textarea::placeholder { color: var(--overlay0); }
.term-field input[type="text"] {
  background: var(--crust);
  border: 1px solid var(--surface1);
  border-radius: 4px;
  color: var(--text);
  font-family: 'Monocraft', monospace;
  font-size: 14px;
  padding: 6px 10px;
  outline: none;
  width: 16ch;
  transition: border-color 0.15s;
  caret-color: var(--mauve);
}
.term-field input[type="text"]:focus { border-color: var(--mauve); }
.term-field input[type="text"]::placeholder { color: var(--overlay0); }
.char-count { font-size: 11px; color: var(--overlay1); text-align: right; }
.char-count.warn { color: var(--yellow); }
.submit-wrap { margin-top: 1rem; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.term-btn {
  background: transparent;
  border: 1px solid var(--mauve);
  color: var(--mauve);
  font-family: 'Monocraft', monospace;
  font-size: 14px;
  padding: 4px 16px;
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.term-btn:hover:not(:disabled) { background: var(--mauve); color: var(--base); }
.term-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.term-btn.green { border-color: var(--green); color: var(--green); }
.term-btn.green:hover:not(:disabled) { background: var(--green); color: var(--base); }
.status-line { margin-top: 0.6rem; font-size: 13px; min-height: 18px; }
.status-line.success { color: var(--green); }
.status-line.error { color: var(--red); }
.status-line.info { color: var(--blue); }
.progress-wrap { display: none; margin-top: 8px; }
.progress-wrap.active { display: block; }
.progress-track { background: var(--surface0); height: 2px; border-radius: 2px; overflow: hidden; margin-top: 4px; }
.progress-fill { height: 100%; background: var(--mauve); width: 0; animation: fill 1.6s ease forwards; }
@keyframes fill { to { width: 100%; } }
.code-display { font-size: 28px; font-weight: bold; color: var(--mauve); letter-spacing: 0.15em; margin: 0.5rem 0; }
.hidden { display: none; }
.terminal-header {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 4px;
}
.close-btn {
  background: transparent;
  border: none;
  color: var(--overlay1);
  font-family: 'Monocraft', monospace;
  font-size: 14px;
  cursor: pointer;
  padding: 0 2px;
  line-height: 1;
  transition: color 0.15s;
}
.close-btn:hover { color: var(--red); }
.terminal-closed {
  background: var(--mantle);
  border-radius: 8px;
  padding: 12px 14px;
  box-shadow: 0 0 0 1px var(--surface0);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.terminal-closed p {
  margin: 0;
  color: var(--overlay1);
  font-size: 13px;
}
.restore-btn {
  background: transparent;
  border: 1px solid var(--overlay1);
  color: var(--overlay1);
  font-family: 'Monocraft', monospace;
  font-size: 12px;
  padding: 3px 12px;
  border-radius: 4px;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
  white-space: nowrap;
}
.restore-btn:hover { border-color: var(--text); color: var(--text); }
