/* ─── Reset & Base ─── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 15px;
  line-height: 1.6;
  color: #1a1a1a;
  background: #fafafa;
  padding: 1.5rem;
}

/* ─── Layout ─── */
header, main, nav {
  max-width: 680px;
  margin-left: auto;
  margin-right: auto;
}

/* ─── Typography ─── */
h1 {
  font-size: 1.6rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin-bottom: 0.25em;
}

h2 {
  font-size: 1.15rem;
  font-weight: 600;
  margin-bottom: 0.5em;
}

p {
  color: #555;
  font-size: 0.9rem;
  margin-bottom: 1em;
}

a {
  color: gray;
}

/* ─── Nav ─── */
nav {
  display: flex;
  gap: 0.25em;
  margin-bottom: 2.5rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid #e0e0e0;
}

nav a {
  color: #555;
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 500;
  padding: 0.4em 0.7em;
  border-radius: 4px;
  transition: background 0.15s, color 0.15s;
}

nav a:hover {
  background: #eaeaea;
  color: #1a1a1a;
}

nav a.active {
  background: #1a1a1a;
  color: #fff;
}

/* ─── Forms ─── */
form {
  display: flex;
  flex-direction: column;
  gap: 0.75em;
}

label {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #555;
}

input {
  font: inherit;
  font-size: 0.9rem;
  padding: 0.55em 0.7em;
  border: 1px solid #d4d4d4;
  border-radius: 4px;
  background: #fff;
  transition: border-color 0.15s;
}

input:focus {
  outline: none;
  border-color: #1a1a1a;
}

/* ─── Buttons ─── */
button {
  font: inherit;
  font-size: 0.85rem;
  font-weight: 500;
  padding: 0.5em 1.1em;
  border: 1px solid #1a1a1a;
  border-radius: 4px;
  background: #1a1a1a;
  color: #fff;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
  align-self: flex-start;
}

button:hover {
  background: #333;
  border-color: #333;
}

button.danger {
  background: #c0392b;
  border-color: #c0392b;
}

button.danger:hover {
  background: #a93226;
  border-color: #a93226;
}

/* ─── Sections ─── */
section {
  margin-bottom: 2.5rem;
}

hr {
  border: none;
  border-top: 1px solid #e0e0e0;
  margin: 2rem 0;
}

/* ─── Result Boxes ─── */
.result-box {
  font-family: "SF Mono", "Fira Code", "Fira Mono", Menlo, Consolas, monospace;
  font-size: 0.8rem;
  line-height: 1.5;
  background: #f0f0f0;
  border: 1px solid #d4d4d4;
  border-radius: 4px;
  padding: 0.75em 1em;
  margin-top: 0.5em;
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 400px;
  overflow-y: auto;
}

.result-box.ok {
  border-color: #27ae60;
  background: #eefaf3;
}

.result-box.err {
  border-color: #c0392b;
  background: #fdecea;
}
