/* open hoagie - a deeply respectful riff on github.com */
:root {
  --bg: #ffffff;
  --bg-soft: #f6f8fa;
  --bg-dark: #24292f;
  --border: #d0d7de;
  --border-soft: #d8dee4;
  --fg: #1f2328;
  --fg-muted: #656d76;
  --fg-subtle: #8c959f;
  --link: #0969da;
  --link-hover: #0969da;
  --green: #1f883d;
  --green-border: rgba(31,136,61,.35);
  --radius: 6px;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans", Helvetica, Arial, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.5;
}
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
code, pre { font-family: var(--mono); }

/* ---- GitHub-style black top bar ---- */
.gh-header {
  background: var(--bg-dark);
  color: #fff;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 16px;
  height: 62px;
  position: sticky;
  top: 0;
  z-index: 50;
}
.brand {
  display: flex; align-items: center; gap: 10px;
  color: #fff; font-weight: 600; font-size: 16px;
}
.brand:hover { text-decoration: none; color: #fff; }
.brand img { width: 30px; height: 30px; border-radius: 6px; display: block; }
.header-nav { display: flex; gap: 2px; margin-left: 8px; }
.header-nav a { color: rgba(255,255,255,.75); padding: 6px 10px; border-radius: 6px; font-weight: 500; font-size: 14px; }
.header-nav a:hover { background: rgba(255,255,255,.12); text-decoration: none; color: #fff; }
.header-actions { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.avatar-stack { display: flex; }
.avatar-stack img { width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--bg-dark); margin-left: -6px; }
.avatar-stack img:first-child { margin-left: 0; }

/* ---- generic GitHub buttons ---- */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 14px; font-weight: 500; line-height: 20px;
  padding: 4px 14px; color: var(--fg);
  background: var(--bg-soft); border: 1px solid var(--border);
  border-radius: var(--radius); cursor: pointer; white-space: nowrap;
}
.btn:hover { text-decoration: none; background: #f3f4f6; }
.btn svg { fill: currentColor; }
.btn-green {
  background: var(--green); border-color: var(--green-border); color: #fff;
}
.btn-green:hover { background-color: #2c974b; text-decoration: none; color: #fff; }
.icon-btn { display: inline-flex; align-items: center; color: var(--fg-muted); padding: 3px 8px; }
.icon-btn:hover { color: var(--fg); text-decoration: none; }

/* ---- main container ---- */
.container { max-width: 1280px; margin: 0 auto; padding: 0 32px; }

/* ---- repo header band ---- */
.repo-band { padding: 24px 0 8px; }
.breadcrumb { font-size: 14px; margin-bottom: 14px; }
.breadcrumb .crumb { font-weight: 600; }
.crumb-link { font-weight: 600; color: var(--link); }
.repo-band h1 { font-size: 20px; font-weight: 600; margin: 0; display: inline-flex; align-items: center; gap: 8px; }
.repo-band .public-badge {
  display: inline-flex; align-items: center; gap: 5px; margin-left: 8px;
  border: 1px solid var(--border); color: var(--fg-muted); font-size: 12px;
  border-radius: 2em; padding: 2px 10px; font-weight: 500; vertical-align: middle;
}
.repo-description { margin: 8px 0 0; color: var(--fg-muted); font-size: 14px; max-width: 700px; }
.repo-meta { margin-top: 10px; color: var(--fg-muted); font-size: 12px; display: flex; gap: 16px; flex-wrap: wrap; }
.repo-meta a { color: var(--fg-muted); }
.repo-meta svg { fill: currentColor; vertical-align: -2px; margin-right: 4px; }

.actions-row { display: flex; align-items: center; gap: 8px; margin-top: 16px; }
.actions-row .spacer { flex: 1; }
.branch-pill {
  display: inline-flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 500;
  color: var(--fg); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 4px 12px; background: var(--bg-soft);
}
.branch-pill svg { fill: currentColor; color: var(--fg-muted); }

/* ---- tab bar ---- */
.tabs { display: flex; gap: 4px; margin-top: 18px; border-bottom: 1px solid var(--border); overflow-x: auto; }
.tab {
  display: flex; align-items: center; gap: 6px; padding: 10px 12px; font-size: 14px;
  color: var(--fg-muted); border-bottom: 2px solid transparent; white-space: nowrap;
}
.tab:hover { text-decoration: none; color: var(--fg); border-bottom-color: #d8dee4; }
.tab.active { color: var(--fg); border-bottom-color: #fd8c73; font-weight: 600; }
.tab svg { fill: currentColor; }
.tab .count {
  font-size: 12px; color: var(--fg-subtle); border: 1px solid var(--border-soft);
  border-radius: 2em; padding: 0 7px; line-height: 16px; background: var(--bg);
}

/* ---- file listing ---- */
.file-table { width: 100%; border-collapse: separate; border: 1px solid var(--border); border-radius: var(--radius); margin: 8px 0 24px; border-spacing: 0; overflow: hidden; }
.file-table thead th {
  text-align: left; font-weight: 500; font-size: 12px; color: var(--fg-muted);
  padding: 8px 12px; background: var(--bg-soft); border-bottom: 1px solid var(--border);
  border-right: 1px solid var(--border-soft);
}
.file-table thead th:last-child { border-right: none; }
.file-table tbody td {
  padding: 9px 12px; border-bottom: 1px solid var(--border-soft); font-size: 14px;
}
.file-table tbody tr:last-child td { border-bottom: none; }
.file-table tbody tr:hover { background: var(--bg-soft); }
.file-table tbody tr:hover td { border-bottom-color: transparent; }
.fname { font-family: var(--mono); font-size: 14px; white-space: nowrap; display: flex; align-items: center; gap: 8px; }
.fname .ficon { width: 16px; height: 16px; display: inline-block; vertical-align: -3px; flex: none; }
.fname a { color: var(--link); font-weight: 500; }
.fname a:hover { text-decoration: underline; }
.commit-msg { color: var(--fg); }
.commit-msg a { color: var(--fg); }
.cavatar { width: 18px; height: 18px; border-radius: 50%; vertical-align: -4px; margin-right: 7px; flex: none; }
.frow .slash { color: var(--fg-subtle); font-weight: 400; padding: 0 3px; }
.ftime { color: var(--fg-subtle); font-size: 12px; white-space: nowrap; }
.fsize { color: var(--fg-muted); font-size: 12px; white-space: nowrap; text-align: right; }
.odd-row td { background: #fff; }

/* ---- README render ---- */
.readme-wrap { border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 40px; overflow: hidden; }
.readme-bar {
  display: flex; align-items: center; gap: 10px; font-size: 14px; font-weight: 600;
  padding: 8px 16px; background: var(--bg-soft); border-bottom: 1px solid var(--border);
}
.readme-bar svg { fill: currentColor; color: var(--fg); }
.readme-bar .rclip { margin-left: auto; color: var(--fg-muted); font-weight: 400; }
.readme { padding: 16px 24px 24px; font-size: 16px; line-height: 1.6; }
.readme h1 { font-size: 24px; border-bottom: 1px solid var(--border-soft); padding-bottom: 8px; margin-top: 8px; }
.readme h2 { font-size: 20px; border-bottom: 1px solid var(--border-soft); padding-bottom: 6px; margin-top: 24px; }
.readme blockquote { color: var(--fg-muted); border-left: 4px solid var(--border); margin: 0 0 16px; padding: 0 16px; }
.readme pre {
  background: var(--bg-soft); border: 1px solid var(--border-soft); border-radius: var(--radius);
  padding: 16px; overflow-x: auto; font-size: 85%;
}
.readme code { color: #24292f; }
.readme pre code { background: none; padding: 0; }
.readme li { margin: 4px 0; }
.readme .warn-box { border: 1px solid #d4a72c; background: #fff8c5; border-radius: 6px; padding: 10px 14px; margin: 16px 0; }
.readme .warn-box b { color: #6a5200; }

/* ---- file viewer page ---- */
.fv-pagerow { display: flex; align-items: center; gap: 8px; margin: 20px 0 8px; flex-wrap: wrap; }
.file-title { display: flex; align-items: center; gap: 8px; font-size: 15px; }
.file-title .fname { font-size: 15px; font-weight: 600; }
.mono-chip { font-family: var(--mono); }
.file-header {
  display: flex; align-items: center; padding: 8px 16px;
  border: 1px solid var(--border); border-bottom: none; border-radius: var(--radius) var(--radius) 0 0;
  background: var(--bg-soft); font-size: 14px;
}
.file-header .stats { margin-left: auto; color: var(--fg-muted); font-size: 12px; display: flex; gap: 12px; align-items: center; }
.file-header .stats a { color: var(--fg-muted); }
.code-view {
  border: 1px solid var(--border); border-top: none; border-radius: 0 0 var(--radius) var(--radius);
  overflow-x: auto; margin-bottom: 40px; background: #fff;
}
.code-view table { border-collapse: collapse; width: 100%; min-width: 700px; }
.code-view td { padding: 0; vertical-align: top; font-family: var(--mono); font-size: 13px; line-height: 20px; white-space: pre; }
.code-view .ln {
  color: #8c959f; text-align: right; padding: 0 12px; width: 1px; user-select: none;
  border-right: 1px solid var(--border-soft); background: var(--bg-soft);
}
.code-view .lc { padding-left: 16px; }
/* syntax colours */
.cv-kw { color: #cf222e; }        /* keyword */
.cv-str { color: #0a3069; }       /* string */
.cv-num { color: #0550ae; }       /* number */
.cv-com { color: #6a737d; }       /* comment */
.cv-fn { color: #8250df; }        /* function name */
.code-view tr:hover td { background: #f6f8fa; }
.code-view tr:hover .ln { background: #eff1f4; }

footer.site {
  border-top: 1px solid var(--border); margin-top: 40px; padding: 24px 0 40px;
  color: var(--fg-muted); font-size: 12px; display: flex; gap: 20px; align-items: center; flex-wrap: wrap;
}
footer.site .grow { flex: 1; }

/* ---- the Code dropdown ---- */
.code-drop { position: relative; }
.code-panel {
  position: absolute; right: 0; top: calc(100% + 6px); width: 360px; max-width: 90vw;
  background: #fff; border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: 0 8px 24px rgba(140,149,159,.2); padding: 14px; z-index: 60; display: none;
}
.code-panel.open { display: block; }
.code-panel h4 { margin: 0 0 8px; font-size: 12px; text-transform: uppercase; color: var(--fg-subtle); }
.clone-box {
  display: flex; gap: 6px; margin: 6px 0 12px;
}
.clone-box input {
  flex: 1; font-family: var(--mono); font-size: 12px; padding: 5px 8px;
  border: 1px solid var(--border); border-radius: 4px; color: var(--link);
}
.clone-box button { border: 1px solid var(--border); background: var(--bg-soft); border-radius: 4px; cursor: pointer; padding: 5px 8px; }
.code-panel .plr { display: flex; gap: 8px; }
.code-panel .plr .btn { flex: 1; justify-content: center; }

/* mobile */
@media (max-width: 900px) {
  .container { padding: 0 16px; }
  .header-nav a:not(.always) { display: none; }
  .frow .fsize { display: none; }
  .code-panel { width: 300px; }
}
@media (max-width: 640px) {
  .frow .fname a { white-space: normal; word-break: break-all; }
  .frow .ftime, .frow .fname .ficon { display: none; }
  .tabs { padding-bottom: 0; }
}