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

:root {
  --bg: #0f0f0f;
  --surface: #1a1a1a;
  --surface-hover: #252525;
  --border: #333;
  --text: #e5e5e5;
  --text-muted: #888;
  --primary: #3b82f6;
  --primary-hover: #2563eb;
  --error: #ef4444;
  --success: #22c55e;
  --font-mono: 'SF Mono', 'Fira Code', 'Consolas', monospace;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
}

.container {
  max-width: 1000px;
  margin: 0 auto;
  padding: 2rem;
}

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

h1 {
  font-size: 3rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 0.25rem;
}

.subtitle {
  font-size: 1.25rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.description {
  max-width: 600px;
  margin: 0 auto;
  color: var(--text-muted);
}

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

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

.input-pane,
.results-pane {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1rem;
}

label {
  display: block;
  font-weight: 500;
  margin-bottom: 0.5rem;
}

textarea {
  width: 100%;
  height: 340px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0.75rem;
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 0.95rem;
  resize: vertical;
}

textarea:focus {
  outline: none;
  border-color: var(--primary);
}

textarea::placeholder {
  color: var(--text-muted);
}

.buttons {
  display: flex;
  gap: 0.75rem;
  margin-top: 1rem;
}

.btn {
  padding: 0.6rem 1.25rem;
  border: none;
  border-radius: 6px;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s;
}

.btn-primary {
  background: var(--primary);
  color: white;
}

.btn-primary:hover {
  background: var(--primary-hover);
}

.btn-secondary {
  background: var(--surface-hover);
  color: var(--text);
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  background: var(--border);
}

.btn-small {
  padding: 0.4rem 0.75rem;
  font-size: 0.8rem;
  background: var(--surface-hover);
  color: var(--text);
  border: 1px solid var(--border);
}

.btn-small:hover {
  background: var(--border);
}

.error {
  margin-top: 0.75rem;
  padding: 0.75rem;
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid var(--error);
  border-radius: 4px;
  color: var(--error);
  font-family: var(--font-mono);
  font-size: 0.85rem;
}

.results-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
}

#count {
  font-weight: 500;
  color: var(--text-muted);
}

#count.has-results {
  color: var(--text);
}

.results-textarea {
  width: 100%;
  height: 400px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0.75rem;
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 0.9rem;
  resize: vertical;
  line-height: 1.4;
}

.results-textarea:focus {
  outline: none;
  border-color: var(--primary);
}

.results-textarea::placeholder {
  color: var(--text-muted);
}

.line-status {
  margin-top: 0.5rem;
  font-size: 0.8rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

.syntax-help {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.5rem;
  margin-bottom: 3rem;
}

.syntax-help a {
  color: var(--primary);
  text-decoration: none;
}
.syntax-help ul {
  list-style: none;
  margin-left: 0;
  padding-left: 0;
}

.syntax-help a:hover {
  text-decoration: underline;
}
.syntax-help h2 {
  font-size: 1.25rem;
  margin-bottom: 1rem;
}

.syntax-help h3 {
  font-size: 1rem;
  margin-bottom: 0.5rem;
}

.syntax-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}

.syntax-item p {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.syntax-item code,
.examples code {
  display: inline-block;
  background: var(--bg);
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  margin-right: 0.5rem;
  margin-bottom: 0.25rem;
}

.examples {
  list-style: none;
}

.examples li {
  margin-bottom: 0.5rem;
  font-size: 0.9rem;
}

.examples li code {
  margin-right: 0.25rem;
}

.example-block {
  background: var(--bg);
  padding: 1rem;
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  line-height: 1.5;
  margin-top: 0.5rem;
  overflow-x: auto;
}
