/* GitHub の見た目に寄せるための部品。色・余白はすべて Primer のトークンを使う。 */
:root { --header-h: 64px; }
html, body { height: 100%; }
body { background: var(--bgColor-default); color: var(--fgColor-default); font-family: var(--fontStack-sansSerif, -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji"); font-size: 14px; line-height: 1.5; display: flex; flex-direction: column; min-height: 100vh; }
.application-main { flex: 1 0 auto; }
a { color: var(--fgColor-accent); text-decoration: none; }
a:hover { text-decoration: underline; }
.Link--primary { color: var(--fgColor-default) !important; }
.Link--primary:hover { color: var(--fgColor-accent) !important; }
.Link--secondary { color: var(--fgColor-muted) !important; }
.Link--secondary:hover { color: var(--fgColor-accent) !important; }
.Link--muted { color: var(--fgColor-muted) !important; }
.Link--muted:hover { color: var(--fgColor-accent) !important; }
.text-mono { font-family: var(--fontStack-monospace, ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace); font-size: 12px; }
.gap-2 { gap: 8px; }
.min-width-0 { min-width: 0; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.no-underline:hover { text-decoration: none; }
.dropdown-caret { display: inline-block; width: 0; height: 0; margin-left: 4px; vertical-align: middle; content: ""; border-style: solid; border-width: 4px 4px 0; border-right-color: transparent; border-bottom-color: transparent; border-left-color: transparent; }

/* ---- AppHeader（グローバルナビ） ---- */
.AppHeader { background: var(--bgColor-inset); border-bottom: 1px solid var(--borderColor-muted); }
.AppHeader-globalBar { display: flex; align-items: center; justify-content: space-between; height: var(--header-h); padding: 0 16px; }
.AppHeader-globalBar-start, .AppHeader-globalBar-end { display: flex; align-items: center; gap: 8px; min-width: 0; }
.AppHeader-logo { display: inline-flex; color: var(--fgColor-default); padding: 8px; }
.AppHeader-logo:hover { text-decoration: none; }
.AppHeader-context-list { display: flex; align-items: center; list-style: none; margin: 0; padding: 0; min-width: 0; }
.AppHeader-context-item { display: inline-flex; align-items: center; padding: 6px 8px; border-radius: 6px; color: var(--fgColor-default); font-size: 14px; line-height: 20px; max-width: 320px; }
.AppHeader-context-item:hover { background: var(--bgColor-neutral-muted); text-decoration: none; }
.AppHeader-context-item-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.AppHeader-context-item-separator { color: var(--fgColor-muted); padding: 0 2px; }
.AppHeader-button { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; border: 1px solid var(--borderColor-default); border-radius: 6px; color: var(--fgColor-muted); background: var(--bgColor-default); }
.AppHeader-button:hover { color: var(--fgColor-default); background: var(--bgColor-muted); }
.AppHeader-user { display: inline-flex; margin-left: 8px; }
.AppHeader-user img { box-shadow: 0 0 0 1px var(--borderColor-translucent); }
.AppHeader-localBar { padding: 0 16px; }

/* ---- UnderlineNav ---- */
.UnderlineNav { display: flex; }
.UnderlineNav-body { display: flex; list-style: none; margin: 0; padding: 0; gap: 8px; }
.UnderlineNav-item { position: relative; display: inline-flex; align-items: center; gap: 8px; padding: 8px 8px 8px; line-height: 30px; color: var(--fgColor-default); border-radius: 6px; font-size: 14px; }
.UnderlineNav-item:hover { text-decoration: none; }
.UnderlineNav-item::before { content: ""; position: absolute; inset: 6px 0; border-radius: 6px; z-index: -1; }
.UnderlineNav-item:hover::before { background: var(--bgColor-neutral-muted); }
.UnderlineNav-item::after { content: ""; position: absolute; left: 8px; right: 8px; bottom: -1px; height: 2px; border-radius: 6px; background: transparent; }
.UnderlineNav-item[aria-current="page"] { font-weight: 600; }
.UnderlineNav-item[aria-current="page"]::after { background: #fd8c73; }
.UnderlineNav-octicon { color: var(--fgColor-muted); }
.UnderlineNav-item[aria-current="page"] .UnderlineNav-octicon { color: var(--fgColor-default); }
.UnderlineNav .Counter { margin-left: 2px; }
.UnderlineNav--profile { border-bottom: 1px solid var(--borderColor-muted); }

/* ---- レイアウト ---- */
.container-xl { max-width: 1280px; margin: 0 auto; }
.Layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 24px; }
@media (min-width: 1012px) {
  .Layout--sidebarPosition-end { grid-template-columns: minmax(0, 1fr) 296px; }
  .Layout--sidebarPosition-start { grid-template-columns: 296px minmax(0, 1fr); }
  .Layout--sidebarPosition-start.Layout--sidebar-narrow { grid-template-columns: 256px minmax(0, 1fr); }
  .Layout--sidebarPosition-start .Layout-sidebar { order: 0; }
  .Layout--sidebarPosition-start .Layout-main { order: 1; }
}
.Layout-main { min-width: 0; }
.BorderGrid-row + .BorderGrid-row .BorderGrid-cell { border-top: 1px solid var(--borderColor-muted); }
.BorderGrid--spacious .BorderGrid-cell { padding: 16px 0; }
.BorderGrid-row:first-child .BorderGrid-cell { padding-top: 0; }
.h4 { font-size: 16px; font-weight: 600; }

/* ---- Box ---- */
.Box { background: var(--bgColor-default); border: 1px solid var(--borderColor-default); border-radius: 6px; }
.Box-header { padding: 16px; background: var(--bgColor-muted); border-bottom: 1px solid var(--borderColor-default); border-top-left-radius: 6px; border-top-right-radius: 6px; }
.Box-body { padding: 16px; }
.Box-row { padding: 16px; border-top: 1px solid var(--borderColor-muted); }
.Box-row:first-child { border-top: 0; }
.Box-footer { padding: 16px; border-top: 1px solid var(--borderColor-default); }

/* ---- Buttons（Primer の .btn に GitHub 現行の寸法を寄せる） ---- */
.btn { display: inline-flex; align-items: center; gap: 4px; height: 32px; padding: 0 12px; font-size: 14px; font-weight: 500; line-height: 20px; color: var(--fgColor-default); background: var(--bgColor-muted); border: 1px solid var(--borderColor-default); border-radius: 6px; box-shadow: 0 1px 0 rgba(31,35,40,.04); cursor: pointer; white-space: nowrap; }
.btn:hover { background: var(--bgColor-neutral-muted); text-decoration: none; }
.btn .octicon { color: var(--fgColor-muted); }
.btn-sm { height: 28px; padding: 0 8px; font-size: 12px; }
.btn-primary { color: var(--fgColor-onEmphasis); background: var(--bgColor-success-emphasis); border-color: rgba(31,35,40,.15); }
.btn-primary:hover { background: #1c8139; }
.btn-primary .octicon { color: var(--fgColor-onEmphasis); }
.btn[aria-disabled="true"] { color: var(--fgColor-disabled); cursor: default; }
.BtnGroup { display: inline-flex; }
.BtnGroup-item { border-radius: 0; margin-right: -1px; }
.BtnGroup-item:first-child { border-top-left-radius: 6px; border-bottom-left-radius: 6px; }
.BtnGroup-item:last-child { border-top-right-radius: 6px; border-bottom-right-radius: 6px; margin-right: 0; }
.rounded-right-0 { border-top-right-radius: 0 !important; border-bottom-right-radius: 0 !important; }
.rounded-left-0 { border-top-left-radius: 0 !important; border-bottom-left-radius: 0 !important; }
.border-left-0 { border-left: 0 !important; }
.form-control { padding: 5px 12px; font-size: 14px; line-height: 20px; color: var(--fgColor-default); background: var(--bgColor-default); border: 1px solid var(--borderColor-default); border-radius: 6px; box-shadow: inset 0 1px 0 rgba(208,215,222,.2); }
.input-sm { min-height: 28px; padding: 3px 8px; font-size: 12px; }
.input-monospace { font-family: var(--fontStack-monospace); }
.Label { display: inline-block; padding: 0 7px; font-size: 12px; font-weight: 500; line-height: 18px; white-space: nowrap; border: 1px solid; border-radius: 2em; }
.Label--secondary { color: var(--fgColor-muted); border-color: var(--borderColor-default); }
.Label--success { color: var(--fgColor-success); border-color: var(--borderColor-success-emphasis); }
.Label--danger { color: var(--fgColor-danger); border-color: var(--borderColor-danger-emphasis); }
.Label--accent { color: var(--fgColor-accent); border-color: var(--borderColor-accent-emphasis); }
.Counter { display: inline-block; min-width: 20px; padding: 0 6px; font-size: 12px; font-weight: 500; line-height: 18px; color: var(--fgColor-default); text-align: center; background: var(--bgColor-neutral-muted); border-radius: 2em; }
.blankslate { padding: 64px 40px; text-align: center; }
.blankslate-icon { color: var(--fgColor-muted); margin-bottom: 8px; }
.blankslate-heading { font-size: 20px; font-weight: 600; }
.tabnav-tabs { display: flex; border-bottom: 1px solid var(--borderColor-default); }
.tabnav-tab { padding: 6px 12px; font-size: 14px; color: var(--fgColor-muted); border: 1px solid transparent; border-bottom: 0; }
.tabnav-tab.selected { color: var(--fgColor-default); background: var(--bgColor-default); border-color: var(--borderColor-default); border-radius: 6px 6px 0 0; margin-bottom: -1px; }

/* ---- SelectMenu（ブランチ切替・Code ドロップダウン） ---- */
.details-reset > summary { list-style: none; }
.details-reset > summary::-webkit-details-marker { display: none; }
.details-overlay { position: relative; }
.details-overlay[open] > summary::before { content: ""; position: fixed; inset: 0; z-index: 80; cursor: default; }
.SelectMenu { position: absolute; top: 36px; left: 0; z-index: 99; min-width: 300px; }
.SelectMenu.right-0 { left: auto; right: 0; }
.SelectMenu-modal { background: var(--bgColor-default); border: 1px solid var(--borderColor-default); border-radius: 12px; box-shadow: 0 8px 24px rgba(140,149,159,.2); overflow: hidden; }
.SelectMenu-header { display: flex; align-items: center; padding: 12px 16px; border-bottom: 1px solid var(--borderColor-muted); }
.SelectMenu-title { font-size: 14px; font-weight: 600; }
.SelectMenu-tabs { display: flex; padding: 0 16px; border-bottom: 1px solid var(--borderColor-muted); }
.SelectMenu-tab { padding: 8px 12px; font-size: 12px; color: var(--fgColor-muted); border-bottom: 2px solid transparent; }
.SelectMenu-tab[aria-selected="true"] { color: var(--fgColor-default); font-weight: 600; border-bottom-color: #fd8c73; }
.SelectMenu-list { max-height: 400px; overflow-y: auto; padding: 8px; }
.SelectMenu-item { display: flex; align-items: center; gap: 8px; padding: 6px 8px; font-size: 14px; color: var(--fgColor-default); border-radius: 6px; }
.SelectMenu-item:hover { background: var(--bgColor-neutral-muted); text-decoration: none; }
.SelectMenu-icon--check { visibility: hidden; }
.SelectMenu-item[aria-checked="true"] .SelectMenu-icon--check { visibility: visible; }
.branch-select .btn .octicon-git-branch, .branch-select .btn .octicon-tag { margin-right: 2px; }
.css-truncate-target { display: inline-block; max-width: 125px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: top; }
.css-truncate-overflow { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---- パンくず ---- */
.file-breadcrumb { display: flex; align-items: center; flex-wrap: wrap; font-size: 16px; }
.file-breadcrumb .separator { color: var(--fgColor-muted); padding: 0 6px; }
.file-breadcrumb .final-path { font-weight: 600; }

/* ---- ファイルツリー ---- */
.file-tree-head { display: flex; align-items: center; gap: 8px; padding: 12px 16px; font-size: 14px; }
.file-tree { width: 100%; border-collapse: collapse; table-layout: fixed; }
.file-tree-row { border-top: 1px solid var(--borderColor-muted); }
.file-tree-row:first-child { border-top: 0; }
.file-tree-row:hover { background: var(--bgColor-muted); }
.file-tree td { padding: 8px 16px; font-size: 14px; line-height: 24px; vertical-align: middle; }
.file-tree-name { width: 40%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.file-tree-name .octicon { vertical-align: text-bottom; }
.icon-directory { color: var(--fgColor-accent); }
.file-tree-msg { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-tree-age { width: 140px; text-align: right; white-space: nowrap; }
.readme-head { padding: 12px 16px; background: var(--bgColor-default); position: sticky; top: 0; z-index: 1; border-top-left-radius: 6px; border-top-right-radius: 6px; }
.markdown-body { font-size: 16px; }

/* ---- プロフィール ---- */
.profile-avatar img { width: 100%; max-width: 260px; height: auto; border: 1px solid var(--borderColor-muted); border-radius: 50% !important; }
.profile-names { margin-top: 16px; font-size: 24px; line-height: 1.25; }
.profile-names .p-nickname { display: block; font-size: 20px; font-weight: 300; color: var(--fgColor-muted); }
.profile-meta { margin-top: 8px; font-size: 14px; }
.repo-list { list-style: none; margin: 0; padding: 0; }
.repo-list-item { padding: 24px 0; border-bottom: 1px solid var(--borderColor-muted); }
.repo-list-name { font-size: 20px; font-weight: 600; margin: 0; }
.repo-list-desc { margin: 4px 0 8px; color: var(--fgColor-muted); font-size: 14px; }
.repo-list-meta { display: flex; gap: 16px; font-size: 12px; color: var(--fgColor-muted); }
.repo-list-meta .octicon { vertical-align: text-bottom; }

/* ---- blob ---- */
.blob-last-commit { padding: 12px 16px; border: 1px solid var(--borderColor-default); border-radius: 6px; background: var(--bgColor-muted); }
.blob-head { padding: 8px 16px; background: var(--bgColor-muted); }
.segmented { display: inline-flex; background: var(--bgColor-muted); border: 1px solid var(--borderColor-default); border-radius: 6px; padding: 0; }
.segmented-item { display: inline-flex; align-items: center; height: 26px; padding: 0 10px; font-size: 12px; font-weight: 500; color: var(--fgColor-muted); border-radius: 6px; }
.segmented-item:hover { text-decoration: none; color: var(--fgColor-default); }
.segmented-item.selected { color: var(--fgColor-default); background: var(--bgColor-default); box-shadow: 0 1px 0 rgba(31,35,40,.04), inset 0 0 0 1px var(--borderColor-default); }
.blob-wrapper { overflow-x: auto; border-bottom-left-radius: 6px; border-bottom-right-radius: 6px; }
table.highlight, .diff-table { width: 100%; border-collapse: collapse; border-spacing: 0; font-family: var(--fontStack-monospace, ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace); font-size: 12px; line-height: 20px; }
.tab-size[data-tab-size="4"] { tab-size: 4; }
.blob-num { width: 1%; min-width: 50px; padding: 0 10px; color: var(--fgColor-muted); text-align: right; white-space: nowrap; vertical-align: top; cursor: pointer; user-select: none; }
.blob-num::before { content: attr(data-line-number); }
.blob-num:hover { color: var(--fgColor-default); }
.blob-code { position: relative; padding: 0 10px 0 10px; white-space: pre; vertical-align: top; overflow: visible; word-wrap: normal; color: var(--fgColor-default); }
.blob-code .hljs { background: transparent; padding: 0; display: inline; }
table.highlight tr:hover { background: var(--bgColor-muted); }
table.highlight tr.highlighted .blob-num, table.highlight tr.highlighted .blob-code, table.highlight td:target, table.highlight td:target + td { background: var(--bgColor-attention-muted); }
table.highlight tr.highlighted .blob-num { color: var(--fgColor-default); }

/* ---- commits ---- */
.commit-group { position: relative; padding-left: 16px; margin-bottom: 16px; }
.commit-group::before { content: ""; position: absolute; left: 0; top: 0; bottom: -16px; width: 2px; background: var(--borderColor-muted); }
.commit-group:last-of-type::before { bottom: 0; }
.commit-group-title { position: relative; margin: 0 0 8px; padding-left: 8px; font-size: 14px; font-weight: 400; color: var(--fgColor-muted); }
.commit-group-title .octicon { position: absolute; left: -24px; top: 3px; background: var(--bgColor-default); }
.commit-row { padding: 12px 16px; }
.commit-row .avatar { vertical-align: middle; }
.paginate-container { display: flex; justify-content: center; }

/* ---- commit ---- */
.commit-box-head { padding: 16px; }
.commit-title { font-size: 20px; font-weight: 600; line-height: 1.25; margin: 0; }
.commit-desc { margin: 8px 0 0; font-family: var(--fontStack-sansSerif); font-size: 14px; white-space: pre-wrap; color: var(--fgColor-default); }
.commit-box-meta { padding: 8px 16px; background: var(--bgColor-muted); border-bottom-left-radius: 6px; border-bottom-right-radius: 6px; }
.diffstat-summary { color: var(--fgColor-muted); }
.file-diff { margin-bottom: 16px; border: 1px solid var(--borderColor-default); border-radius: 6px; overflow: hidden; }
.file-diff-header { display: flex; align-items: center; padding: 8px 16px; background: var(--bgColor-muted); cursor: pointer; list-style: none; position: sticky; top: 0; z-index: 2; }
.file-diff-header::-webkit-details-marker { display: none; }
.file-diff-details[open] > .file-diff-header { border-bottom: 1px solid var(--borderColor-default); }
.fold-chevron { display: inline-flex; margin-right: 8px; color: var(--fgColor-muted); transition: transform .12s; }
.file-diff-details:not([open]) .fold-chevron { transform: rotate(-90deg); }
.file-diff-info { display: flex; align-items: center; gap: 8px; flex: 1; min-width: 0; }
.file-diff-path { font-size: 12px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.diffstat { display: inline-flex; gap: 1px; }
.diffstat span { width: 8px; height: 8px; display: inline-block; }
.diffstat-block-added { background: var(--bgColor-success-emphasis); }
.diffstat-block-deleted { background: var(--bgColor-danger-emphasis); }
.diffstat-block-neutral { background: var(--bgColor-neutral-muted); border: 1px solid var(--borderColor-default); box-sizing: border-box; }
.file-diff-body { overflow-x: auto; }
.diff-table .blob-num { min-width: 44px; }
.blob-code-marker { display: inline-block; width: 12px; color: inherit; user-select: none; }
.blob-code-hunk, .blob-num-hunk { background: var(--diffBlob-hunkLine-bgColor, var(--bgColor-accent-muted)); color: var(--fgColor-muted); }
.blob-code-hunk { padding: 4px 10px; }
.diff-line-addition .blob-code { background: var(--diffBlob-additionLine-bgColor, var(--bgColor-success-muted)); }
.diff-line-addition .blob-num { background: var(--diffBlob-additionNum-bgColor, #aceebb); color: var(--fgColor-default); }
.diff-line-deletion .blob-code { background: var(--diffBlob-deletionLine-bgColor, var(--bgColor-danger-muted)); }
.diff-line-deletion .blob-num { background: var(--diffBlob-deletionNum-bgColor, #ffcecb); color: var(--fgColor-default); }
.diff-line-meta .blob-code { color: var(--fgColor-muted); }

/* ---- フッター ---- */
.site-footer { margin-top: 48px; padding: 24px 0; border-top: 1px solid var(--borderColor-muted); font-size: 12px; }
.site-footer-inner { display: flex; align-items: center; gap: 8px; padding: 0 16px; }
.copied-tooltip { position: fixed; z-index: 1000; padding: 6px 8px; font-size: 12px; color: var(--fgColor-onEmphasis); background: var(--bgColor-emphasis); border-radius: 6px; pointer-events: none; }

/* ---- フォーム・通知 ---- */
.flash { padding: 12px 16px; border: 1px solid var(--borderColor-accent-muted); border-radius: 6px; background: var(--bgColor-accent-muted); color: var(--fgColor-default); font-size: 14px; }
.flash-error { border-color: var(--borderColor-danger-muted); background: var(--bgColor-danger-muted); }
.flash-success { border-color: var(--borderColor-success-muted); background: var(--bgColor-success-muted); }
.flash .octicon { vertical-align: text-bottom; }
.Subhead { padding-bottom: 8px; margin-bottom: 16px; border-bottom: 1px solid var(--borderColor-muted); }
.Subhead-heading { margin: 0; }
.UnderlineNav--profile { display: flex; align-items: center; }
.ml-auto { margin-left: auto; }
.btn-block { width: 100%; }
.width-full { width: 100%; }
.text-left { text-align: left; }
.container-md { max-width: 768px; margin-left: auto; margin-right: auto; }
.mt-8 { margin-top: 64px; }
.mt-5 { margin-top: 32px; }
.token-box code { user-select: all; }
.form-select { height: 32px; padding: 0 28px 0 12px; font-size: 14px; color: var(--fgColor-default); background: var(--bgColor-muted); border: 1px solid var(--borderColor-default); border-radius: 6px; }
.btn-danger { color: var(--fgColor-danger); }
.btn-danger:hover { color: var(--fgColor-onEmphasis); background: var(--bgColor-danger-emphasis); border-color: var(--borderColor-danger-emphasis); }
.btn-danger:hover .octicon { color: inherit; }

/* ---- branches / tags ---- */
.subnav-tabs { display: inline-flex; border: 1px solid var(--borderColor-default); border-radius: 6px; overflow: hidden; }
.subnav-tab { display: inline-flex; align-items: center; height: 30px; padding: 0 14px; font-size: 14px; font-weight: 500; color: var(--fgColor-default); border-left: 1px solid var(--borderColor-default); }
.subnav-tab:first-child { border-left: 0; }
.subnav-tab:hover { text-decoration: none; background: var(--bgColor-muted); }
.subnav-tab.selected { color: var(--fgColor-onEmphasis); background: var(--bgColor-accent-emphasis); }
.subnav-tab.selected .octicon { color: inherit; }
.branch-row { padding: 12px 16px; }
.branch-name { display: inline-block; padding: 2px 6px; font-family: var(--fontStack-monospace); font-size: 12px; color: var(--fgColor-accent) !important; background: var(--bgColor-accent-muted); border-radius: 6px; }
.branch-a-b { display: inline-flex; align-items: center; gap: 4px; width: 180px; }
.branch-a-b-count { width: 32px; font-size: 12px; }
.branch-a-b-bars { display: inline-flex; width: 100px; height: 8px; }
.branch-a-b-bars .bar-behind { display: inline-block; height: 100%; margin-left: auto; background: var(--bgColor-neutral-emphasis); border-radius: 4px 0 0 4px; }
.branch-a-b-bars .bar-ahead { display: inline-block; height: 100%; background: var(--bgColor-success-emphasis); border-radius: 0 4px 4px 0; }
.branch-a-b-bars { justify-content: center; }
.branch-a-b-bars .bar-behind { margin-left: 0; }
.branch-a-b-bars::before { content: ""; display: block; width: 1px; height: 12px; background: var(--borderColor-default); order: 1; margin: -2px 0; }
.branch-a-b-bars .bar-behind { order: 0; }
.branch-a-b-bars .bar-ahead { order: 2; }
.SelectMenu-footer { padding: 8px 16px; border-top: 1px solid var(--borderColor-muted); background: var(--bgColor-muted); }
