/* Workspace, identities and account settings share the product component system. */
.home-layout { display: grid; grid-template-columns: 220px minmax(0,1fr) 260px; gap: 28px; min-height: calc(100dvh - 180px); align-items: start; }
.home-sidebar { min-width: 0; font-size: 13px; }
.home-account { display: flex; gap: 10px; align-items: center; color: var(--text); text-decoration: none; margin: 4px 0 24px; }
.home-account img { width: 36px; height: 36px; border-radius: 6px; }
.home-account span { display: grid; gap: 2px; }
.home-account small { font-size: 11px; color: var(--text-faint); }
.home-navigation { display: grid; gap: 3px; padding-bottom: 22px; border-bottom: 1px solid var(--border-subtle); }
.home-navigation a { padding: 8px 10px; border-radius: var(--radius-sm); color: var(--text-dim); text-decoration: none; }
.home-navigation a[aria-current="page"] { color: var(--text); background: var(--panel-hover); box-shadow: none; }
.home-navigation a:hover { background: var(--panel-soft); }
.home-repo-heading { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin: 24px 0 12px; }
.home-repo-heading h2 { margin: 0; font-size: 12px; color: var(--text-dim); font-weight: 600; }
.home-repo-heading a { font-size: 11px; text-decoration: none; }
.home-repos { display: grid; gap: 3px; }
.home-repos>a { display: flex; gap: 9px; align-items: center; padding: 6px 0; color: var(--text); text-decoration: none; overflow: hidden; }
.home-repos>a>span:last-child { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.home-repos>a:hover { color: var(--accent-text); }
.home-repo-icon { color: var(--text-faint); }
.home-heading { display: flex; justify-content: space-between; align-items: center; gap: 18px; margin-bottom: 30px; }
.home-heading h1 { margin: 0; font-size: 24px; letter-spacing: -.035em; line-height: 1.3; }
.home-heading p { margin: 5px 0 0; font-size: 13px; }
.home-section { margin-bottom: 28px; }
.home-section .section-head { margin-bottom: 12px; }
.home-section .section-head h2 { font-size: 14px; }
.home-section .section-head a { font-size: 12px; text-decoration: none; }
.home-feed-list { border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; background: var(--panel-soft); }
.home-feed-row { display: flex; align-items: flex-start; gap: 12px; padding: 16px; color: var(--text); text-decoration: none; border-bottom: 1px solid var(--border); }
.home-feed-row:last-child { border-bottom: 0; }
.home-feed-row:hover { background: var(--panel-hover); }
.home-feed-row>div { min-width: 0; display: grid; gap: 5px; }
.home-feed-row strong { font-size: 14px; font-weight: 600; overflow-wrap: anywhere; }
.home-feed-row small { font-size: 12px; color: var(--text-faint); }
.home-pr-icon, .home-work-icon { font-size: 20px; color: var(--positive); line-height: 1.1; flex-shrink: 0; }
.home-work-icon.closed { color: var(--text-faint); }
.home-context { min-width: 0; }
.home-context>section { padding: 18px; border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 18px; background: var(--panel-soft); }
.home-context h2 { font-size: 14px; margin: 0 0 10px; }
.home-context p { font-size: 13px; }
.home-activity { font-size: 12px; }
.home-activity .list-item { flex-direction: column; gap: 2px; font-size: 12px; }
.profile-layout { display: grid; grid-template-columns: 260px minmax(0,1fr); gap: 40px; align-items: start; max-width: 1200px; }
.profile-sidebar { min-width: 0; }
.profile-avatar { display: block; width: 240px; height: 240px; border: 1px solid var(--border-strong); border-radius: 6px; object-fit: cover; background: var(--panel-soft); }
.profile-sidebar h1 { font-size: 26px; line-height: 1.2; letter-spacing: -.025em; margin: 18px 0 3px; overflow-wrap: anywhere; }
.profile-handle { font-size: 19px; color: var(--text-faint); margin-bottom: 14px; }
.profile-sidebar p { margin: 14px 0; font-size: 14px; line-height: 1.6; }
.profile-sidebar .btn { width: 100%; margin-top: 10px; }
.profile-meta { font-size: 13px; margin: 16px 0; }
.profile-meta>div { display: grid; grid-template-columns: 65px minmax(0,1fr); gap: 9px; margin-bottom: 7px; }
.profile-meta dt { color: var(--text-faint); }
.profile-meta dd { margin: 0; overflow-wrap: anywhere; }
.profile-meta a { color: var(--text); text-decoration: none; }
.profile-main { min-width: 0; }
.profile-tabs { gap: 20px; margin-bottom: 24px; }
.profile-tabs a { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; }
.profile-pane>h2, .profile-overview-activity h2 { font-size: 16px; margin-top: 0; }
.profile-pane .section-head { margin-bottom: 14px; }
.profile-pane .section-head h2 { font-size: 16px; font-weight: 500; }
.profile-readme { border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; margin-bottom: 24px; }
.profile-readme>:first-child { margin-top: 0; }
.repo-card-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 14px; }
.repo-card { min-width: 0; padding: 16px; border: 1px solid var(--border); border-radius: var(--radius-sm); color: var(--text); text-decoration: none; background: transparent; }
.repo-card:hover { border-color: var(--border-strong); background: var(--panel-soft); }
.repo-card-heading { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.repo-card strong { color: var(--accent-text); font-size: 14px; overflow-wrap: anywhere; }
.repo-card p { font-size: 13px; color: var(--text-dim); margin: 9px 0 16px; min-height: 38px; }
.repo-card small { color: var(--text-faint); font-size: 11px; }
.profile-no-repos { grid-column: 1/-1; padding: 24px; border: 1px solid var(--border); border-radius: var(--radius); }
.profile-no-repos p { margin-bottom: 0; font-size: 13px; }
.profile-repository-toolbar { display: flex; gap: 10px; margin-bottom: 16px; }
.profile-repository-toolbar input { flex: 1; min-width: 0; }
.profile-repository-row { padding: 20px 0; border-bottom: 1px solid var(--border); }
.profile-repository-row:first-child { padding-top: 8px; }
.profile-repository-row>div { display: flex; gap: 10px; align-items: center; }
.profile-repository-row a { font-size: 18px; font-weight: 600; text-decoration: none; }
.profile-repository-row p { margin: 8px 0 12px; font-size: 13px; }
.profile-repository-row small { color: var(--text-faint); font-size: 12px; }
.profile-overview-activity { margin-top: 30px; }
.activity-row { display: flex; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--border-subtle); color: var(--text); text-decoration: none; font-size: 13px; }
.activity-row>div { display: grid; gap: 5px; }
.activity-row span:not(.activity-dot) { font-size: 12px; color: var(--text-faint); }
.activity-row:hover strong { color: var(--accent-text); }
.activity-dot { width: 7px; height: 7px; margin-top: 7px; border-radius: 50%; background: var(--accent); flex-shrink: 0; }
.member-grid { display: grid; grid-template-columns: repeat(auto-fill,minmax(210px,1fr)); gap: 12px; }
.member-chip { display: inline-flex; align-items: center; gap: 12px; color: var(--text); text-decoration: none; padding: 12px; border: 1px solid var(--border); border-radius: var(--radius); }
.member-chip img { width: 40px; height: 40px; border-radius: 6px; object-fit: cover; }
.member-chip span { display: grid; gap: 3px; font-size: 13px; }
.member-chip small { color: var(--text-faint); font-size: 11px; }
.organization-profile .profile-avatar { width: 160px; height: 160px; border-radius: var(--radius-lg); }
.profile-team { padding: 14px 18px; border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 12px; }
.profile-team h3 { margin: 0 0 7px; font-size: 15px; }
.profile-team p { margin: 0; font-size: 13px; }
.org-grid { display: grid; grid-template-columns: repeat(auto-fill,minmax(280px,1fr)); gap: 18px; }
.org-card { display: flex; align-items: flex-start; gap: 16px; padding: 20px; border: 1px solid var(--border); border-radius: var(--radius); color: var(--text); text-decoration: none; }
.org-card:hover { background: var(--panel-soft); }
.org-card img { width: 64px; height: 64px; border-radius: var(--radius); }
.org-card>div { min-width: 0; }
.org-card strong { display: block; font-size: 16px; }
.org-card span { color: var(--text-faint); font-size: 12px; }
.org-card p { margin: 8px 0 0; font-size: 13px; color: var(--text-dim); }
.settings-layout, .settings-shell { display: grid; grid-template-columns: 210px minmax(0,800px); gap: 40px; align-items: start; max-width: 1160px; }
.settings-nav { position: sticky; top: 88px; display: grid; gap: 3px; }
.settings-nav h2 { font-size: 13px; margin: 0 0 10px; color: var(--text-dim); font-weight: 600; }
.settings-nav a { display: block; padding: 9px 12px; border-radius: var(--radius-sm); font-size: 13px; color: var(--text-dim); text-decoration: none; }
.settings-nav a:hover { background: var(--panel-soft); }
.settings-nav a.active { color: var(--text); background: var(--panel-hover); box-shadow: none; }
.settings-content { min-width: 0; }
.settings-section { padding: 0 0 24px; }
.settings-section h1, .settings-section h2 { margin: 0 0 18px; padding-bottom: 12px; border-bottom: 1px solid var(--border); font-size: 23px; font-weight: 550; letter-spacing: -.025em; }
.settings-section h3 { font-size: 16px; margin-top: 24px; }
.settings-section p { font-size: 13px; }
.settings-content>.panel { padding: 0; border: 0; background: transparent; }
.form-stack, .settings-form { display: grid; gap: 18px; max-width: 680px; }
.form-stack label, .settings-form label { display: grid; gap: 7px; font-size: 13px; font-weight: 500; }
.form-stack input, .form-stack select, .settings-form input:not([type=checkbox]), .settings-form select { width: 100%; }
.form-stack button[type=submit], .form-stack>button, .settings-form>button { justify-self: start; }
.form-stack textarea { min-height: 100px; }
.avatar-setting { display: flex; align-items: center; gap: 24px; margin: 20px 0 28px; }
.settings-avatar { width: 96px; height: 96px; border-radius: 6px; object-fit: cover; border: 1px solid var(--border); }
.avatar-setting input[type=file] { display: block; max-width: 100%; margin-bottom: 12px; font-size: 12px; }
.avatar-setting .btn { margin-right: 6px; }
.danger-zone { padding: 20px; border: 1px solid var(--danger-border); border-radius: var(--radius); background: var(--danger-soft); }
.danger-zone h2 { color: var(--danger); }
#settings-status:not(:empty), #org-status:not(:empty), #org-list-status:not(:empty) { padding: 12px 14px; border: 1px solid var(--border); border-radius: var(--radius); margin: 20px 0; font-size: 13px; }
.auth-page { min-height: calc(100dvh - 172px); display: grid; place-items: center; padding: 20px 0; }
.auth-card { width: min(100%,420px); padding: 32px; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--panel-soft); }
.auth-brand { display: flex; align-items: center; gap: 10px; margin-bottom: 24px; font-size: 15px; font-weight: 650; }
.auth-card h1 { margin: 0 0 10px; font-size: 24px; line-height: 1.3; letter-spacing: -.03em; }
.auth-copy { font-size: 13px; margin-bottom: 24px; }
.auth-form { display: grid; gap: 16px; }
.auth-form label { display: grid; gap: 7px; font-size: 13px; }
.auth-form input { width: 100%; }
.auth-submit, .auth-toggle { width: 100%; }
.auth-divider { display: flex; align-items: center; gap: 12px; margin: 20px 0; color: var(--text-faint); font-size: 11px; }
.auth-divider::before, .auth-divider::after { content: ''; flex: 1; height: 1px; background: var(--border); }
.auth-card .error { font-size: 13px; margin-bottom: 0; }
.dialog-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.dialog-heading h2 { margin: 0; font-size: 21px; }
.work-page .page-head h1 { font-size: 26px; }
.work-page .page-head p { margin: 6px 0 0; font-size: 14px; }
.work-list-toolbar { display: flex; align-items: center; gap: 14px; margin-bottom: 16px; flex-wrap: wrap; }
.work-list-toolbar input { min-width: 140px; flex: 1; }
.work-list-toolbar #work-count { font-size: 12px; }
.work-row { display: flex; align-items: flex-start; gap: 12px; padding: 15px 18px; border-bottom: 1px solid var(--border-subtle); color: var(--text); text-decoration: none; }
.work-row:last-child { border-bottom: 0; }
.work-row:hover { background: var(--panel-hover); }
.work-row>div { min-width: 0; display: grid; gap: 5px; flex: 1; }
.work-row strong { font-size: 14px; font-weight: 600; overflow-wrap: anywhere; }
.work-row span:not(.badge):not(.home-work-icon) { font-size: 12px; color: var(--text-faint); }
.work-form-meta { display: grid; grid-template-columns: 130px minmax(0,1fr); gap: 14px; }
.work-form-meta>label:last-child { grid-column: 1/-1; }
@media(max-width:1100px) { .home-layout { grid-template-columns: 200px minmax(0,1fr); } .home-context { grid-column: 2; display: grid; grid-template-columns: 1fr 1fr; gap: 16px; } .profile-layout { grid-template-columns: 220px minmax(0,1fr); gap: 28px; } .profile-avatar { width: 200px; height: 200px; } }
@media(max-width:768px) { .home-layout { grid-template-columns: minmax(0,1fr); } .home-sidebar { order: 2; padding-top: 10px; border-top: 1px solid var(--border); } .home-account, .home-navigation { display: none; } .home-feed { order: 1; } .home-context { grid-column: 1; order: 3; } .profile-layout { grid-template-columns: minmax(0,1fr); gap: 24px; } .profile-avatar { width: 140px; height: 140px; } .profile-sidebar .btn { width: auto; } .profile-sidebar h1 { margin-top: 12px; } .settings-layout, .settings-shell { grid-template-columns: minmax(0,1fr); gap: 24px; } .settings-nav { position: static; display: flex; overflow: auto; } .settings-nav h2 { display: none; } .settings-nav a { white-space: nowrap; } .avatar-setting { align-items: flex-start; } }
@media(max-width:430px) { .home-heading { align-items: flex-start; } .home-heading h1 { font-size: 22px; } .home-context { grid-template-columns: 1fr; } .repo-card-grid { grid-template-columns: 1fr; } .profile-tabs { gap: 16px; } .profile-repository-toolbar { flex-wrap: wrap; } .profile-repository-toolbar input { flex-basis: 100%; } .avatar-setting { flex-direction: column; gap: 16px; } .auth-card { padding: 24px; } .work-form-meta { grid-template-columns: 1fr; } .org-grid { grid-template-columns: minmax(0,1fr); } }
.page-context { display:flex; justify-content:flex-end; margin-bottom:var(--space-4); grid-column:1/-1; }
.settings-content > .danger-zone { padding:20px; }

