/* ---------- Base ---------- */
body {
  font-family: sans-serif;
  margin: 2rem;
  background: #fafafa;
}

textarea {
  width: 100%;
  height: 120px;
  font-family: monospace;
  margin-bottom: 1rem;
  font-size: 0.95rem;
  padding: 0.3rem;
}

input[type="text"] {
  padding: 0.3rem;
  font-family: monospace;
  font-size: 0.95rem;
}

button {
  padding: 0.5rem 1rem;
  font-size: 1rem;
  cursor: pointer;
}

/* ---------- Result Table ---------- */
#result {
  margin-top: 1.5rem;
  white-space: pre-wrap;
}

table {
  border-collapse: collapse;
  margin-top: 1rem;
  width: 100%;
}

th, td {
  border: 1px solid #ccc;
  padding: 0.4rem 0.6rem;
  text-align: left;
}

th {
  background: #eee;
}

.error {
  color: red;
  font-weight: bold;
}

/* ---------- Preset Inputs ---------- */
#addPreset input[type="text"] {
  margin-right: 0.5rem;
}

#newLabel {
  width: 150px;
  height: 25px;
}

#newQuery {
  width: 400px;
  height: 25px;
}

#addButton {
  padding: 0.4rem 0.8rem;
  font-size: 0.95rem;
}

/* ---------- Alerts Section ---------- */
#alerts {
  background: #fff8e1;
  padding: 1rem;
  border: 1px solid #ffe082;
  border-radius: 8px;
  margin-top: 2rem;
}

#alerts h2 {
  margin-top: 0;
  color: #ff6f00;
}

#alerts input[type="text"],
#alerts textarea {
  margin-bottom: 0.5rem;
  font-size: 0.95rem;
  padding: 0.3rem;
  width: 100%;
  box-sizing: border-box;
  border: 1px solid #ccc;
  border-radius: 4px;
}

#sendAlert {
  background-color: #ffca28;
  border: none;
  border-radius: 4px;
  padding: 0.5rem 1rem;
  font-size: 1rem;
  font-weight: bold;
  color: #333;
  cursor: pointer;
  transition: background 0.2s ease;
}

#sendAlert:hover {
  background-color: #ffc107;
}

#alertResult {
  margin-top: 0.8rem;
  font-weight: bold;
}

/* ---------- Preset Buttons Wrapping ---------- */
#presetQueries {
  display: flex;
  flex-wrap: wrap;      /* wrap buttons to next line if needed */
  gap: 0.5rem;          /* space between buttons */
  margin-bottom: 1rem;
}

#presetQueries button {
  flex: 0 0 auto;       /* prevent stretching */
  margin-bottom: 0.5rem;
}

/* ---------- Alerts Button ---------- */
#alerts #sendAlert {
  display: inline-block;
  margin-top: 0.5rem;
}
