* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  margin: 0;
  padding: 1rem;
  background: #fafafa;
  color: #222;
  font-size: 13px;
  display: flex;
  flex-direction: column;
}
h1 { font-size: 1rem; margin: 0 0 0.75rem 0; }
header { margin-bottom: 1rem; }
.controls {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
}
.controls label {
  display: flex;
  flex-direction: column;
  font-size: 11px;
  color: #666;
}
.controls input[type="number"], .controls select {
  font: inherit;
  padding: 2px 4px;
  border: 1px solid #ccc;
  background: white;
}
button {
  font: inherit;
  padding: 4px 8px;
  border: 1px solid #999;
  background: white;
  cursor: pointer;
}
button:hover { background: #eee; }
#cards {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(420px, 1fr));
  grid-auto-rows: 1fr;
  gap: 1rem;
}
.card {
  border: 1px solid #ccc;
  background: white;
  padding: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  min-height: 0;
}
.card-header {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  border-bottom: 1px solid #eee;
  padding-bottom: 0.4rem;
}
.card-name {
  font: inherit;
  font-weight: bold;
  border: none;
  background: transparent;
  padding: 1px 3px;
  width: 100%;
  cursor: text;
  border-bottom: 1px dashed transparent;
}
.card-name:hover { border-bottom-color: #ccc; }
.card-name:focus { outline: none; border-bottom-color: #666; }
.perf-inputs {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}
fieldset {
  border: 1px solid #ddd;
  padding: 4px 6px;
  margin: 0;
  flex: 1;
  min-width: 180px;
}
legend { font-size: 10px; color: #888; padding: 0 4px; }
fieldset label {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  font-size: 10px;
  color: #666;
  margin-right: 4px;
}
fieldset input {
  font: inherit;
  width: 50px;
  padding: 1px 2px;
  border: 1px solid #ddd;
}
.remove-card {
  align-self: flex-end;
  font-size: 10px;
  padding: 1px 6px;
}
.output {
  flex: 1;
  min-height: 0;
  white-space: pre-wrap;
  word-break: break-word;
  overflow-y: auto;
  line-height: 1.5;
  font-size: 12px;
  background: #fff;
}
.output .input { color: #222; }
.output .gen { color: #999; }