.home-layout { min-height: 0; height: 100%; gap: 22px; overflow: hidden; align-items: stretch; }
.home-layout>section, .home-sidebar, .home-context { min-height: 0; overflow: auto; overscroll-behavior: contain; }
.home-heading { margin-bottom: 18px; }
.home-section { margin-bottom: 18px; }
.home-feed-list { max-height: 32dvh; overflow: auto; }
.home-feed-row { padding: 11px 14px; }
.home-feed-row>div { gap: 3px; }
.home-context>section { padding: 14px; margin-bottom: 14px; }
.profile-layout { height: 100%; min-height: 0; overflow: hidden; gap: 28px; align-items: stretch; }
.profile-sidebar { overflow: auto; }
.profile-avatar { width: 180px; height: 180px; }
.profile-main { min-height: 0; display: flex; flex-direction: column; overflow: hidden; }
.profile-tabs { flex-shrink: 0; margin-bottom: 16px; }
.profile-pane { min-height: 0; overflow: auto; overscroll-behavior: contain; }
.profile-readme { padding: 16px; max-height: 24dvh; overflow: auto; margin-bottom: 16px; }
.repo-card-grid { gap: 10px; }
.repo-card { padding: 12px 14px; }
.repo-card p { margin: 6px 0 10px; min-height: 0; }
.profile-overview-activity { margin-top: 18px; }
.profile-overview-activity h2 { font-size: 14px; margin: 0; padding: 12px; border-bottom: 1px solid var(--border); }
#profile-recent-activity { max-height: 22dvh; overflow: auto; }
.activity-row { padding: 10px 12px; }
.activity-row>div { gap: 2px; min-width: 0; }
.profile-repository-row { padding: 12px 0; }
.profile-repository-row a { font-size: 15px; }
.profile-repository-row p { margin: 5px 0 8px; }
@media(max-width:768px) {
 .home-layout { display: flex; flex-direction: column; overflow: auto; }
 .home-layout>section, .home-sidebar, .home-context { overflow: visible; flex-shrink: 0; }
 .home-feed-list { max-height: 36dvh; }
 .profile-layout { display: flex; flex-direction: column; gap: 16px; }
 .profile-sidebar { flex-shrink: 0; max-height: 28dvh; }
 .profile-avatar { width: 72px; height: 72px; float: left; margin-right: 16px; }
 .profile-sidebar h1 { margin-top: 3px; font-size: 22px; }
 .profile-main { flex: 1; }
}
.repo-card .commit-activity { display: block; width: 96px; height: 24px; margin: 8px 0 0 auto; }
.profile-repository-row { position: relative; padding-right: 130px; }
.profile-repository-row>.commit-activity { position: absolute; right: 0; top: 24px; }
#profile-activity { max-height: calc(100dvh - 280px); }
@media(max-width:560px) { .profile-repository-row { padding-right: 100px; } .profile-repository-row>.commit-activity { width: 86px; } }
.profile-pane { flex: 1; }
#overview { display: flex; flex-direction: column; overflow: hidden; }
#overview>.section-head, #overview>.profile-readme { flex-shrink: 0; }
#pinned-repos { flex-shrink: 0; overflow: visible; }
.profile-overview-activity { min-height: 0; display: flex; flex-direction: column; flex: 1; max-height: 36dvh; }
.profile-overview-activity h2, .profile-overview-activity .pagination { flex-shrink: 0; }
#profile-recent-activity { flex: 1; max-height: none; }
#activity, #repositories { display: flex; flex-direction: column; overflow: hidden; }
#activity>h2, .profile-repository-toolbar { flex-shrink: 0; }
#activity>.scroll-card { display: flex; flex-direction: column; flex: 1; }
#profile-activity { flex: 1; max-height: none; }
#profile-activity-pagination { flex-shrink: 0; }
#profile-repos { flex: 1; min-height: 0; overflow: auto; }

