* { box-sizing: border-box; }

html, body {
  margin: 0; padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  font-size: 15px; line-height: 1.5;
}

.container {
  max-width: 560px;
  margin: 4rem auto;
  padding: 0 1rem;
}

.card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 2rem;
}

.card-header h1 {
  margin: 0 0 0.5rem;
  font-size: 1.5rem;
  font-weight: 600;
}

.card-footer {
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.muted { color: var(--muted); }
.muted small { display: block; line-height: 1.45; }

.alert {
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  border: 1px solid;
  margin: 1rem 0;
}
.alert-error { background: var(--error-bg); border-color: var(--error-border); color: var(--error-text); }
.alert-info { background: var(--info-bg); border-color: var(--info-border); color: var(--info-text); }
.alert-warning { background: #fff8e6; border-color: #f0c36d; color: #7a5b00; }
.alert-warning code { background: #fdebc3; padding: 0.1rem 0.3rem; border-radius: 4px; }

.field { display: block; margin: 1rem 0; }
.field-label { display: block; font-weight: 500; margin-bottom: 0.4rem; }
.field-help { display: block; color: var(--muted); margin-top: 0.35rem; font-size: 0.85rem; }

textarea, input[type=text] {
  width: 100%;
  padding: 0.6rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-family: ui-monospace, "SF Mono", Monaco, Consolas, monospace;
  font-size: 0.85rem;
  resize: vertical;
}
textarea:focus, input:focus {
  outline: 2px solid var(--primary);
  outline-offset: -1px;
  border-color: var(--primary);
}

.actions { margin-top: 1.5rem; display: flex; gap: 0.75rem; justify-content: flex-end; }

.btn-primary {
  background: var(--primary);
  color: #fff;
  border: none;
  padding: 0.65rem 1.25rem;
  border-radius: var(--radius);
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s;
}
.btn-primary:hover { background: var(--primary-hover); }

/* --- Landing page --- */
.landing { max-width: 720px; margin: 2rem auto; padding: 0 1rem; }
.hero { padding: 2rem 0 1.5rem; border-bottom: 1px solid var(--border); margin-bottom: 1.5rem; }
.hero h1 { font-size: 2rem; margin: 0 0 0.5rem; }
.hero .tagline { font-size: 1.1rem; line-height: 1.6; color: var(--text); margin: 0.5rem 0; }
.hero a { color: var(--primary); }
.small { font-size: 0.85rem; }

.section { margin: 2rem 0; }
.section h2 { font-size: 1.25rem; margin: 0 0 0.75rem; padding-bottom: 0.35rem; border-bottom: 1px solid var(--border); }
.section p { line-height: 1.6; margin: 0.5rem 0; }

.callout {
  background: var(--info-bg);
  border-left: 3px solid var(--primary);
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  font-size: 0.92rem;
}

details {
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.75rem 1rem;
  margin: 0.75rem 0;
}
details[open] { background: #fff; }
summary { cursor: pointer; padding: 0.25rem 0; user-select: none; }
summary:hover { color: var(--primary); }
details > *:not(summary) { margin-top: 0.75rem; }

pre {
  background: #0f172a;
  color: #e2e8f0;
  padding: 0.85rem 1rem;
  border-radius: var(--radius);
  overflow-x: auto;
  font-size: 0.82rem;
  line-height: 1.5;
}
code { font-family: ui-monospace, "SF Mono", Monaco, Consolas, monospace; }
:not(pre) > code {
  background: #f1f5f9;
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
  font-size: 0.85em;
  border: 1px solid var(--border);
}

ol, ul { padding-left: 1.5rem; line-height: 1.7; }
.examples li { margin: 0.35rem 0; font-style: italic; color: var(--text); }

.landing footer { margin-top: 3rem; padding-top: 1rem; border-top: 1px solid var(--border); }
.landing footer code { font-size: 0.78rem; }
