:root {
  --bg: #f3f7fb;
  --card: #ffffff;
  --ink: #11223a;
  --muted: #5b6f8a;
  --line: #d7e1ee;
  --brand: #0f62fe;
  --brand-2: #2f80ed;
  --danger: #b91c1c;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Segoe UI", "Helvetica Neue", Helvetica, Arial, sans-serif;
  color: var(--ink);
  background: radial-gradient(circle at top right, #eaf2ff 0%, var(--bg) 50%, #edf3ff 100%);
}

.app-shell {
  max-width: 1120px;
  margin: 2rem auto;
  padding: 0 1rem 2rem;
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 1rem;
  box-shadow: 0 12px 30px rgba(21, 43, 92, 0.08);
}

.narrow {
  max-width: 460px;
  margin: 4rem auto;
}

.hidden {
  display: none;
}

h1,
h2 {
  margin: 0 0 0.5rem;
}

p,
label {
  display: block;
  margin: 0.4rem 0;
}

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

input,
textarea,
button {
  width: 100%;
  border-radius: 10px;
  border: 1px solid var(--line);
  padding: 0.6rem 0.75rem;
  font: inherit;
}

textarea {
  min-height: 160px;
  resize: vertical;
}

button {
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  color: #fff;
  border: none;
  cursor: pointer;
  font-weight: 600;
}

button.secondary {
  background: #dfe8f7;
  color: #10243d;
}

button:hover {
  filter: brightness(1.03);
}

.toolbar {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.toolbar-actions {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.toolbar-actions button {
  width: auto;
  min-width: 120px;
}

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

.inline-actions {
  margin-top: 0.6rem;
}

.result {
  margin: 0.8rem 0 0;
  padding: 0.8rem;
  border-radius: 10px;
  background: #f7fafd;
  border: 1px solid var(--line);
  white-space: pre-wrap;
  word-break: break-word;
  min-height: 2.4rem;
}

.server-list {
  display: grid;
  gap: 0.8rem;
}

.server-item {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.9rem;
  background: #fcfdff;
}

.server-item header {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 0.5rem;
}

.server-meta {
  margin-bottom: 0.6rem;
  color: var(--muted);
  font-size: 0.95rem;
}

.actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 0.45rem;
}

.chip {
  border: 1px solid var(--line);
  background: #eef4ff;
  color: #1a3762;
  padding: 0.18rem 0.5rem;
  border-radius: 999px;
  font-size: 0.82rem;
}

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

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

  .toolbar {
    flex-direction: column;
  }
}
