/* Base styles */
body { 
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; 
  background: #f6f7fb; 
  color: #222; 
  line-height: 1.5;
  margin: 0;
  padding: 0;
}

.container { 
  max-width: 900px; 
  margin: 40px auto; 
  padding: 0 16px; 
}

h1 { 
  font-size: 24px; 
  margin-bottom: 8px;
}

.subtitle {
  color: #666;
  margin-top: 0;
  margin-bottom: 20px;
}

/* Cards */
.card { 
  background: #fff; 
  border-radius: 8px; 
  padding: 20px; 
  box-shadow: 0 2px 8px rgba(0,0,0,0.08); 
  margin: 16px 0; 
}

/* Forms */
label { 
  display: block; 
  margin: 12px 0 6px; 
  font-weight: 600; 
}

input[type="text"], 
input[type="file"], 
input:not([type]), 
textarea { 
  width: 100%; 
  padding: 10px; 
  border: 1px solid #ddd; 
  border-radius: 6px; 
  box-sizing: border-box;
  font-size: 14px;
}

input:focus, textarea:focus {
  outline: none;
  border-color: #e66a53;
  box-shadow: 0 0 0 3px rgba(230, 106, 83, 0.1);
}

/* Buttons */
button, .btn { 
  background: #e66a53; 
  color: #fff; 
  border: 0; 
  border-radius: 6px; 
  padding: 12px 18px; 
  cursor: pointer; 
  text-decoration: none; 
  display: inline-block; 
  font-size: 14px;
  font-weight: 500;
  transition: background 0.2s;
}

button:hover, .btn:hover { 
  background: #d55a43; 
}

.btn:link, .btn:visited, .btn:hover, .btn:active { 
  color: #fff; 
}

.btn-secondary {
  background: #6c757d;
}

.btn-secondary:hover {
  background: #5a6268;
}

.card > button { 
  margin-top: 16px; 
}

/* Alerts */
.alert { 
  background: #fff4f4; 
  color: #a40000; 
  border: 1px solid #ffd1d1; 
  padding: 12px; 
  border-radius: 6px; 
  margin: 12px 0;
}

/* Grid layout */
.grid { 
  display: grid; 
  grid-template-columns: 1fr 1fr; 
  gap: 16px; 
}

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

/* Variable list */
.list { 
  background: #fafafa; 
  border: 1px dashed #ddd; 
  padding: 10px; 
  border-radius: 6px; 
  height: 160px; 
  overflow: auto; 
  width: 100%; 
  display: block; 
  box-sizing: border-box; 
}

textarea.list { 
  height: 180px; 
  resize: vertical; 
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace; 
  font-size: 12px;
  line-height: 1.4; 
  white-space: pre-wrap; 
}

/* Hints */
.hint {
  background: #f0f4ff;
  border: 1px solid #d0d8f0;
  padding: 10px;
  border-radius: 6px;
  font-size: 13px;
  color: #555;
  margin: 12px 0;
}

/* Docs links */
.docs { 
  margin-top: 16px;
  text-align: center;
  color: #666;
}

.docs a {
  color: #2d5bff;
  text-decoration: none;
}

.docs a:hover {
  text-decoration: underline;
}

/* Status page */
.status-block .row { 
  margin: 12px 0; 
  display: flex;
  align-items: center;
  gap: 8px;
}

.status-block #downloads { 
  display: flex; 
  gap: 12px; 
  margin-top: 16px; 
}

/* Spinner */
.spinner {
  width: 20px;
  height: 20px;
  border: 3px solid #f3f3f3;
  border-top: 3px solid #e66a53;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Documentation styles */
.docs-nav { 
  display: flex; 
  justify-content: flex-end; 
  gap: 8px; 
  margin-bottom: 16px; 
}

.card h1, .card h2, .card h3, .card h4 { 
  margin: 16px 0 10px; 
  line-height: 1.3; 
}

.card h1 { font-size: 24px; }
.card h2 { font-size: 20px; border-bottom: 1px solid #eee; padding-bottom: 6px; }
.card h3 { font-size: 18px; }
.card h4 { font-size: 16px; color: #333; }

.card p { 
  line-height: 1.6; 
  margin: 10px 0; 
}

.card a { 
  color: #2d5bff; 
  text-decoration: none; 
}

.card a:hover { 
  text-decoration: underline; 
}

/* Lists */
.card ul, .card ol { 
  margin: 10px 0 10px 24px; 
}

.card li { 
  margin: 6px 0; 
}

.card ul ul, .card ol ul, .card ul ol, .card ol ol { 
  margin-left: 24px; 
}

.card ul ul { list-style-type: circle; }
.card ul ul ul { list-style-type: square; }

/* Code blocks */
.card pre { 
  background: #f4f6fb; 
  border: 1px solid #e6e8f0; 
  border-radius: 6px; 
  padding: 14px; 
  overflow: auto; 
  font-size: 13px;
}

.card code { 
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace; 
  background: #f4f6fb; 
  padding: 2px 6px; 
  border-radius: 4px; 
  font-size: 13px;
}

.card pre code { 
  background: transparent; 
  padding: 0; 
}

/* Tables */
.card table { 
  width: 100%; 
  border-collapse: collapse; 
  margin: 12px 0; 
}

.card th, .card td { 
  border: 1px solid #e6e8f0; 
  padding: 8px 10px; 
  text-align: left; 
}

.card th { 
  background: #f9fafc; 
  font-weight: 600; 
}

.card tr:nth-child(even) td { 
  background: #fafbff; 
}

/* Blockquotes */
.card blockquote { 
  border-left: 3px solid #e0e4ff; 
  padding: 8px 12px; 
  background: #f7f9ff; 
  border-radius: 4px; 
  margin: 12px 0;
}

.card hr { 
  border: 0; 
  border-top: 1px solid #eee; 
  margin: 20px 0; 
}

/* TOC */
.card .toc { 
  background: #fafbff; 
  border: 1px solid #e6e8f0; 
  border-radius: 6px; 
  padding: 12px; 
}

.card .toc ul { 
  margin-left: 20px; 
}

.card .toc a { 
  text-decoration: none; 
}
