:root {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans JP", sans-serif;
  color: #25232a;
  background: #f5f5f7;
  --primary: #6550a0;
  --border: #d9d6de;
  --muted: #6c6872;
}

* { box-sizing: border-box; }
body { margin: 0; }
a { color: #513d88; }
button, input { font: inherit; }
button { cursor: pointer; }
.container { width: min(860px, calc(100% - 32px)); margin: 0 auto; }
.navbar, footer { background: #fff; border-bottom: 1px solid var(--border); }
.navbar .container, footer .container { min-height: 60px; display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.navbar a { font-size: 14px; text-decoration: none; }
.related-links { display: flex; flex-wrap: wrap; gap: 8px 18px; }
.navbar .brand { color: #25232a; font-size: 16px; font-weight: 650; }
main { padding: 44px 0 56px; }
h1 { margin: 0 0 8px; font-size: clamp(26px, 5vw, 34px); }
.intro { margin: 0 0 24px; color: var(--muted); line-height: 1.6; }
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-bottom: 16px; }
.search { flex: 1 1 230px; }
.search input { width: 100%; height: 40px; padding: 8px 12px; color: inherit; background: #fff; border: 1px solid var(--border); border-radius: 5px; }
.filters { display: flex; gap: 6px; flex-wrap: wrap; }
.filters button { padding: 8px 11px; color: #513d88; background: #fff; border: 1px solid var(--border); border-radius: 5px; font-size: 13px; }
.filters button[aria-pressed="true"] { color: #fff; background: var(--primary); border-color: var(--primary); }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.notice { margin: 0 0 16px; padding: 12px 14px; color: #654713; background: #fff1d8; border: 1px solid #e5cea0; border-radius: 5px; font-size: 13px; }
.notice:empty { display: none; }
.count { margin: 0 0 10px; color: var(--muted); font-size: 13px; }
.modules { overflow: hidden; background: #fff; border: 1px solid var(--border); border-radius: 7px; }
.module { display: flex; justify-content: space-between; align-items: center; gap: 22px; padding: 18px 20px; }
.module + .module { border-top: 1px solid var(--border); }
.module-info { min-width: 0; }
.module h2 { display: inline; margin: 0; font-size: 17px; line-height: 1.45; }
.badges { display: inline-flex; gap: 5px; margin-left: 10px; vertical-align: 2px; }
.badge { padding: 2px 6px; color: #513d88; background: #f2eef9; border-radius: 3px; font-size: 10px; font-weight: 650; }
.module .detail, .module .meta { margin: 6px 0 0; color: var(--muted); font-size: 13px; line-height: 1.5; }
.module .credit { margin: 5px 0 0; color: var(--muted); font-size: 12px; }
.module .source-links { display: flex; gap: 12px; margin: 5px 0 0; font-size: 12px; }
.actions { display: flex; flex: 0 0 auto; gap: 12px; align-items: center; }
.action { display: inline-block; padding: 8px 12px; color: #fff; background: var(--primary); border-radius: 5px; font-size: 13px; text-decoration: none; white-space: nowrap; }
.action:hover { background: #513d88; }
.secondary { font-size: 13px; white-space: nowrap; }
.text-link { padding: 0; color: #513d88; background: none; border: 0; text-decoration: underline; text-underline-offset: 2px; }
.text-link:hover { color: #37245f; }
.empty { margin: 0; padding: 20px; color: var(--muted); font-size: 14px; }
dialog { width: min(720px, calc(100% - 28px)); max-height: min(80vh, 900px); padding: 0; color: inherit; background: #fff; border: 1px solid var(--border); border-radius: 8px; box-shadow: 0 16px 48px #24202d40; }
dialog::backdrop { background: #17132180; }
.dialog-header, .dialog-footer { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 20px; }
.dialog-header { border-bottom: 1px solid var(--border); }
.dialog-header h2 { margin: 0; font-size: 18px; }
.dialog-header button { padding: 0 5px; color: var(--muted); background: none; border: 0; font-size: 26px; line-height: 1; }
.dialog-footer { border-top: 1px solid var(--border); font-size: 13px; }
.dialog-footer button { padding: 7px 12px; color: #fff; background: var(--primary); border: 0; border-radius: 5px; }
.document-content { max-height: calc(80vh - 116px); overflow: auto; padding: 8px 20px 20px; font-size: 14px; line-height: 1.7; }
.document-content h2 { margin: 20px 0 10px; font-size: 20px; }
.document-content h3 { margin: 18px 0 8px; font-size: 16px; }
.document-content p { margin: 12px 0; }
.document-content ul { padding-left: 24px; }
.document-content code { padding: 1px 3px; background: #f2f0f5; border-radius: 3px; }
.document-content pre { overflow: auto; padding: 12px; background: #f5f4f7; border-radius: 5px; line-height: 1.5; }
.document-content pre code { padding: 0; background: none; }
.document-content .license-text { white-space: pre-wrap; overflow-wrap: anywhere; font: inherit; }
.document-content table { width: 100%; border-collapse: collapse; }
.document-content td { padding: 7px 9px; border: 1px solid var(--border); }
.document-content tr:first-child { font-weight: 650; background: #f5f4f7; }
footer { border-top: 1px solid var(--border); border-bottom: 0; color: var(--muted); font-size: 12px; }
footer p { margin: 0; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

@media (max-width: 640px) {
  .navbar .container { align-items: flex-start; flex-direction: column; justify-content: center; gap: 8px; padding: 14px 0; }
  main { padding: 30px 0 40px; }
  .module { align-items: stretch; flex-direction: column; gap: 12px; padding: 16px; }
  .actions { justify-content: flex-start; }
  footer .container { align-items: flex-start; flex-direction: column; justify-content: center; gap: 7px; padding: 15px 0; }
}
