* { box-sizing: border-box; }
body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #f2f4f8;
  margin: 0;
  padding: 0;
  color: #111827;
}
header {
  background: #111827;
  color: white;
  padding: 20px;
}
header h1 {
  margin: 0 0 6px 0;
}
header p {
  margin: 0;
  font-size: 0.9rem;
  opacity: 0.9;
}
main {
  padding: 20px;
  max-width: 1280px;
  margin: 0 auto;
}
.card {
  background: white;
  border-radius: 12px;
  padding: 18px 20px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
}
.section-gap {
  margin-top: 20px;
}
h2 {
  margin-top: 0;
  margin-bottom: 10px;
}
h3 {
  margin-top: 16px;
  margin-bottom: 6px;
}
textarea {
  width: 100%;
  min-height: 220px;
  padding: 10px;
  border-radius: 8px;
  border: 1px solid #d1d5db;
  resize: vertical;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 0.85rem;
  background: #f9fafb;
}
button {
  background: #111827;
  color: white;
  border: none;
  padding: 10px 16px;
  border-radius: 8px;
  cursor: pointer;
  margin-top: 10px;
  font-weight: 600;
  font-size: 0.9rem;
}
button:hover {
  background: #1f2937;
}
button:disabled {
  background: #9ca3af;
  cursor: default;
}
.error-text {
  color: #c00;
}
.controls {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  align-items: center;
}
.controls label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
}
.controls select,
.controls input[type="checkbox"] {
  font-size: 0.9rem;
}
.status {
  font-size: 0.8rem;
  color: #4b5563;
  margin-top: 6px;
}
.tag {
  display: inline-block;
  background: #dbeafe;
  color: #1e40af;
  padding: 4px 10px;
  border-radius: 999px;
  margin: 4px 4px 0 0;
  font-size: 12px;
  white-space: nowrap;
}
.pill {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  background: #e5e7eb;
  font-size: 11px;
  margin: 2px 4px 0 0;
}
.grid-2 {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 12px;
}
.small {
  font-size: 0.8rem;
  color: #6b7280;
}
pre {
  white-space: pre-wrap;
  word-break: break-word;
  background: #f8fafc;
  padding: 10px;
  border-radius: 8px;
  font-size: 0.8rem;
  border: 1px solid #e5e7eb;
  max-height: 260px;
  overflow: auto;
}
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8rem;
  margin-top: 6px;
}
th, td {
  border: 1px solid #e5e7eb;
  padding: 4px 6px;
  text-align: left;
  vertical-align: top;
}
th {
  background: #f3f4f6;
}
footer {
  background: #111827;
  color: #e5e7eb;
  padding: 24px 20px;
  font-size: 0.9rem;
  line-height: 1.6;
}
footer a {
  color: #93c5fd;
  text-decoration: none;
  border-bottom: 1px solid transparent;
}
footer a:hover {
  border-bottom-color: #93c5fd;
}
.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 10px;
}
.brand-chip {
  display: inline-block;
  margin-bottom: 14px;
  padding: 8px 12px;
  background: #fde68a;
  color: #92400e;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.9rem;
}
.dev-doc .doc-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 10px;
}
.dev-doc .doc-links a {
  display: inline-block;
  padding: 8px 12px;
  border-radius: 8px;
  background: #eef2ff;
  color: #3730a3;
  text-decoration: none;
  border: 1px solid #c7d2fe;
  font-size: 0.9rem;
}
.dev-doc .doc-links a:hover {
  background: #e0e7ff;
}
.dev-doc .doc-links .doc-view-btn {
  display: inline-block;
  padding: 8px 12px;
  border-radius: 8px;
  background: #2563eb;
  color: white;
  border: none;
  cursor: pointer;
  font-size: 0.9rem;
}
.dev-doc .doc-links .doc-view-btn:hover {
  background: #1d4ed8;
}
.modal {
  position: fixed;
  inset: 0;
  background: rgba(17, 24, 39, 0.75);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 1000;
}
.modal.hidden {
  display: none;
}
.modal-content {
  width: min(100%, 980px);
  max-height: 90vh;
  background: white;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  background: #111827;
  color: white;
}
.modal-header-left {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
#modalSearchInput {
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid #cbd5e1;
  font-size: 0.9rem;
  max-width: 260px;
}
.modal-close {
  background: transparent;
  border: none;
  color: white;
  font-size: 1.6rem;
  cursor: pointer;
}
.modal-body {
  padding: 18px 20px;
  background: #f9fafb;
}
.modal-markdown {
  max-height: 72vh;
  overflow: auto;
  margin: 0;
  background: #ffffff;
  color: #111827;
  padding: 16px;
  border-radius: 12px;
  font-size: 0.95rem;
  line-height: 1.6;
}
.modal-markdown h1,
.modal-markdown h2,
.modal-markdown h3,
.modal-markdown h4,
.modal-markdown h5,
.modal-markdown h6 {
  margin: 1.1rem 0 0.5rem;
  font-weight: 700;
}
.modal-markdown p {
  margin: 0.65rem 0;
}
.modal-markdown ul,
.modal-markdown ol {
  margin: 0.65rem 0 0.65rem 1.2rem;
}
.modal-markdown li {
  margin: 0.35rem 0;
}
.modal-markdown code {
  background: #f3f4f6;
  padding: 2px 4px;
  border-radius: 4px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', monospace;
}
.modal-markdown .md-code {
  background: #111827;
  color: #f8fafc;
  padding: 14px;
  border-radius: 12px;
  overflow: auto;
}
.md-search-highlight {
  background: #fde68a;
  color: #92400e;
  border-radius: 3px;
  padding: 0 2px;
}
.modal-error {
  color: #b91c1c;
}
.modal-body pre {
  display: none;
  max-height: 72vh;
  overflow: auto;
  margin: 0;
  background: #111827;
  color: #f8fafc;
  padding: 16px;
  border-radius: 12px;
  font-size: 0.85rem;
}
.print-branding {
  display: none;
  font-size: 0.95rem;
  font-weight: 700;
  margin-bottom: 12px;
}
@media print {
  .print-branding {
    display: block;
    text-align: center;
    margin-bottom: 18px;
  }
  body {
    background: white;
    color: black;
  }
  header, .controls, button, footer, .status {
    display: none !important;
  }
  main {
    padding: 0;
  }
  .card {
    box-shadow: none;
    border: none;
    padding: 0;
    border-radius: 0;
  }
}
@media (max-width: 900px) {
  main {
    padding: 16px;
  }
  .grid-2 {
    grid-template-columns: 1fr;
  }
}
