:root {
  /* Shared landing tokens - brand locked */
  --primary: #2563eb;
  --primary-hover: #1e40af;
  --bg: #f8fafc;
  --surface: #ffffff;
  --border: #e2e8f0;
  --text: #0f172a;
  --text-secondary: #64748b;
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --radius: 2px;
}

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

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

.skip-link {
  position: absolute;
  top: -40px;
  left: 0;
  background: var(--primary);
  color: white;
  padding: 0.5rem 1rem;
  text-decoration: none;
  z-index: 9999;
}

.skip-link:focus {
  top: 0;
}

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

header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 1.5rem 0;
  margin-bottom: 2rem;
}

header h1 {
  font-size: 1.5rem;
  font-weight: 600;
}

header p {
  color: var(--text-secondary);
  font-size: 0.875rem;
}

.btn {
  display: inline-block;
  padding: 0.5rem 1rem;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: var(--radius);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.2s;
}

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

.btn:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

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

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

.btn-secondary:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

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

.card h3 {
  margin-bottom: 0.5rem;
  font-size: 1.125rem;
}

.card p {
  color: var(--text-secondary);
  font-size: 0.875rem;
  margin-bottom: 0.25rem;
}

.card-button {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-bottom: 1rem;
  width: 100%;
  text-align: left;
  cursor: pointer;
  transition: all 0.2s;
}

.card-button:hover {
  border-color: var(--primary);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.card-button:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
}

.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.modal.active {
  display: flex;
}

.modal-content {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 2rem;
  max-width: 500px;
  width: 90%;
}

.modal-content h2 {
  margin-bottom: 1rem;
}

.form-group {
  margin-bottom: 1rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.25rem;
  font-size: 0.875rem;
  font-weight: 500;
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 0.5rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-family: inherit;
  font-size: 0.875rem;
}

.form-group input:focus-visible,
.form-group textarea:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.form-group textarea {
  min-height: 400px;
  font-family: 'Consolas', 'Monaco', monospace;
}

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

.editor {
  display: none;
}

.editor.active {
  display: block;
}

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

.tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.tab {
  padding: 0.5rem 1rem;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  font-size: 0.875rem;
  color: var(--text-secondary);
  white-space: nowrap;
}

.tab:hover {
  color: var(--text);
}

.tab:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.tab.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

@media (max-width: 640px) {
  .tabs {
    flex-wrap: wrap;
  }
}

.hidden {
  display: none;
}

.loading {
  text-align: center;
  padding: 2rem;
  color: var(--text-secondary);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.loading::before {
  content: '';
  width: 32px;
  height: 32px;
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

pre {
  background: var(--bg);
  padding: 1rem;
  border-radius: var(--radius);
  overflow-x: auto;
  font-size: 0.875rem;
}

.checklist-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.checklist-item {
  padding: 0.5rem 1rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 0.875rem;
  color: var(--text);
  transition: all 0.2s;
}

.checklist-item:hover {
  background: var(--surface);
  border-color: var(--primary);
}

.checklist-item:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.checklist-item.active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

.status-badge {
  display: inline-block;
  padding: 0.25rem 0.5rem;
  color: white;
  border-radius: var(--radius);
  font-size: 0.75rem;
  font-weight: 500;
}

.status-badge.status-active {
  background: var(--success);
}

.status-badge.status-archived {
  background: var(--text-secondary);
}

.status-badge.status-draft {
  background: var(--warning);
}

.demo-badge {
  display: inline-block;
  padding: 0.25rem 0.5rem;
  background: var(--primary);
  color: white;
  border-radius: var(--radius);
  font-size: 0.75rem;
  font-weight: 600;
  margin-left: 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.card-button .demo-badge {
  margin-left: 0;
  margin-bottom: 0.5rem;
}

.toast {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.5rem;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  z-index: 2000;
  animation: slideIn 0.3s ease-out;
  max-width: 400px;
}

.toast.success {
  border-left: 4px solid var(--success);
}

.toast.error {
  border-left: 4px solid var(--danger);
}

.toast.warning {
  border-left: 4px solid var(--warning);
}

@keyframes slideIn {
  from {
    transform: translateY(100%);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.auth-form {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem;
  max-width: 400px;
  margin: 4rem auto;
}

.auth-form h2 {
  margin-bottom: 1rem;
}

.logout-link {
  color: var(--text-secondary);
  font-size: 0.875rem;
  cursor: pointer;
  text-decoration: underline;
}

.logout-link:hover {
  color: var(--primary);
}
