* { box-sizing: border-box; }

body {
  max-width: 960px;
  margin: 2rem auto;
  padding: 0 1rem 3rem;
  color: #111;
  background: #fff;
  font: 14px/1.55 ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
}

a { color: #0645ad; text-decoration: underline; }
h1, h2, p, pre, ul, table, form { margin-top: 0; }
pre, code, input, textarea, select, button { font: inherit; }
pre, .clone-box code { overflow-x: auto; padding: .6rem; border: 1px solid #ddd; background: #fafafa; }
pre code.hljs { padding: 0; background: transparent; }
input, textarea, select { width: 100%; padding: .4rem; border: 1px solid #aaa; background: #fff; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: .35rem .5rem; border: 1px solid #ddd; text-align: left; }

button, .button {
  display: inline-block;
  padding: .3rem .55rem;
  color: #111;
  background: #eee;
  border: 1px solid #999;
  text-decoration: none;
  cursor: pointer;
}

.site-header, .repo-header, .profile-header, .panel, .auth-card {
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid #ddd;
}

.site-header, .nav, .repo-tabs, .filters, .tabs, .panel-heading, .hero-actions, .breadcrumb, .repo-actions, .ref-actions {
  display: flex;
  gap: .75rem;
  align-items: baseline;
  flex-wrap: wrap;
}

.site-header, .panel-heading, .repo-header { justify-content: space-between; }
.repo-title-row { display: flex; gap: .75rem; align-items: baseline; flex-wrap: wrap; }
.repo-title-row h1 { margin-bottom: 0; }
.brand { color: #111; font-weight: 700; text-decoration: none; }
.nav form, .repo-tabs form, .inline-form { display: inline; }
.link-button { padding: 0; color: #0645ad; background: none; border: 0; text-decoration: underline; }
.repo-tabs .repo-tab { padding-bottom: .2rem; border-bottom: 2px solid transparent; }
.repo-tabs .repo-tab.active { color: #111; font-weight: 700; text-decoration: none; }
.ref-picker { position: relative; display: inline-block; }
.ref-picker-menu {
  position: absolute;
  left: 0;
  top: calc(100% + .4rem);
  z-index: 20;
  width: 20rem;
  max-width: calc(100vw - 2rem);
  padding: .5rem;
  border: 1px solid #bbb;
  background: #fff;
  box-shadow: 0 .4rem 1.2rem rgba(0, 0, 0, .12);
}
.ref-picker-search { margin-bottom: .4rem; }
.ref-picker-options { display: grid; gap: .1rem; max-height: 18rem; overflow-y: auto; }
.ref-picker-option {
  display: flex;
  gap: 1rem;
  justify-content: space-between;
  padding: .35rem .45rem;
  color: #111;
  text-decoration: none;
}
.ref-picker-option:hover, .ref-picker-option:focus, .ref-picker-option.active {
  background: #eef4fb;
  text-decoration: none;
}
.ref-picker-option.active { font-weight: 700; }
.ref-picker-current { color: #666; font-weight: 400; }
.ref-picker-empty { padding: .35rem .45rem; color: #666; }
.ref-picker-footer {
  display: flex;
  gap: .75rem;
  flex-wrap: wrap;
  margin-top: .5rem;
  padding-top: .45rem;
  border-top: 1px solid #ddd;
}
.ref-picker-link.active { color: #111; font-weight: 700; text-decoration: none; }
.filters .active, .tabs .active { color: #111; font-weight: 700; text-decoration: none; }
.hero, .repo-tabs { margin-bottom: 1.5rem; }
.eyebrow, .muted, .empty, .nav-user, .repo-card small, .issue-list span, .commit-list span, .file-list span, .clean-list span, .file-kind { color: #666; }
.repo-list, .stack, form, .clean-list, .commit-list, .file-list, .issue-list { display: grid; gap: .75rem; }
.repo-card { display: block; padding: .75rem 0; border-bottom: 1px solid #eee; color: #111; }
.repo-card strong, .repo-card span, .repo-card small, .clone-box code { display: block; }
.markdown-body { overflow-x: auto; }
.markdown-body img { max-width: 100%; }
.grid.two { display: grid; grid-template-columns: 1fr 18rem; gap: 2rem; }
.meta-list { display: grid; grid-template-columns: 8rem 1fr; gap: .35rem 1rem; }
.meta-list dt { color: #666; }
.meta-list dd { margin: 0; overflow-x: auto; }
.activity-feed { display: grid; gap: 1rem; padding-left: 0; list-style: none; }
.activity-feed li { padding-bottom: 1rem; border-bottom: 1px solid #eee; }
.activity-title, .activity-detail { margin-bottom: .25rem; }
.activity-detail { color: #333; }
.comment-list { display: grid; gap: 1rem; }
.comment { border-bottom: 1px solid #eee; }
.diff { max-height: 70vh; }
.file-table { width: 100%; border-collapse: collapse; }
.file-table td { padding: .4rem 0; border-bottom: 1px solid #eee; }
.file-kind { width: 4rem; }
.commit-list, .file-list, .issue-list, .clean-list { padding-left: 0; list-style: none; }
.commit-list li, .file-list li { display: grid; grid-template-columns: 8rem 1fr; gap: 1rem; }
.tag-list li { display: grid; grid-template-columns: 1fr 18rem; gap: 1.5rem; padding-bottom: 1rem; border-bottom: 1px solid #eee; }
.tag-actions { display: grid; gap: .75rem; align-content: start; }
.alert { margin-bottom: 1rem; color: #900; }
.notice { margin-bottom: 1rem; color: #060; }
.danger-zone { color: #900; }
.button.danger { color: #900; border-color: #900; }
.button-link { background: none; border: none; padding: 0; color: #069; text-decoration: underline; cursor: pointer; font: inherit; }
.ref-picker-toggle { display: inline-flex; gap: .25rem; align-items: center; background: none; border: none; padding: 0; color: #666; cursor: pointer; font: inherit; font-size: smaller; }

@media (max-width: 760px) {
  body { margin-top: 1rem; }
  .grid.two, .commit-list li, .tag-list li { grid-template-columns: 1fr; }
}
