* { box-sizing: border-box; }
body { font-family: system-ui, sans-serif; margin: 0; color: #1a1a1a; background: #fafafa; }
main { max-width: 800px; margin: 0 auto; padding: 1rem; }
h1 { font-size: 1.3rem; }
h2 { font-size: 1.1rem; margin-top: 1.5rem; }
h3, h4 { font-size: 1rem; }

.topnav {
  display: flex; align-items: center; gap: 1rem;
  padding: 0.8rem 1rem; background: #1d4ed8; color: white;
  position: sticky; top: 0; z-index: 10;
}
.topnav a { color: white; text-decoration: none; opacity: 0.9; }
.topnav a:hover { opacity: 1; text-decoration: underline; }

input, select, textarea, button { display: block; margin: 0.4rem 0; padding: 0.6rem; width: 100%; box-sizing: border-box; font-size: 1rem; border: 1px solid #d1d5db; border-radius: 4px; }
button { width: auto; padding: 0.6rem 1.2rem; cursor: pointer; background: #1d4ed8; color: white; border: none; border-radius: 4px; }
button:disabled { background: #9ca3af; cursor: not-allowed; }
.readonly-box { background: #f3f4f6; padding: 1rem; white-space: pre-wrap; max-height: 200px; overflow-y: auto; border-radius: 4px; }
.hint { color: #6b7280; font-size: 0.9rem; }
textarea { font-family: inherit; }

.result-row { padding: 0.6rem; background: white; border: 1px solid #e5e7eb; border-radius: 4px; margin-bottom: 0.3rem; cursor: pointer; }
.result-row:hover { background: #eff6ff; }

.tabs { display: flex; flex-wrap: wrap; gap: 0.3rem; margin-bottom: 1rem; }
.tab-btn { background: #e5e7eb; color: #1a1a1a; padding: 0.5rem 0.8rem; font-size: 0.9rem; }
.tab-btn.active { background: #1d4ed8; color: white; }

details { background: white; border: 1px solid #e5e7eb; border-radius: 4px; padding: 0.6rem; margin: 0.6rem 0; }

@media (max-width: 480px) {
  .topnav { flex-wrap: wrap; }
  main { padding: 0.6rem; }
  .tabs { justify-content: space-between; }
  .tab-btn { flex: 1 1 30%; }
}