.profile-avatar { width: min(100%, 250px); height: auto; aspect-ratio: 1; border-radius: 6px; }
.profile-connections { margin: 16px 0; font-size: 13px; }
.profile-sidebar section h2 { font-size: 14px; margin: 20px 0 10px; }
.profile-org-grid { display: grid; grid-template-columns: repeat(8, 28px); gap: 4px; }
.profile-org-grid .member-chip { padding: 0; border: 0; }
.profile-org-grid img { width: 28px; height: 28px; border-radius: 4px; }
.contribution-card { flex-shrink: 0; margin-top: 16px; padding: 12px; border: 1px solid var(--border); border-radius: 6px; }
.contribution-card h2 { font-size: 14px; margin: 0 0 12px; }
.contribution-card p { font-size: 11px; margin-bottom: 0; }
.contribution-graph { overflow-x: auto; padding: 2px; }
.contribution-grid { display: grid; grid-auto-flow: column; grid-template-rows: repeat(7, 10px); grid-auto-columns: 10px; gap: 3px; width: max-content; }
.contribution-cell { display: inline-block; width: 10px; height: 10px; border-radius: 2px; background: var(--panel-soft); }
.contribution-cell.blank { visibility: hidden; }
.contribution-cell.level-1 { background: #214d3a; }
.contribution-cell.level-2 { background: #2b8055; }
.contribution-cell.level-3 { background: #39ae6d; }
.contribution-cell.level-4 { background: #5edc89; }
.contribution-legend { display: flex; gap: 4px; align-items: center; justify-content: flex-end; margin-top: 8px; font-size: 10px; }
#overview { overflow-y: auto; }
#overview .profile-overview-activity { flex: 0 0 260px; max-height: 260px; }
@media(max-width:768px) { .profile-avatar { width: 100px; height: 100px; } .profile-org-grid { grid-template-columns: repeat(8,24px); } .profile-org-grid img { width:24px; height:24px; } }
.contribution-months { display: grid; grid-template-columns: repeat(54, 10px); gap: 3px; width: max-content; font-size: 10px; margin-bottom: 6px; }
.contribution-months span { overflow: visible; white-space: nowrap; }
.profile-tabs { overflow-x: auto; }
.profile-tabs a { white-space: nowrap; flex-shrink: 0; }
#followers, #following, #stars { overflow: hidden; display: flex; flex-direction: column; }
#followers-list, #following-list, #profile-stars { min-height: 0; overflow: auto; flex: 1; }
/* Each profile panel owns its scrolling; overview itself never nests a scrollbar. */
#overview { overflow: hidden; }
#pinned-repos { max-height: none; align-content: start; }
#overview .contribution-card { margin-top: 14px; }
#overview .profile-overview-activity { flex: 1; min-height: 100px; max-height: none; }
#profile-stars { align-content: start; }
@media(min-width:1101px) { .profile-layout { grid-template-columns: 250px minmax(0,1fr); } }
@media(max-width:768px) {
 .contribution-card { padding: 10px; }
 /* A narrow overview scrolls as one panel; its cards never overlap or nest
    another vertical scroll region inside it. The document stays fixed. */
 #overview { overflow-y: auto; }
 #overview .profile-overview-activity { flex: none; min-height: 0; }
 #overview #profile-recent-activity { flex: none; overflow: visible; }
}

/* Calendar weeks share one responsive column geometry. */
.contribution-grid { grid-auto-columns: auto; grid-template-columns: repeat(var(--contribution-weeks,53),minmax(10px,1fr)); width: 100%; min-width: calc(var(--contribution-weeks,53)*13px - 3px); }
.contribution-grid .contribution-cell { width: 100%; }
.contribution-grid .contribution-cell.blank { background: transparent; }
.contribution-months { grid-template-columns: repeat(var(--contribution-weeks,53),minmax(10px,1fr)); width: 100%; min-width: calc(var(--contribution-weeks,53)*13px - 3px); }
.contribution-title { display:flex; align-items:center; gap:8px; margin-bottom:12px; }
.contribution-title h2 { margin:0; }
.contribution-info { display:inline-flex; align-items:center; justify-content:center; padding:0; width:20px; height:20px; border:0; background:transparent; color:var(--muted); cursor:help; font-size:15px; }

.contribution-months span:last-child { justify-self: end; width: max-content; text-align: right; }
