:root {
  --bg: #f7f8fa;
  --card: #ffffff;
  --text: #111827;
  --muted: #4b5563;
  --border: #d1d5db;
  --accent: #1d4ed8;
  --accent-strong: #1e40af;
  --danger: #b91c1c;
  --ok: #166534;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  color: var(--text);
  background: linear-gradient(180deg, #f7f8fa 0%, #eef2f7 100%);
  min-height: 100vh;
}

.page {
  width: min(760px, 100% - 2rem);
  margin: 2rem auto;
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1.1rem;
  box-shadow: 0 10px 30px rgba(17, 24, 39, 0.06);
}

h1 {
  font-size: 1.4rem;
  margin: 0 0 0.7rem 0;
}

h2 {
  font-size: 1.1rem;
  margin: 0.8rem 0 0.45rem 0;
}

p {
  margin: 0.45rem 0;
  line-height: 1.5;
}

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

.warn {
  border-left: 4px solid #f59e0b;
  background: #fffbeb;
  padding: 0.65rem 0.8rem;
  border-radius: 8px;
}

label {
  display: block;
  font-weight: 600;
  margin: 0.6rem 0 0.3rem 0;
}

input,
textarea,
button {
  font: inherit;
}

input[type="password"],
textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.65rem 0.7rem;
  background: #fff;
}

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

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin-top: 0.75rem;
}

button {
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text);
  padding: 0.58rem 0.9rem;
  border-radius: 8px;
  cursor: pointer;
}

button.primary {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

button.primary:hover {
  background: var(--accent-strong);
}

button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.status {
  margin-top: 0.7rem;
  min-height: 1.2rem;
  font-size: 0.95rem;
}

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

.status.ok {
  color: var(--ok);
}

.hidden {
  display: none;
}

pre.output {
  background: #f9fafb;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.8rem;
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 50vh;
}

.center {
  text-align: center;
  margin-top: 10vh;
}

.mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}

.mt-1 {
  margin-top: 0.9rem;
}

@media (max-width: 640px) {
  .page {
    width: calc(100% - 1rem);
    margin: 1rem auto;
  }

  .card {
    padding: 0.9rem;
    border-radius: 12px;
  }

  h1 {
    font-size: 1.22rem;
  }
}
