:root {
  --accent: #194563;
  --surface: #eef6fa;
  --radius: 16px;
  --gap: 1.5rem;
  --shadow: 0 2px 8px rgba(0,0,0,.08);
  --text-primary: #333;
  --text-secondary: #666;
  --bg-body: #fff;
  --bg-code: #f6f8fa;
  --border-color: #ddd;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.5;
  color: var(--text-primary);
  background: var(--bg-body);
  max-width: 1200px;
  margin: 0 auto;
  padding: 1rem;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

h1, h2, h3 {
  line-height: 1.2;
}

h1 {
  font-size: 2.5rem;
}

h2 {
  font-size: 1.8rem;
  margin-bottom: 0.5rem;
}

h3 {
  font-size: 1.2rem;
  margin-bottom: 0.25rem;
}

p {
  margin-bottom: 1rem;
}

p.intro {
  font-size: 1.1rem;
  font-weight: 300;
}

p.mini {
  font-size: 0.9rem;
  color: var(--text-secondary);
}

ul, ol {
  margin-bottom: 1rem;
  padding-left: 1.5rem;
}

li {
  margin-bottom: 0.5rem;
}

header {
  text-align: center;
  margin-bottom: 2rem;
}

nav ul {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1rem;
}

nav.mini ul {
  justify-content: flex-start;
}

.badge {
  font-size: 0.75rem;
  background: var(--accent);
  color: white;
  padding: 0.25rem 0.5rem;
  border-radius: var(--radius);
  margin-left: 0.5rem;
}

.row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--gap);
}

.card {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1rem;
  flex: 1 1 300px;
}

.card h3 {
  margin-top: 0;
}

.controls {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

button {
  background: var(--accent);
  color: white;
  border: none;
  padding: 0.5rem 1rem;
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 0.9rem;
}

button:hover {
  opacity: 0.9;
}

pre {
  background: var(--bg-code);
  padding: 1rem;
  border-radius: var(--radius);
  overflow: auto;
  position: relative;
}

pre code {
  font-family: monospace;
  font-size: 0.9rem;
}

pre button.copy {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  background: rgba(255,255,255,0.8);
  color: var(--accent);
  padding: 0.25rem 0.5rem;
  font-size: 0.8rem;
}

textarea {
  width: 100%;
  min-height: 200px;
  padding: 1rem;
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  font-family: monospace;
  font-size: 1rem;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.toolbar button {
  font-size: 1.2rem;
  padding: 0.25rem 0.5rem;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  border: 0;
}

footer {
  text-align: center;
  margin-top: 2rem;
  font-size: 0.9rem;
  color: var(--text-secondary);
}

@media (max-width: 768px) {
  .row {
    flex-direction: column;
  }
}
